Skip to contentSkip to conversation

drm/imx: dc-plane: Add more RGB swizzling options

PATCH New Marek Vasut 1 participant 1 message Jan 4

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 drm/imx: dc-plane: Add more RGB swizzling options

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

---
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[]
V3: - Drop even more formats for now, because they do not work with
prefetch engine, which seems currently unimplemented.

---
 drivers/gpu/drm/imx/dc/dc-fu.c    | 16 ++++++++++++++++
 drivers/gpu/drm/imx/dc/dc-plane.c |  4 ++++
 2 files changed, 20 insertions(+)
drivers/gpu/drm/imx/dc/dc-fu.c +16 -0
index 1d8f74babef8a..8a2c1c2a54d2c 100644
@@ -65,6 +65,22 @@ 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_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),
 	},
 };
 
drivers/gpu/drm/imx/dc/dc-plane.c +4 -0
index e40d5d66c5c1f..2f009a5a1fb3c 100644
@@ -33,6 +33,10 @@ do {									\
 
 static const uint32_t dc_plane_formats[] = {
 	DRM_FORMAT_XRGB8888,
+	DRM_FORMAT_XBGR8888,
+	DRM_FORMAT_RGBX8888,
+	DRM_FORMAT_BGRX8888,
+	DRM_FORMAT_RGB565,
 };
 
 static const struct drm_plane_funcs dc_plane_funcs = {
Signature · 1 line
2.51.0