diff mbox series

drm/i915/display: Fixed the main link lost in MST

Message ID 20240425033426.2269822-1-gareth.yu@intel.com (mailing list archive)
State New, archived
Headers show
Series drm/i915/display: Fixed the main link lost in MST | expand

Commit Message

Yu, Gareth April 25, 2024, 3:34 a.m. UTC
From: Gareth Yu <gareth.yu@intel.com>

Re-train the main link when the sink asserts a HPD for the main lnk
lost.

v4:  detect the main link state by intel_dp_needs_link_retrain
     instead of intel_dp_mst_link_status because the main link
     state can't detect correctly sometimes by
     intel_dp_mst_link_status

Cc : Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
Cc : Matt Roper <matthew.d.roper@intel.com>
Cc : Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Gareth Yu <gareth.yu@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Jani Nikula April 25, 2024, 11:30 a.m. UTC | #1
On Thu, 25 Apr 2024, gareth.yu@intel.com wrote:
> From: Gareth Yu <gareth.yu@intel.com>
>
> Re-train the main link when the sink asserts a HPD for the main lnk
> lost.

NAK.

Please read the review comments.

BR,
Jani.

>
> v4:  detect the main link state by intel_dp_needs_link_retrain
>      instead of intel_dp_mst_link_status because the main link
>      state can't detect correctly sometimes by
>      intel_dp_mst_link_status
>
> Cc : Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
> Cc : Matt Roper <matthew.d.roper@intel.com>
> Cc : Ville Syrjälä <ville.syrjala@linux.intel.com>
> Signed-off-by: Gareth Yu <gareth.yu@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index e05e25cd4a94..e1b60303b256 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -5849,8 +5849,14 @@ intel_dp_detect(struct drm_connector *connector,
>  	/* Can't disconnect eDP */
>  	if (intel_dp_is_edp(intel_dp))
>  		status = edp_detect(intel_dp);
> -	else if (intel_digital_port_connected(encoder))
> +	else if (intel_digital_port_connected(encoder)) {
>  		status = intel_dp_detect_dpcd(intel_dp);
> +		if (status == connector_status_connected && intel_dp->is_mst &&
> +		    intel_dp_needs_link_retrain(intel_dp)) {
> +			if (intel_dp_retrain_link(encoder, ctx))
> +				status = connector_status_disconnected;
> +		}
> +	}
>  	else
>  		status = connector_status_disconnected;
Yu, Gareth April 26, 2024, 7:56 a.m. UTC | #2
Posted V5 that change the order of the existing flow.
 
Found Tejas' email address is incorrect. Will correct in V6.

Gareth

> -----Original Message-----
> From: Jani Nikula <jani.nikula@linux.intel.com>
> Sent: Thursday, April 25, 2024 7:31 PM
> To: Yu, Gareth <gareth.yu@intel.com>; intel-gfx@lists.freedesktop.org
> Cc: Yu, Gareth <gareth.yu@intel.com>
> Subject: Re: [PATCH] drm/i915/display: Fixed the main link lost in MST
> 
> On Thu, 25 Apr 2024, gareth.yu@intel.com wrote:
> > From: Gareth Yu <gareth.yu@intel.com>
> >
> > Re-train the main link when the sink asserts a HPD for the main lnk
> > lost.
> 
> NAK.
> 
> Please read the review comments.
> 
> BR,
> Jani.
> 
> >
> > v4:  detect the main link state by intel_dp_needs_link_retrain
> >      instead of intel_dp_mst_link_status because the main link
> >      state can't detect correctly sometimes by
> >      intel_dp_mst_link_status
> >
> > Cc : Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay@intel.com>
> > Cc : Matt Roper <matthew.d.roper@intel.com> Cc : Ville Syrjälä
> > <ville.syrjala@linux.intel.com>
> > Signed-off-by: Gareth Yu <gareth.yu@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> > b/drivers/gpu/drm/i915/display/intel_dp.c
> > index e05e25cd4a94..e1b60303b256 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > @@ -5849,8 +5849,14 @@ intel_dp_detect(struct drm_connector
> *connector,
> >  	/* Can't disconnect eDP */
> >  	if (intel_dp_is_edp(intel_dp))
> >  		status = edp_detect(intel_dp);
> > -	else if (intel_digital_port_connected(encoder))
> > +	else if (intel_digital_port_connected(encoder)) {
> >  		status = intel_dp_detect_dpcd(intel_dp);
> > +		if (status == connector_status_connected && intel_dp->is_mst
> &&
> > +		    intel_dp_needs_link_retrain(intel_dp)) {
> > +			if (intel_dp_retrain_link(encoder, ctx))
> > +				status = connector_status_disconnected;
> > +		}
> > +	}
> >  	else
> >  		status = connector_status_disconnected;
> 
> --
> Jani Nikula, Intel
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
index e05e25cd4a94..e1b60303b256 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -5849,8 +5849,14 @@  intel_dp_detect(struct drm_connector *connector,
 	/* Can't disconnect eDP */
 	if (intel_dp_is_edp(intel_dp))
 		status = edp_detect(intel_dp);
-	else if (intel_digital_port_connected(encoder))
+	else if (intel_digital_port_connected(encoder)) {
 		status = intel_dp_detect_dpcd(intel_dp);
+		if (status == connector_status_connected && intel_dp->is_mst &&
+		    intel_dp_needs_link_retrain(intel_dp)) {
+			if (intel_dp_retrain_link(encoder, ctx))
+				status = connector_status_disconnected;
+		}
+	}
 	else
 		status = connector_status_disconnected;