gpu: ipu-v3: add support for 15-bit RGB with 1-bit alpha formats
Philipp Zabel
maintainerPATCH 1/6 gpu: ipu-v3: add support for 15-bit RGB with 1-bit alpha formats
This patch adds support for ARGB1555, ABGR1555, RGBA5551, and BGRA5551 in-memory formats.
--- drivers/gpu/ipu-v3/ipu-common.c | 4 ++++ drivers/gpu/ipu-v3/ipu-cpmem.c | 44 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+)
drivers/gpu/ipu-v3/ipu-common.c +4 -0
@@ -57,6 +57,10 @@ EXPORT_SYMBOL_GPL(ipu_srm_dp_sync_update);enum ipu_color_space ipu_drm_fourcc_to_colorspace (u32 drm_fourcc) {switch (drm_fourcc) { +case DRM_FORMAT_ARGB1555 : +case DRM_FORMAT_ABGR1555 : +case DRM_FORMAT_RGBA5551 : +case DRM_FORMAT_BGRA5551 :case DRM_FORMAT_RGB565 :case DRM_FORMAT_BGR565 :case DRM_FORMAT_RGB888 :
drivers/gpu/ipu-v3/ipu-cpmem.c +44 -0
56 lines not on this page · raw message
Signature · 6 lines
2.5.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Philipp Zabel
maintainerPATCH 2/6 drm/imx: enable 15-bit RGB with 1-bit alpha formats
This patch enables the ARGB1555, ABGR1555, RGBA5551, and BGRA5551 formats to be used on planes.
--- drivers/gpu/drm/imx/ipuv3-plane.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/imx/ipuv3-plane.c +8 -0
@@ -23,8 +23,12 @@#define to_ipu_plane (x) container_of(x, struct ipu_plane, base)static const uint32_t ipu_plane_formats[] = { +DRM_FORMAT_ARGB1555 ,DRM_FORMAT_XRGB1555 , +DRM_FORMAT_ABGR1555 ,DRM_FORMAT_XBGR1555 , +DRM_FORMAT_RGBA5551 , +DRM_FORMAT_BGRA5551 ,DRM_FORMAT_ARGB8888 ,DRM_FORMAT_XRGB8888 ,DRM_FORMAT_ABGR8888 ,
@@ -198,6 +202,10 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc,ipu_dp_set_window_pos (ipu_plane->dp, crtc_x, crtc_y);/* Enable local alpha on partial plane */ switch (fb->pixel_format) { +case DRM_FORMAT_ARGB1555 : +case DRM_FORMAT_ABGR1555 : +case DRM_FORMAT_RGBA5551 : +case DRM_FORMAT_BGRA5551 :case DRM_FORMAT_ARGB8888 :case DRM_FORMAT_ABGR8888 :ipu_dp_set_global_alpha (ipu_plane->dp, false,0 , false);
Signature · 6 lines
2.5.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Philipp Zabel
maintainerPATCH 3/6 gpu: ipu-v3: add support for RGBX8888 and RGBA8888 pixel formats
In reply to Philipp ZabelThis patch adds support for the RGBA8888, RGBX8888, BGRA8888, and BGRX8888 in-memory formats.
--- drivers/gpu/ipu-v3/ipu-cpmem.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-)
drivers/gpu/ipu-v3/ipu-cpmem.c +28 -4
@@ -452,7 +452,7 @@ void ipu_cpmem_set_yuv_planar(struct ipuv3_channel *ch, }EXPORT_SYMBOL_GPL (ipu_cpmem_set_yuv_planar); -static const struct ipu_rgb def_rgb_32 = { +static const struct ipu_rgb def_xrgb_32 = { .red = { .offset =16 , .length =8 , }, .green = { .offset =8 , .length =8 , }, .blue = { .offset =0 , .length =8 , },
@@ -460,7 +460,7 @@ static const struct ipu_rgb def_rgb_32 = { .bits_per_pixel = 32, }; -static const struct ipu_rgb def_bgr_32 = { +static const struct ipu_rgb def_xbgr_32 = { .red = { .offset =0 , .length =8 , }, .green = { .offset =8 , .length =8 , }, .blue = { .offset =16 , .length =8 , },
@@ -468,6 +468,22 @@ static const struct ipu_rgb def_bgr_32 = { .bits_per_pixel = 32, }; +static const struct ipu_rgb def_rgbx_32 = { + .red = { .offset =24 , .length =8 , }, + .green = { .offset =16 , .length =8 , }, + .blue = { .offset =8 , .length =8 , }, + .transp = { .offset =0 , .length =8 , }, + .bits_per_pixel =32 , +}; + +static const struct ipu_rgb def_bgrx_32 = { + .red = { .offset =8 , .length =8 , }, + .green = { .offset =16 , .length =8 , }, + .blue = { .offset =24 , .length =8 , }, + .transp = { .offset =0 , .length =8 , }, + .bits_per_pixel =32 , +}; +static const struct ipu_rgb def_rgb_24 = { .red = { .offset =16 , .length =8 , }, .green = { .offset =8 , .length =8 , },
@@ -595,11 +611,19 @@ int ipu_cpmem_set_fmt(struct ipuv3_channel *ch, u32 drm_fourcc)break ;case DRM_FORMAT_ABGR8888 :case DRM_FORMAT_XBGR8888 : -ipu_cpmem_set_format_rgb (ch, &def_bgr_32); +ipu_cpmem_set_format_rgb (ch, &def_xbgr_32);break ;case DRM_FORMAT_ARGB8888 :case DRM_FORMAT_XRGB8888 : -ipu_cpmem_set_format_rgb (ch, &def_rgb_32); +ipu_cpmem_set_format_rgb (ch, &def_xrgb_32); +break ; +case DRM_FORMAT_RGBA8888 : +case DRM_FORMAT_RGBX8888 : +ipu_cpmem_set_format_rgb (ch, &def_rgbx_32); +break ; +case DRM_FORMAT_BGRA8888 : +case DRM_FORMAT_BGRX8888 : +ipu_cpmem_set_format_rgb (ch, &def_bgrx_32);break ;case DRM_FORMAT_BGR888 :ipu_cpmem_set_format_rgb (ch, &def_bgr_24);
Signature · 6 lines
2.5.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Philipp Zabel
maintainerPATCH 4/6 drm/imx: ipuv3-plane: enable support for RGBX8888 and RGBA8888 pixel formats
In reply to Philipp ZabelThis patch allows to use the RGBX and RGBA 8:8:8:8 formats.
--- drivers/gpu/drm/imx/ipuv3-plane.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/imx/ipuv3-plane.c +6 -0
@@ -33,6 +33,10 @@ static const uint32_t ipu_plane_formats[] = {DRM_FORMAT_XRGB8888 ,DRM_FORMAT_ABGR8888 ,DRM_FORMAT_XBGR8888 , +DRM_FORMAT_RGBA8888 , +DRM_FORMAT_RGBX8888 , +DRM_FORMAT_BGRA8888 , +DRM_FORMAT_BGRA8888 ,DRM_FORMAT_YUYV ,DRM_FORMAT_YVYU , DRM_FORMAT_YUV420,
@@ -208,6 +212,8 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc,case DRM_FORMAT_BGRA5551 :case DRM_FORMAT_ARGB8888 :case DRM_FORMAT_ABGR8888 : +case DRM_FORMAT_RGBA8888 : +case DRM_FORMAT_BGRA8888 :ipu_dp_set_global_alpha (ipu_plane->dp, false,0 , false);break ;default :
Signature · 6 lines
2.5.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Philipp Zabel
maintainerPATCH 5/6 gpu: ipu-v3: add support for ARGB4444 16-bit color format
In reply to Philipp ZabelFrom: Lucas Stach <[email protected]>
This patch adds support for the ARGB4444 color format.
--- drivers/gpu/ipu-v3/ipu-common.c | 1 + drivers/gpu/ipu-v3/ipu-cpmem.c | 11 +++++++++++ 2 files changed, 12 insertions(+)
drivers/gpu/ipu-v3/ipu-common.c +1 -0
@@ -65,6 +65,7 @@ enum ipu_color_space ipu_drm_fourcc_to_colorspace(u32 drm_fourcc)case DRM_FORMAT_BGR565 :case DRM_FORMAT_RGB888 :case DRM_FORMAT_BGR888 : +case DRM_FORMAT_ARGB4444 :case DRM_FORMAT_XRGB8888 :case DRM_FORMAT_XBGR8888 :case DRM_FORMAT_RGBX8888 :
drivers/gpu/ipu-v3/ipu-cpmem.c +11 -0
@@ -524,6 +524,14 @@ static const struct ipu_rgb def_argb_16 = { .bits_per_pixel = 16, }; +static const struct ipu_rgb def_argb_16_4444 = { + .red = { .offset =8 , .length =4 , }, + .green = { .offset =4 , .length =4 , }, + .blue = { .offset =0 , .length =4 , }, + .transp = { .offset =12 , .length =4 , }, + .bits_per_pixel =16 , +}; +static const struct ipu_rgb def_abgr_16 = { .red = { .offset =0 , .length =5 , }, .green = { .offset =5 , .length =5 , },
@@ -649,6 +657,9 @@ int ipu_cpmem_set_fmt(struct ipuv3_channel *ch, u32 drm_fourcc)case DRM_FORMAT_BGRA5551 :ipu_cpmem_set_format_rgb (ch, &def_bgra_16);break ; +case DRM_FORMAT_ARGB4444 : +ipu_cpmem_set_format_rgb (ch, &def_argb_16_4444); +break ;default :return -EINVAL ; }
Signature · 6 lines
2.5.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Philipp Zabel
maintainerPATCH 6/6 drm/imx: enable ARGB4444 16-bit color format
In reply to Philipp ZabelFrom: Lucas Stach <[email protected]>
This patch allows to use the ARGB4444 color format on planes.
--- drivers/gpu/drm/imx/ipuv3-plane.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/imx/ipuv3-plane.c +2 -0
@@ -29,6 +29,7 @@ static const uint32_t ipu_plane_formats[] = {DRM_FORMAT_XBGR1555 ,DRM_FORMAT_RGBA5551 ,DRM_FORMAT_BGRA5551 , +DRM_FORMAT_ARGB4444 ,DRM_FORMAT_ARGB8888 ,DRM_FORMAT_XRGB8888 , DRM_FORMAT_ABGR8888,
@@ -210,6 +211,7 @@ int ipu_plane_mode_set(struct ipu_plane *ipu_plane, struct drm_crtc *crtc,case DRM_FORMAT_ABGR1555 :case DRM_FORMAT_RGBA5551 :case DRM_FORMAT_BGRA5551 : +case DRM_FORMAT_ARGB4444 :case DRM_FORMAT_ARGB8888 :case DRM_FORMAT_ABGR8888 :case DRM_FORMAT_RGBA8888 :
Signature · 6 lines
2.5.0 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel