[PATCH 2/5] drm/panel: simple: Set bpc from bits-per-color DT property for panel-dpi

Chen-Yu Tsai wens at kernel.org
Tue Jul 14 03:13:02 EDT 2020


From: Chen-Yu Tsai <wens at csie.org>

Now that the device tree binding for panel-dpi has the "bits-per-color"
property, parse its value and set bpc in the panel description to the
given value. This would allow encoders to detect less-than-8-bits color
depth and employ color dithering if possible.

Signed-off-by: Chen-Yu Tsai <wens at csie.org>
---
 drivers/gpu/drm/panel/panel-simple.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
index 13a9df44f781..0765bfa54b7a 100644
--- a/drivers/gpu/drm/panel/panel-simple.c
+++ b/drivers/gpu/drm/panel/panel-simple.c
@@ -433,6 +433,7 @@ static int panel_dpi_probe(struct device *dev,
 
 	of_property_read_u32(np, "width-mm", &desc->size.width);
 	of_property_read_u32(np, "height-mm", &desc->size.height);
+	of_property_read_u32(np, "bits-per-color", &desc->bpc);
 
 	/* Extract bus_flags from display_timing */
 	bus_flags = 0;
-- 
2.27.0




More information about the linux-arm-kernel mailing list