Skip to contentSkip to conversation

drm/bridge: lt9611: Fix handling of 4k panels

PATCH Superseded Robert Foss 5 participants 5 messages Nov 23, 2020 – Dec 11, 2020

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/bridge: lt9611: Fix handling of 4k panels

4k requires two dsi pipes, so don't report MODE_OK when only a single pipe is configured. But rather report MODE_PANEL to signal that requirements of the panel are not being met.

---
 drivers/gpu/drm/bridge/lontium-lt9611.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/lontium-lt9611.c +7 -1
index d734d9402c35..e8eb8deb444b 100644
@@ -867,8 +867,14 @@ static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge,
 						     const struct drm_display_mode *mode)
 {
 	struct lt9611_mode *lt9611_mode = lt9611_find_mode(mode);
+	struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
 
-	return lt9611_mode ? MODE_OK : MODE_BAD;
+	if (!lt9611_mode)
+		return MODE_BAD;
+	else if (lt9611_mode->intfs > 1 && !lt9611->dsi1)
+		return MODE_PANEL;
+	else
+		return MODE_OK;
 }
 
 static void lt9611_bridge_pre_enable(struct drm_bridge *bridge)
Signature · 1 line
2.27.0
Acked-by on v1 1/1
#1 lore raw
Quoted 3 lines · Robert Foss

4k requires two dsi pipes, so don't report MODE_OK when only a single pipe is configured. But rather report MODE_PANEL to signal that requirements of the panel are not being met.

Quoted 30 lines
---
 drivers/gpu/drm/bridge/lontium-lt9611.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/lontium-lt9611.c +7 -1
index d734d9402c35..e8eb8deb444b 100644
@@ -867,8 +867,14 @@ static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge,
 						     const struct drm_display_mode *mode)
 {
 	struct lt9611_mode *lt9611_mode = lt9611_find_mode(mode);
+	struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
 
-	return lt9611_mode ? MODE_OK : MODE_BAD;
+	if (!lt9611_mode)
+		return MODE_BAD;
+	else if (lt9611_mode->intfs > 1 && !lt9611->dsi1)
+		return MODE_PANEL;
+	else
+		return MODE_OK;
 }
 
 static void lt9611_bridge_pre_enable(struct drm_bridge *bridge)
Signature · 1 line
2.27.0
Signature · 1 line
~Vinod
Tested-by on v1 1/1
#2 lore raw
In reply to Robert Foss

I just tested on non 4k display. Looks good to me.

Quoted 9 lines · Robert Foss

4k requires two dsi pipes, so don't report MODE_OK when only a single pipe is configured. But rather report MODE_PANEL to signal that requirements of the panel are not being met.

Quoted 26 lines
---
 drivers/gpu/drm/bridge/lontium-lt9611.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/lontium-lt9611.c +7 -1
index d734d9402c35..e8eb8deb444b 100644
@@ -867,8 +867,14 @@ static enum drm_mode_status
 lt9611_bridge_mode_valid(struct drm_bridge *bridge,
                                                     const struct
 drm_display_mode *mode)
 {
        struct lt9611_mode *lt9611_mode = lt9611_find_mode(mode);
+       struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
 
-       return lt9611_mode ? MODE_OK : MODE_BAD;
+       if (!lt9611_mode)
+               return MODE_BAD;
+       else if (lt9611_mode->intfs > 1 && !lt9611->dsi1)
+               return MODE_PANEL;
+       else
+               return MODE_OK;
 }
Quoted 5 lines

static void lt9611_bridge_pre_enable(struct drm_bridge *bridge)
--
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Tested-by on v1 1/1
#3 lore raw
In reply to Robert Foss

Thanks. Confirmed that this fixes display output for me on a 4K monitor.

Quoted 9 lines · Robert Foss

4k requires two dsi pipes, so don't report MODE_OK when only a single pipe is configured. But rather report MODE_PANEL to signal that requirements of the panel are not being met.

Quoted 27 lines
---
 drivers/gpu/drm/bridge/lontium-lt9611.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/lontium-lt9611.c +7 -2
index d734d9402c35..e8eb8deb444b 100644
@@ -867,8 +867,14 @@ static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge,
                                                     const struct drm_display_mode *mode)
 {
        struct lt9611_mode *lt9611_mode = lt9611_find_mode(mode);
+       struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
 
-       return lt9611_mode ? MODE_OK : MODE_BAD;
+       if (!lt9611_mode)
+               return MODE_BAD;
+       else if (lt9611_mode->intfs > 1 && !lt9611->dsi1)
+               return MODE_PANEL;
+       else
+               return MODE_OK;
 }
 
 static void lt9611_bridge_pre_enable(struct drm_bridge *bridge)
--

2.27.0

Reviewed-by on v1 1/1
#4 lore raw
In reply to Robert Foss
Quoted 8 lines · Robert Foss

4k requires two dsi pipes, so don't report MODE_OK when only a single pipe is configured. But rather report MODE_PANEL to signal that requirements of the panel are not being met.

This looks very similar to what I had in the early revisions of the driver.

Regards,
Bjorn

Quoted 27 lines
---
 drivers/gpu/drm/bridge/lontium-lt9611.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/lontium-lt9611.c +7 -1
index d734d9402c35..e8eb8deb444b 100644
@@ -867,8 +867,14 @@ static enum drm_mode_status lt9611_bridge_mode_valid(struct drm_bridge *bridge,
 						     const struct drm_display_mode *mode)
 {
 	struct lt9611_mode *lt9611_mode = lt9611_find_mode(mode);
+	struct lt9611 *lt9611 = bridge_to_lt9611(bridge);
 
-	return lt9611_mode ? MODE_OK : MODE_BAD;
+	if (!lt9611_mode)
+		return MODE_BAD;
+	else if (lt9611_mode->intfs > 1 && !lt9611->dsi1)
+		return MODE_PANEL;
+	else
+		return MODE_OK;
 }
 
 static void lt9611_bridge_pre_enable(struct drm_bridge *bridge)
Signature · 1 line
2.27.0