All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] drm/amd/display: Fix AppleDongle can't be detected
@ 2019-12-11  7:33 Louis Li
  2019-12-17 15:57 ` Harry Wentland
  0 siblings, 1 reply; 4+ messages in thread
From: Louis Li @ 2019-12-11  7:33 UTC (permalink / raw)
  To: amd-gfx; +Cc: harry.wentland, nicholas.kazlauskas, ching-li, 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.


Signed-off-by: Louis Li <Ching-shih.Li@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 7372dedd2f48..6188edc92d0f 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -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
-- 
2.21.0

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] drm/amd/display: Fix AppleDongle can't be detected
  2019-12-11  7:33 [PATCH v3] drm/amd/display: Fix AppleDongle can't be detected Louis Li
@ 2019-12-17 15:57 ` Harry Wentland
  2019-12-18 19:35   ` Louis Li
  2019-12-24  3:13   ` Louis Li
  0 siblings, 2 replies; 4+ messages in thread
From: Harry Wentland @ 2019-12-17 15:57 UTC (permalink / raw)
  To: Louis Li, amd-gfx; +Cc: harry.wentland, nicholas.kazlauskas, ching-li

On 2019-12-11 2:33 a.m., Louis Li wrote:
> [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.
> 
> 
> Signed-off-by: Louis Li <Ching-shih.Li@amd.com>
> ---
>  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> index 7372dedd2f48..6188edc92d0f 100644
> --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> @@ -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

> +			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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] drm/amd/display: Fix AppleDongle can't be detected
  2019-12-17 15:57 ` Harry Wentland
@ 2019-12-18 19:35   ` Louis Li
  2019-12-24  3:13   ` Louis Li
  1 sibling, 0 replies; 4+ messages in thread
From: Louis Li @ 2019-12-18 19:35 UTC (permalink / raw)
  To: Harry Wentland; +Cc: harry.wentland, nicholas.kazlauskas, amd-gfx, Louis Li

On Tue, Dec 17, 2019 at 10:57:11AM -0500, Harry Wentland wrote:
> On 2019-12-11 2:33 a.m., Louis Li wrote:
> > [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.
> > 
> > 
> > Signed-off-by: Louis Li <Ching-shih.Li@amd.com>
> > ---
> >  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > index 7372dedd2f48..6188edc92d0f 100644
> > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > @@ -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
> 

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

> > +			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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v3] drm/amd/display: Fix AppleDongle can't be detected
  2019-12-17 15:57 ` Harry Wentland
  2019-12-18 19:35   ` Louis Li
@ 2019-12-24  3:13   ` Louis Li
  1 sibling, 0 replies; 4+ messages in thread
From: Louis Li @ 2019-12-24  3:13 UTC (permalink / raw)
  To: Harry Wentland; +Cc: harry.wentland, nicholas.kazlauskas, amd-gfx, Louis Li

On Tue, Dec 17, 2019 at 10:57:11AM -0500, Harry Wentland wrote:
> On 2019-12-11 2:33 a.m., Louis Li wrote:
> > [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.
> > 
> > 
> > Signed-off-by: Louis Li <Ching-shih.Li@amd.com>
> > ---
> >  drivers/gpu/drm/amd/display/dc/core/dc_link.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > index 7372dedd2f48..6188edc92d0f 100644
> > --- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > +++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
> > @@ -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
> 

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

> > +			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
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-12-24  3:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-11  7:33 [PATCH v3] drm/amd/display: Fix AppleDongle can't be detected Louis Li
2019-12-17 15:57 ` Harry Wentland
2019-12-18 19:35   ` Louis Li
2019-12-24  3:13   ` Louis Li

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.