diff mbox series

[05/10] drm/i915: Do not try to set DPMS if sink is disconnected

Message ID 20181002175054.15010-5-jose.souza@intel.com (mailing list archive)
State New, archived
Headers show
Series [01/10] drm: Do not call drm_dp_cec_set_edid() while registering DP connectors | expand

Commit Message

Souza, Jose Oct. 2, 2018, 5:50 p.m. UTC
intel_dp_sink_dpms() is also called in the DP port disconnection
flow, causing the DPCD transactions to fail due obvious reaons.
So lets check the connector state before waste any time trying
to do DPCD in a disconnected sink.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/intel_dp.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Ville Syrjälä Oct. 2, 2018, 8:32 p.m. UTC | #1
On Tue, Oct 02, 2018 at 10:50:49AM -0700, José Roberto de Souza wrote:
> intel_dp_sink_dpms() is also called in the DP port disconnection
> flow, causing the DPCD transactions to fail due obvious reaons.
> So lets check the connector state before waste any time trying
> to do DPCD in a disconnected sink.
> 
> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 2cd2dc564181..46ac603da91d 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -2818,6 +2818,10 @@ void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode)
>  	if (intel_dp->dpcd[DP_DPCD_REV] < 0x11)
>  		return;
>  
> +	if (intel_dp->attached_connector->base.status !=
> +	    connector_status_connected)
> +		return;
> +

The user can stil yank the cable out at any time. So I don't see much 
point in trying to avoid this stuff. IMO better go through with the 
whole thing as normal rather than adding exceptions for things we
can't even control.

>  	if (mode != DRM_MODE_DPMS_ON) {
>  		if (downstream_hpd_needs_d0(intel_dp))
>  			return;
> -- 
> 2.19.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 2cd2dc564181..46ac603da91d 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -2818,6 +2818,10 @@  void intel_dp_sink_dpms(struct intel_dp *intel_dp, int mode)
 	if (intel_dp->dpcd[DP_DPCD_REV] < 0x11)
 		return;
 
+	if (intel_dp->attached_connector->base.status !=
+	    connector_status_connected)
+		return;
+
 	if (mode != DRM_MODE_DPMS_ON) {
 		if (downstream_hpd_needs_d0(intel_dp))
 			return;