Skip to contentSkip to conversation

drm/amd/display: Retrain dongles when SINK_COUNT becomes non-zero

PATCH In review Harry Wentland 2 participants 3 messages Jan 23, 2020

Subsystems (3)
lore
Share & tools
lore

Harry Wentland

author maintainer
#0 lore raw

PATCH 1/2 drm/amd/display: Retrain dongles when SINK_COUNT becomes non-zero

[WHY]
Two years ago the patch referenced by the Fixes tag stopped running dp_verify_link_cap_with_retries during DP detection when the reason for the detection was a short-pulse interrupt. This effectively meant that we were no longer doing the verify_link_cap training on active dongles when their SINK_COUNT changed from 0 to 1.

A year ago this was partly remedied with this commit:
80adaebd2d41 drm/amd/display: Don't skip link training for empty dongle

This made sure that we trained the dongle on initial hotplug (without connected downstream devices).

This is all fine and dandy if it weren't for the fact that there are some dongles on the market that don't like link training when SINK_COUNT is 0 These dongles will in fact indicate a SINK_COUNT of 0 immediately after hotplug, even when a downstream device is connected, and then trigger a shortpulse interrupt indicating a SINK_COUNT change to 1.

In order to play nicely we will need our policy to not link train an active DP dongle when SINK_COUNT is 0 but ensure we train it when the SINK_COUNT changes to 1.

[HOW]
Call dp_verify_link_cap_with_retries on detection even when the detection is triggered from a short pulse interrupt.

With this change we can also revert this commit which we'll do in a separate follow-up change:
80adaebd2d41 drm/amd/display: Don't skip link training for empty dongle

Fixes 0301ccbaf67d drm/amd/display: DP Compliance 400.1.1 failure
Cc Wenjing Liu <[email protected]>
Cc Hersen Wu <[email protected]>
Cc Eric Yang <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +1 -2
index a50768a7ba68..cc2e05003595 100644
@@ -969,8 +969,7 @@ static bool dc_link_detect_helper(struct dc_link *link,
 			same_edid = is_same_edid(&prev_sink->dc_edid, &sink->dc_edid);
 
 		if (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
-			sink_caps.transaction_type == DDC_TRANSACTION_TYPE_I2C_OVER_AUX &&
-			reason != DETECT_REASON_HPDRX) {
+			sink_caps.transaction_type == DDC_TRANSACTION_TYPE_I2C_OVER_AUX) {
 			/*
 			 * TODO debug why Dell 2413 doesn't like
 			 *  two link trainings
Signature · 6 lines
2.25.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
author maintainer
#1 lore raw

PATCH 2/2 Revert "drm/amd/display: Don't skip link training for empty dongle"

This reverts commit 80adaebd2d411b7d6872a097634848a71eb13d20.

[WHY]
This change was working around a regression that occured in this patch:
0301ccbaf67d drm/amd/display: DP Compliance 400.1.1 failure

With the fix to run verify_link_cap when the SINK_COUNT of dongles becomes non-zero this change is no longer needed.

Cc Louis Li <[email protected]>
Cc Wenjing Liu <[email protected]>
Cc Hersen Wu <[email protected]>
Cc Eric Yang <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -8
index cc2e05003595..a09119c10d7c 100644
@@ -851,18 +851,12 @@ static bool dc_link_detect_helper(struct dc_link *link,
 				if (memcmp(&link->dpcd_caps, &prev_dpcd_caps, sizeof(struct dpcd_caps)))
 					same_dpcd = false;
 			}
-			/* Active dongle plug in without display or downstream unplug*/
+			/* Active dongle downstream unplug*/
 			if (link->type == dc_connection_active_dongle &&
 				link->dpcd_caps.sink_count.bits.SINK_COUNT == 0) {
-				if (prev_sink != NULL) {
+				if (prev_sink != NULL)
 					/* Downstream unplug */
 					dc_sink_release(prev_sink);
-				} else {
-					/* Empty dongle plug in */
-					dp_verify_link_cap_with_retries(link,
-							&link->reported_link_cap,
-							LINK_TRAINING_MAX_VERIFY_RETRY);
-				}
 				return true;
 			}
 
Signature · 6 lines
2.25.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw

Re: [PATCH 2/2] Revert "drm/amd/display: Don't skip link training for empty dongle"

Quoted 7 lines · Harry Wentland

This reverts commit 80adaebd2d411b7d6872a097634848a71eb13d20.

[WHY]
This change was working around a regression that occured in this patch:
0301ccbaf67d drm/amd/display: DP Compliance 400.1.1 failure

Quoted 8 lines

With the fix to run verify_link_cap when the SINK_COUNT of dongles becomes non-zero this change is no longer needed.

Cc Louis Li <[email protected]>
Cc Wenjing Liu <[email protected]>
Cc Hersen Wu <[email protected]>
Cc Eric Yang <[email protected]>

Both patches have been offline reviewed by Wenjing. I'll merge them with his review.

Harry

Quoted 20 lines
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -2
index cc2e05003595..a09119c10d7c 100644
@@ -851,18 +851,12 @@ static bool dc_link_detect_helper(struct dc_link *link,
 				if (memcmp(&link->dpcd_caps, &prev_dpcd_caps, sizeof(struct dpcd_caps)))
 					same_dpcd = false;
 			}
-			/* Active dongle plug in without display or downstream unplug*/
+			/* Active dongle downstream unplug*/
 			if (link->type == dc_connection_active_dongle &&
 				link->dpcd_caps.sink_count.bits.SINK_COUNT == 0) {
-				if (prev_sink != NULL) {
+				if (prev_sink != NULL)
 					/* Downstream unplug */

drivers/gpu/drm/amd/display/dc/core/dc_link.c static bool dc_link_detect_helper(struct dc_link *link, · line 862

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -6
 					dc_sink_release(prev_sink);
-				} else {
-					/* Empty dongle plug in */
-					dp_verify_link_cap_with_retries(link,
-							&link->reported_link_cap,
-							LINK_TRAINING_MAX_VERIFY_RETRY);
-				}
 				return true;
 			}
 

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