Skip to contentSkip to conversation

drm/amd/display: Fix AppleDongle can't be detected

PATCH In review Louis Li 3 participants 4 messages Dec 11, 2019 – Dec 24, 2019

Subsystems (3)
lore
Share & tools
lore

Louis Li

author
#0 lore raw

PATCH v3 1/1 drm/amd/display: Fix AppleDongle can't be detected

[Why]
External monitor cannot be displayed consistently, if connecting via this Apple dongle (A1621, USB Type-C to HDMI). Experiments prove that the dongle needs 200ms at least to be ready for communication, after it drives HPDsignal high, and DPCD cannot be read correctly during the period, even reading it repeatedly. In such a case, driver does not perform link training bcz of no DPCD.

[How]
When driver is run to the modified point, EDID is read correctly and dpcd_sink_count of link is not zero. Therefore, link training should be successfully performed. Which implies parameters should be updated, e.g. lane count, link rate, etc. Checking parameters, if values of those parameters are zero, link training is not performed. So, do link-training to have detection completed.

With this patch applied, the problem cannot be reproduced. Testing other dongles, results are PASS.
Patch(v3) is verified PASS by both AMD internal lab and customer.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +3 -1
index 7372dedd2f48..6188edc92d0f 100644
@@ -725,7 +725,9 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
 
 		if (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
 			sink_caps.transaction_type == DDC_TRANSACTION_TYPE_I2C_OVER_AUX &&
-			reason != DETECT_REASON_HPDRX) {
+			link->verified_link_cap.lane_count == 0 &&
+			link->verified_link_cap.link_rate == 0 &&
+			link->verified_link_cap.link_spread == 0) {
 			/*
 			 * TODO debug why Dell 2413 doesn't like
 			 *  two link trainings
Signature · 6 lines
2.21.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw
Quoted 31 lines · Louis Li

[Why]
External monitor cannot be displayed consistently, if connecting via this Apple dongle (A1621, USB Type-C to HDMI). Experiments prove that the dongle needs 200ms at least to be ready for communication, after it drives HPDsignal high, and DPCD cannot be read correctly during the period, even reading it repeatedly. In such a case, driver does not perform link training bcz of no DPCD.

[How]
When driver is run to the modified point, EDID is read correctly and dpcd_sink_count of link is not zero. Therefore, link training should be successfully performed. Which implies parameters should be updated, e.g. lane count, link rate, etc. Checking parameters, if values of those parameters are zero, link training is not performed. So, do link-training to have detection completed.

With this patch applied, the problem cannot be reproduced. Testing other dongles, results are PASS.
Patch(v3) is verified PASS by both AMD internal lab and customer.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
index 7372dedd2f48..6188edc92d0f 100644

drivers/gpu/drm/amd/display/dc/core/dc_link.c bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) · line 728

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -1
@@ -725,7 +725,9 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
 
 		if (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
 			sink_caps.transaction_type == DDC_TRANSACTION_TYPE_I2C_OVER_AUX &&
-			reason != DETECT_REASON_HPDRX) {

Do we need to drop this line? This looks like it'll break the previous fix here.

It looks like Abdoulaye added this here to fix the 400.1.1 DP compliance test. If you can check with him that your solution is fine and make sure to test that you can get a consistent pass of 400.1.1 over 30 runs I'm okay to take the change.

Harry

drivers/gpu/drm/amd/display/dc/core/dc_link.c bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) · line 733

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +3 -0
+			link->verified_link_cap.lane_count == 0 &&
+			link->verified_link_cap.link_rate == 0 &&
+			link->verified_link_cap.link_spread == 0) {
 			/*
 			 * TODO debug why Dell 2413 doesn't like
 			 *  two link trainings

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

#2 lore raw
Quoted 40 lines · Harry Wentland
Quoted 31 lines · Louis Li

[Why]
External monitor cannot be displayed consistently, if connecting via this Apple dongle (A1621, USB Type-C to HDMI). Experiments prove that the dongle needs 200ms at least to be ready for communication, after it drives HPDsignal high, and DPCD cannot be read correctly during the period, even reading it repeatedly. In such a case, driver does not perform link training bcz of no DPCD.

[How]
When driver is run to the modified point, EDID is read correctly and dpcd_sink_count of link is not zero. Therefore, link training should be successfully performed. Which implies parameters should be updated, e.g. lane count, link rate, etc. Checking parameters, if values of those parameters are zero, link training is not performed. So, do link-training to have detection completed.

With this patch applied, the problem cannot be reproduced. Testing other dongles, results are PASS.
Patch(v3) is verified PASS by both AMD internal lab and customer.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
index 7372dedd2f48..6188edc92d0f 100644

drivers/gpu/drm/amd/display/dc/core/dc_link.c bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) · line 728

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -1
@@ -725,7 +725,9 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
 
 		if (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
 			sink_caps.transaction_type == DDC_TRANSACTION_TYPE_I2C_OVER_AUX &&
-			reason != DETECT_REASON_HPDRX) {

Do we need to drop this line? This looks like it'll break the previous fix here.

Quoted 7 lines

It looks like Abdoulaye added this here to fix the 400.1.1 DP compliance test. If you can check with him that your solution is fine and make sure to test that you can get a consistent pass of 400.1.1 over 30 runs I'm okay to take the change.

Harry

Yes, need drop this line for this fix. Good to know it may impact 400.1.1. I will verify it with this patch. And update test result.

Louis

Quoted 7 lines

drivers/gpu/drm/amd/display/dc/core/dc_link.c bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) · line 733

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +3 -0
+			link->verified_link_cap.lane_count == 0 &&
+			link->verified_link_cap.link_rate == 0 &&
+			link->verified_link_cap.link_spread == 0) {
 			/*
 			 * TODO debug why Dell 2413 doesn't like
 			 *  two link trainings

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

#3 lore raw
In reply to Harry Wentland
Quoted 40 lines · Harry Wentland
Quoted 31 lines · Louis Li

[Why]
External monitor cannot be displayed consistently, if connecting via this Apple dongle (A1621, USB Type-C to HDMI). Experiments prove that the dongle needs 200ms at least to be ready for communication, after it drives HPDsignal high, and DPCD cannot be read correctly during the period, even reading it repeatedly. In such a case, driver does not perform link training bcz of no DPCD.

[How]
When driver is run to the modified point, EDID is read correctly and dpcd_sink_count of link is not zero. Therefore, link training should be successfully performed. Which implies parameters should be updated, e.g. lane count, link rate, etc. Checking parameters, if values of those parameters are zero, link training is not performed. So, do link-training to have detection completed.

With this patch applied, the problem cannot be reproduced. Testing other dongles, results are PASS.
Patch(v3) is verified PASS by both AMD internal lab and customer.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
index 7372dedd2f48..6188edc92d0f 100644

drivers/gpu/drm/amd/display/dc/core/dc_link.c bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) · line 728

Quoted 4 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -1
@@ -725,7 +725,9 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
 
 		if (link->connector_signal == SIGNAL_TYPE_DISPLAY_PORT &&
 			sink_caps.transaction_type == DDC_TRANSACTION_TYPE_I2C_OVER_AUX &&
-			reason != DETECT_REASON_HPDRX) {

Do we need to drop this line? This looks like it'll break the previous fix here.

Quoted 7 lines

It looks like Abdoulaye added this here to fix the 400.1.1 DP compliance test. If you can check with him that your solution is fine and make sure to test that you can get a consistent pass of 400.1.1 over 30 runs I'm okay to take the change.

Harry

Thank Rickey helped to verify this patch. Confirmed that 400.1.1 failed after applying this patch. Abandon this submission.

Quoted 7 lines

drivers/gpu/drm/amd/display/dc/core/dc_link.c bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason) · line 733

Quoted 7 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +3 -0
+			link->verified_link_cap.lane_count == 0 &&
+			link->verified_link_cap.link_rate == 0 &&
+			link->verified_link_cap.link_spread == 0) {
 			/*
 			 * TODO debug why Dell 2413 doesn't like
 			 *  two link trainings

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