Hello,
This small patch series is the second version of what has been previously submitted as "[PATCH] drm: panel: simple: Drop drive/sample bus flags for LVDS panels". It fixes incorrect bus format and connector type in the description of two panels (patches 1/4 and 2/4), drop invalid bus flags for LVDS panels (patch 3/4), and add a warning to catch invalid bus formats for future LVDS panels.
Laurent Pinchart (4): drm: panel: simple: Correct connector type for Starry KR070PE2T drm: panel: simple: Correct bus format for Satoz SAT050AT40H12R2 drm: panel: simple: Drop drive/sample bus flags for LVDS panels drm: panel: simple: Warn in case of incorrect bus format for LVDS panels
drivers/gpu/drm/panel/panel-simple.c | 41 +++++++++++++++++++--------- 1 file changed, 28 insertions(+), 13 deletions(-)
The Starry KR070PE2T panel is a DPI panel, not and LVDS panel. Fix its connector type.
Signed-off-by: Laurent Pinchart laurent.pinchart+renesas@ideasonboard.com --- drivers/gpu/drm/panel/panel-simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index bff1cab529d2..ac6e8d55a3a2 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -3320,7 +3320,7 @@ static const struct panel_desc starry_kr070pe2t = { }, .bus_format = MEDIA_BUS_FMT_RGB888_1X24, .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE, - .connector_type = DRM_MODE_CONNECTOR_LVDS, + .connector_type = DRM_MODE_CONNECTOR_DPI, };
static const struct drm_display_mode starry_kr122ea0sra_mode = {
On 2020-06-30 01:33, Laurent Pinchart wrote:
The Starry KR070PE2T panel is a DPI panel, not and LVDS panel. Fix its connector type.
Signed-off-by: Laurent Pinchart
laurent.pinchart+renesas@ideasonboard.com
drivers/gpu/drm/panel/panel-simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index bff1cab529d2..ac6e8d55a3a2 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -3320,7 +3320,7 @@ static const struct panel_desc starry_kr070pe2t = { }, .bus_format = MEDIA_BUS_FMT_RGB888_1X24, .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_NEGEDGE,
- .connector_type = DRM_MODE_CONNECTOR_LVDS,
- .connector_type = DRM_MODE_CONNECTOR_DPI,
};
static const struct drm_display_mode starry_kr122ea0sra_mode = {
Reviewed-by: Pascal Roeleven dev@pascalroeleven.nl
The Satoz SAT050AT40H12R2 panel is an LVDS panel, the MEDIA_BUS_FMT_RGB888_1X24 bus format is thus incorrect. Set it to the correct value MEDIA_BUS_FMT_RGB888_1X7X4_SPWG.
Signed-off-by: Laurent Pinchart laurent.pinchart+renesas@ideasonboard.com --- drivers/gpu/drm/panel/panel-simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index ac6e8d55a3a2..c659d8262e5c 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -3118,7 +3118,7 @@ static const struct panel_desc satoz_sat050at40h12r2 = { .width = 108, .height = 65, }, - .bus_format = MEDIA_BUS_FMT_RGB888_1X24, + .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .connector_type = DRM_MODE_CONNECTOR_LVDS, };
Laurent Pinchart laurent.pinchart+renesas@ideasonboard.com wrote on Tue, 30 Jun 2020 02:33:18 +0300:
The Satoz SAT050AT40H12R2 panel is an LVDS panel, the MEDIA_BUS_FMT_RGB888_1X24 bus format is thus incorrect. Set it to the correct value MEDIA_BUS_FMT_RGB888_1X7X4_SPWG.
Signed-off-by: Laurent Pinchart laurent.pinchart+renesas@ideasonboard.com
drivers/gpu/drm/panel/panel-simple.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index ac6e8d55a3a2..c659d8262e5c 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -3118,7 +3118,7 @@ static const struct panel_desc satoz_sat050at40h12r2 = { .width = 108, .height = 65, },
- .bus_format = MEDIA_BUS_FMT_RGB888_1X24,
- .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .connector_type = DRM_MODE_CONNECTOR_LVDS,
};
Reviewed-by: Miquel Raynal miquel.raynal@bootlin.com
The DRM bus flags reporting on which clock edge the pixel data and sync signals are sampled or driven don't make sense for LVDS panels, as the bus then uses sub-clock timings to send data. Drop those flags and add a warning in the probe function to make sure the mistake won't be repeated.
Signed-off-by: Laurent Pinchart laurent.pinchart+renesas@ideasonboard.com --- Changes since v1:
- White list flags instead of black listing them --- drivers/gpu/drm/panel/panel-simple.c | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index c659d8262e5c..cd416376bf71 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -549,6 +549,14 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) panel_simple_parse_panel_timing_node(dev, panel, &dt); }
+ if (desc->connector_type == DRM_MODE_CONNECTOR_LVDS) + /* Catch common mistakes for LVDS panels. */ + WARN_ON(desc->bus_flags & + ~(DRM_BUS_FLAG_DE_LOW | + DRM_BUS_FLAG_DE_HIGH | + DRM_BUS_FLAG_DATA_MSB_TO_LSB | + DRM_BUS_FLAG_DATA_LSB_TO_MSB)); + drm_panel_init(&panel->base, dev, &panel_simple_funcs, desc->connector_type);
@@ -688,7 +696,7 @@ static const struct panel_desc auo_b101aw03 = { .height = 125, }, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, - .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, .connector_type = DRM_MODE_CONNECTOR_LVDS, };
@@ -1398,7 +1406,7 @@ static const struct panel_desc chunghwa_claa070wp03xg = { .height = 150, }, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, - .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, .connector_type = DRM_MODE_CONNECTOR_LVDS, };
@@ -1423,7 +1431,7 @@ static const struct panel_desc chunghwa_claa101wa01a = { .height = 120, }, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, - .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, .connector_type = DRM_MODE_CONNECTOR_LVDS, };
@@ -1448,7 +1456,7 @@ static const struct panel_desc chunghwa_claa101wb01 = { .height = 125, }, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, - .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, .connector_type = DRM_MODE_CONNECTOR_LVDS, };
@@ -2123,7 +2131,7 @@ static const struct panel_desc innolux_n156bge_l21 = { .height = 193, }, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, - .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, .connector_type = DRM_MODE_CONNECTOR_LVDS, };
@@ -2256,7 +2264,7 @@ static const struct panel_desc koe_tx26d202vm0bwa = { .disable = 1000, }, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, - .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, .connector_type = DRM_MODE_CONNECTOR_LVDS, };
@@ -2497,9 +2505,7 @@ static const struct panel_desc logictechno_lt170410_2whc = { .height = 136, }, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, - .bus_flags = DRM_BUS_FLAG_DE_HIGH | - DRM_BUS_FLAG_PIXDATA_SAMPLE_NEGEDGE | - DRM_BUS_FLAG_SYNC_SAMPLE_NEGEDGE, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, .connector_type = DRM_MODE_CONNECTOR_LVDS, };
@@ -3072,7 +3078,7 @@ static const struct panel_desc samsung_ltn101nt05 = { .height = 125, }, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, - .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, .connector_type = DRM_MODE_CONNECTOR_LVDS, };
@@ -3512,7 +3518,7 @@ static const struct panel_desc toshiba_lt089ac29000 = { .height = 116, }, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA, - .bus_flags = DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_PIXDATA_DRIVE_POSEDGE, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, .connector_type = DRM_MODE_CONNECTOR_LVDS, };
Only the MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, MEDIA_BUS_FMT_RGB888_1X7X4_SPWG and MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA bus formats are valid for LVDS panels. Warn at probe time to catch the common mistake of using an incorrect format, as well as discrepancies between the bus format and the reported bpc.
Signed-off-by: Laurent Pinchart laurent.pinchart+renesas@ideasonboard.com --- drivers/gpu/drm/panel/panel-simple.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index cd416376bf71..3a35f74d6cb7 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -549,13 +549,22 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) panel_simple_parse_panel_timing_node(dev, panel, &dt); }
- if (desc->connector_type == DRM_MODE_CONNECTOR_LVDS) + if (desc->connector_type == DRM_MODE_CONNECTOR_LVDS) { /* Catch common mistakes for LVDS panels. */ WARN_ON(desc->bus_flags & ~(DRM_BUS_FLAG_DE_LOW | DRM_BUS_FLAG_DE_HIGH | DRM_BUS_FLAG_DATA_MSB_TO_LSB | DRM_BUS_FLAG_DATA_LSB_TO_MSB)); + WARN_ON(desc->bus_format != MEDIA_BUS_FMT_RGB666_1X7X3_SPWG && + desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_SPWG && + desc->bus_format != MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA); + WARN_ON(desc->bus_format == MEDIA_BUS_FMT_RGB666_1X7X3_SPWG && + desc->bpc != 6); + WARN_ON((desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_SPWG || + desc->bus_format == MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA) && + desc->bpc != 8); + }
drm_panel_init(&panel->base, dev, &panel_simple_funcs, desc->connector_type);
Hi Laurent.
On Tue, Jun 30, 2020 at 02:33:16AM +0300, Laurent Pinchart wrote:
Hello,
This small patch series is the second version of what has been previously submitted as "[PATCH] drm: panel: simple: Drop drive/sample bus flags for LVDS panels". It fixes incorrect bus format and connector type in the description of two panels (patches 1/4 and 2/4), drop invalid bus flags for LVDS panels (patch 3/4), and add a warning to catch invalid bus formats for future LVDS panels.
Laurent Pinchart (4): drm: panel: simple: Correct connector type for Starry KR070PE2T drm: panel: simple: Correct bus format for Satoz SAT050AT40H12R2 drm: panel: simple: Drop drive/sample bus flags for LVDS panels drm: panel: simple: Warn in case of incorrect bus format for LVDS panels
Thanks! With the quick feedback from Miquel and Pascal I have now applied all four patches to drm-misc-next.
Sam
drivers/gpu/drm/panel/panel-simple.c | 41 +++++++++++++++++++--------- 1 file changed, 28 insertions(+), 13 deletions(-)
-- Regards,
Laurent Pinchart
dri-devel@lists.freedesktop.org