diff mbox series

[v1] drm/i915/dp: Modify DP lane count from DPCD reading

Message ID 20240628073013.17233-1-ben.kao@intel.com (mailing list archive)
State New, archived
Headers show
Series [v1] drm/i915/dp: Modify DP lane count from DPCD reading | expand

Commit Message

Kao, Ben June 28, 2024, 7:30 a.m. UTC
We found that the external monitor would be failed to display
when hot-plug with dual Type-C USB cable on Dell WD19DC dock.
Due to the host would receive 2 lanes setting when the first HPD,
then receive 4 lanes setting later, but the host only sets 2 lanes
DP and skips to set 4 lanes DP. I modify DP lane count if the
current DP lane count is not the same as DPCD reading.

Signed-off-by: Ben Kao <ben.kao@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Jani Nikula June 28, 2024, 7:36 a.m. UTC | #1
On Fri, 28 Jun 2024, Ben Kao <ben.kao@intel.com> wrote:
> We found that the external monitor would be failed to display
> when hot-plug with dual Type-C USB cable on Dell WD19DC dock.
> Due to the host would receive 2 lanes setting when the first HPD,
> then receive 4 lanes setting later, but the host only sets 2 lanes
> DP and skips to set 4 lanes DP. I modify DP lane count if the
> current DP lane count is not the same as DPCD reading.
>
> Signed-off-by: Ben Kao <ben.kao@intel.com>

Please file a bug according to [1].

BR,
Jani.

[1] https://drm.pages.freedesktop.org/intel-docs/how-to-file-i915-bugs.html


> ---
>  drivers/gpu/drm/i915/display/intel_dp.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c
> index 5b3b6ae1e3d7..a9b9023c6744 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> @@ -5545,6 +5545,12 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
>  	if (!intel_dp_get_dpcd(intel_dp))
>  		return connector_status_disconnected;
>  
> +	/* lanes count changed */
> +	if (intel_dp->lane_count != drm_dp_max_lane_count(intel_dp->dpcd)) {
> +		intel_dp->lane_count = drm_dp_max_lane_count(intel_dp->dpcd);
> +		return connector_status_disconnected;
> +	}
> +
>  	intel_dp->mst_detect = intel_dp_mst_detect(intel_dp);
>  
>  	/* if there's no downstream port, we're done */
Kao, Ben June 28, 2024, 7:52 a.m. UTC | #2
> On Fri, 28 Jun 2024, Ben Kao <ben.kao@intel.com> wrote:
> > We found that the external monitor would be failed to display when
> > hot-plug with dual Type-C USB cable on Dell WD19DC dock.
> > Due to the host would receive 2 lanes setting when the first HPD, then
> > receive 4 lanes setting later, but the host only sets 2 lanes DP and
> > skips to set 4 lanes DP. I modify DP lane count if the current DP lane
> > count is not the same as DPCD reading.
> >
> > Signed-off-by: Ben Kao <ben.kao@intel.com>
> 
> Please file a bug according to [1].
> 
> BR,
> Jani.
> 
> [1] https://drm.pages.freedesktop.org/intel-docs/how-to-file-i915-bugs.html
This patch is for the bug number 11195
https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/11195

> 
> 
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_dp.c
> > b/drivers/gpu/drm/i915/display/intel_dp.c
> > index 5b3b6ae1e3d7..a9b9023c6744 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp.c
> > @@ -5545,6 +5545,12 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp)
> >  	if (!intel_dp_get_dpcd(intel_dp))
> >  		return connector_status_disconnected;
> >
> > +	/* lanes count changed */
> > +	if (intel_dp->lane_count != drm_dp_max_lane_count(intel_dp->dpcd)) {
> > +		intel_dp->lane_count = drm_dp_max_lane_count(intel_dp-
> >dpcd);
> > +		return connector_status_disconnected;
> > +	}
> > +
> >  	intel_dp->mst_detect = intel_dp_mst_detect(intel_dp);
> >
> >  	/* if there's no downstream port, we're done */
> 
> --
> 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 5b3b6ae1e3d7..a9b9023c6744 100644
--- a/drivers/gpu/drm/i915/display/intel_dp.c
+++ b/drivers/gpu/drm/i915/display/intel_dp.c
@@ -5545,6 +5545,12 @@  intel_dp_detect_dpcd(struct intel_dp *intel_dp)
 	if (!intel_dp_get_dpcd(intel_dp))
 		return connector_status_disconnected;
 
+	/* lanes count changed */
+	if (intel_dp->lane_count != drm_dp_max_lane_count(intel_dp->dpcd)) {
+		intel_dp->lane_count = drm_dp_max_lane_count(intel_dp->dpcd);
+		return connector_status_disconnected;
+	}
+
 	intel_dp->mst_detect = intel_dp_mst_detect(intel_dp);
 
 	/* if there's no downstream port, we're done */