Skip to contentSkip to conversation

drm/msm/dp: More DPCD cleanups

PATCH Applied Stephen Boyd 2 participants 6 messages Sep 6, 2023 – Oct 8, 2023

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

cover drm/msm/dp: More DPCD cleanups

This is a follow-on to this series[1]. I can resend the whole pile if desired.

[1] https://lore.kernel.org/r/[email protected]

Stephen Boyd (2):
drm/msm/dp: Inline dp_display_is_sink_count_zero() drm/msm/dp: Remove error message when downstream port not connected

 drivers/gpu/drm/msm/dp/dp_display.c | 10 +---------
 drivers/gpu/drm/msm/dp/dp_panel.c   |  1 -
 2 files changed, 1 insertion(+), 10 deletions(-)

base-commit: 2dde18cd1d8fac735875f2e4987f11817cc0bc2c
prerequisite-patch-id: c637903336fb0fd5593f0016f0c863305c43a6b9
prerequisite-patch-id: 8610693078de9cd5041266c70c4d044d15a5f701
prerequisite-patch-id: e10675f41cc68dcefa566f7f288b2df72afdb116
prerequisite-patch-id: 63280d764b830e3d25455ae642840cff5f90e118
prerequisite-patch-id: 567e00d48c5a296b454079a51483f2acce357347
prerequisite-patch-id: 1c18472728edc1ca8800dd6ed6ff12cb98084ea8
prerequisite-patch-id: c6f74b922b3a4f2255bcdab11fe3a2ecf7891262

Signature · 1 line
https://chromeos.dev
#1 lore raw

PATCH 1/2 drm/msm/dp: Inline dp_display_is_sink_count_zero()

This function is basically a one-liner when you ignore the debug logging. Just inline the function and drop the log to simplify the code.

---
 drivers/gpu/drm/msm/dp/dp_display.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/gpu/drm/msm/dp/dp_display.c +1 -9
index 96bbf6fec2f1..2a5f1ab9a65b 100644
@@ -341,14 +341,6 @@ static const struct component_ops dp_display_comp_ops = {
 	.unbind = dp_display_unbind,
 };
 
-static bool dp_display_is_sink_count_zero(struct dp_display_private *dp)
-{
-	drm_dbg_dp(dp->drm_dev, "present=%#x sink_count=%d\n",
-			dp->panel->dpcd[DP_DOWNSTREAMPORT_PRESENT],
-		dp->link->sink_count);
-	return drm_dp_is_branch(dp->panel->dpcd) && dp->link->sink_count == 0;
-}
-
 static void dp_display_send_hpd_event(struct msm_dp *dp_display)
 {
 	struct dp_display_private *dp;
@@ -507,7 +499,7 @@ static int dp_display_handle_port_ststus_changed(struct dp_display_private *dp)
 {
 	int rc = 0;
 
-	if (dp_display_is_sink_count_zero(dp)) {
+	if (drm_dp_is_branch(dp->panel->dpcd) && dp->link->sink_count == 0) {
 		drm_dbg_dp(dp->drm_dev, "sink count is zero, nothing to do\n");
 		if (dp->hpd_state != ST_DISCONNECTED) {
 			dp->hpd_state = ST_DISCONNECT_PENDING;
Signature · 1 line
https://chromeos.dev
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] drm/msm/dp: Inline dp_display_is_sink_count_zero()

Quoted 10 lines · Stephen Boyd

This function is basically a one-liner when you ignore the debug logging. Just inline the function and drop the log to simplify the code.

---
  drivers/gpu/drm/msm/dp/dp_display.c | 10 +---------
  1 file changed, 1 insertion(+), 9 deletions(-)
Signature · 2 lines
With best wishes
Dmitry
#3 lore raw

PATCH 2/2 drm/msm/dp: Remove error message when downstream port not connected

In reply to Stephen Boyd

Plugging in an Apple dongle without the HDMI cable attached prints out an error message in the kernel logs when nothing is actually wrong.

no downstream ports connected

This is because the downstream port for the HDMI connector is not connected, so the Apple dongle reports that as a zero sink count device.

Cc Vinod Polimera <[email protected]>
Cc Kuogee Hsieh <[email protected]>
---
 drivers/gpu/drm/msm/dp/dp_panel.c | 1 -
 1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/dp/dp_panel.c +0 -1
index 97ba41593820..ae778e1a6fd0 100644
@@ -156,7 +156,6 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
 	if (drm_dp_is_branch(dp_panel->dpcd)) {
 		count = drm_dp_read_sink_count(panel->aux);
 		if (!count) {
-			DRM_ERROR("no downstream ports connected\n");
 			panel->link->sink_count = 0;
 			return -ENOTCONN;
 		}
Signature · 1 line
https://chromeos.dev
#4 lore raw

Re: [PATCH 2/2] drm/msm/dp: Remove error message when downstream port not connected

Quoted 20 lines · Stephen Boyd

Plugging in an Apple dongle without the HDMI cable attached prints out an error message in the kernel logs when nothing is actually wrong.

no downstream ports connected

This is because the downstream port for the HDMI connector is not connected, so the Apple dongle reports that as a zero sink count device.

Cc Vinod Polimera <[email protected]>
Cc Kuogee Hsieh <[email protected]>
---
  drivers/gpu/drm/msm/dp/dp_panel.c | 1 -
  1 file changed, 1 deletion(-)
drivers/gpu/drm/msm/dp/dp_panel.c +0 -0
index 97ba41593820..ae778e1a6fd0 100644

drivers/gpu/drm/msm/dp/dp_panel.c int dp_panel_read_sink_caps(struct dp_panel *dp_panel, · line 159

Quoted 4 lines
drivers/gpu/drm/msm/dp/dp_panel.c +0 -1
@@ -156,7 +156,6 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
  	if (drm_dp_is_branch(dp_panel->dpcd)) {
  		count = drm_dp_read_sink_count(panel->aux);
  		if (!count) {
-			DRM_ERROR("no downstream ports connected\n");

Maybe this can be converted to drm_dbg_dp?

Quoted 3 lines
drivers/gpu/drm/msm/dp/dp_panel.c +0 -0
  			panel->link->sink_count = 0;
  			return -ENOTCONN;
  		}
Signature · 2 lines
With best wishes
Dmitry
#5 lore raw
In reply to Stephen Boyd
Quoted 10 lines · Stephen Boyd

This is a follow-on to this series[1]. I can resend the whole pile if desired.

[1] https://lore.kernel.org/r/[email protected]

Stephen Boyd (2):
drm/msm/dp: Inline dp_display_is_sink_count_zero() drm/msm/dp: Remove error message when downstream port not connected

[...]

Applied, thanks!

[1/2] drm/msm/dp: Inline dp_display_is_sink_count_zero()

      https://gitlab.freedesktop.org/lumag/msm/-/commit/fb48250ca919
[2/2] drm/msm/dp: Remove error message when downstream port not connected
      https://gitlab.freedesktop.org/lumag/msm/-/commit/e117fd68f973

Best regards,

Signature · 1 line
Dmitry Baryshkov <[email protected]>