Add additional buffer format swizzling options beyond XR24, the
hardware is capable of sampling other formats, fill them in.

Signed-off-by: Marek Vasut <[email protected]>
---
Cc: Abel Vesa <[email protected]>
Cc: Conor Dooley <[email protected]>
Cc: Fabio Estevam <[email protected]>
Cc: Krzysztof Kozlowski <[email protected]>
Cc: Laurent Pinchart <[email protected]>
Cc: Liu Ying <[email protected]>
Cc: Lucas Stach <[email protected]>
Cc: Peng Fan <[email protected]>
Cc: Pengutronix Kernel Team <[email protected]>
Cc: Rob Herring <[email protected]>
Cc: Shawn Guo <[email protected]>
Cc: Thomas Zimmermann <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
V2: - Adjust commit subject
    - Drop the alpha formats for now, add RGB888/BGR888 to dc_plane_formats[]
---
 drivers/gpu/drm/imx/dc/dc-fu.c    | 24 ++++++++++++++++++++++++
 drivers/gpu/drm/imx/dc/dc-plane.c |  6 ++++++
 2 files changed, 30 insertions(+)

diff --git a/drivers/gpu/drm/imx/dc/dc-fu.c b/drivers/gpu/drm/imx/dc/dc-fu.c
index 1d8f74babef8a..b4a3f8c58cbb0 100644
--- a/drivers/gpu/drm/imx/dc/dc-fu.c
+++ b/drivers/gpu/drm/imx/dc/dc-fu.c
@@ -65,6 +65,30 @@ static const struct dc_fu_pixel_format pixel_formats[] = {
                DRM_FORMAT_XRGB8888,
                R_BITS(8)   | G_BITS(8)   | B_BITS(8)   | A_BITS(0),
                R_SHIFT(16) | G_SHIFT(8)  | B_SHIFT(0)  | A_SHIFT(0),
+       }, {
+               DRM_FORMAT_XBGR8888,
+               R_BITS(8)   | G_BITS(8)   | B_BITS(8)   | A_BITS(0),
+               R_SHIFT(0)  | G_SHIFT(8)  | B_SHIFT(16) | A_SHIFT(0),
+       }, {
+               DRM_FORMAT_RGBX8888,
+               R_BITS(8)   | G_BITS(8)   | B_BITS(8)   | A_BITS(0),
+               R_SHIFT(24) | G_SHIFT(16) | B_SHIFT(8)  | A_SHIFT(0),
+       }, {
+               DRM_FORMAT_BGRX8888,
+               R_BITS(8)   | G_BITS(8)   | B_BITS(8)   | A_BITS(0),
+               R_SHIFT(8)  | G_SHIFT(16) | B_SHIFT(24) | A_SHIFT(0),
+       }, {
+               DRM_FORMAT_RGB888,
+               R_BITS(8)   | G_BITS(8)   | B_BITS(8)   | A_BITS(0),
+               R_SHIFT(16) | G_SHIFT(8)  | B_SHIFT(0)  | A_SHIFT(0),
+       }, {
+               DRM_FORMAT_BGR888,
+               R_BITS(8)   | G_BITS(8)   | B_BITS(8)   | A_BITS(0),
+               R_SHIFT(0)  | G_SHIFT(8)  | B_SHIFT(16) | A_SHIFT(0),
+       }, {
+               DRM_FORMAT_RGB565,
+               R_BITS(5)   | G_BITS(6)   | B_BITS(5)   | A_BITS(0),
+               R_SHIFT(11) | G_SHIFT(5)  | B_SHIFT(0)  | A_SHIFT(0),
        },
 };
 
diff --git a/drivers/gpu/drm/imx/dc/dc-plane.c 
b/drivers/gpu/drm/imx/dc/dc-plane.c
index e40d5d66c5c1f..4fd58afef16bb 100644
--- a/drivers/gpu/drm/imx/dc/dc-plane.c
+++ b/drivers/gpu/drm/imx/dc/dc-plane.c
@@ -33,6 +33,12 @@ do {                                                         
        \
 
 static const uint32_t dc_plane_formats[] = {
        DRM_FORMAT_XRGB8888,
+       DRM_FORMAT_XBGR8888,
+       DRM_FORMAT_RGBX8888,
+       DRM_FORMAT_BGRX8888,
+       DRM_FORMAT_RGB888,
+       DRM_FORMAT_BGR888,
+       DRM_FORMAT_RGB565,
 };
 
 static const struct drm_plane_funcs dc_plane_funcs = {
-- 
2.51.0

Reply via email to