[Intel-gfx] [PATCH 5/7] drm/i915: Force sink crc stop before start.

Rafael Antognolli rafael.antognolli at intel.com
Tue Jul 28 13:14:23 PDT 2015


On Thu, Jul 23, 2015 at 04:35:48PM -0700, Rodrigo Vivi wrote:
> By Vesa DP spec, test counter at DP_TEST_SINK_MISC just reset to 0
> when unsetting DP_TEST_SINK_START, so let's force this stop here.
> 
> But let's minimize the aux transactions and just do it when we know
> it hasn't been properly stoped.
> 
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>

Reviewed-by: Rafael Antognolli <rafael.antognolli at intel.com>

> ---
>  drivers/gpu/drm/i915/intel_dp.c  | 22 +++++++++++++++++++---
>  drivers/gpu/drm/i915/intel_drv.h |  1 +
>  2 files changed, 20 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 10cbc98..3ba031d 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -3958,22 +3958,30 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)
>  	return intel_dp->is_mst;
>  }
>  
> -static void intel_dp_sink_crc_stop(struct intel_dp *intel_dp)
> +static int intel_dp_sink_crc_stop(struct intel_dp *intel_dp)
>  {
>  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
>  	struct intel_crtc *intel_crtc = to_intel_crtc(dig_port->base.base.crtc);
>  	u8 buf;
> +	int ret = 0;
>  
>  	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK, &buf) < 0) {
>  		DRM_DEBUG_KMS("Sink CRC couldn't be stopped properly\n");
> -		return;
> +		ret = -EIO;
> +		goto out;
>  	}
>  
>  	if (drm_dp_dpcd_writeb(&intel_dp->aux, DP_TEST_SINK,
> -			       buf & ~DP_TEST_SINK_START) < 0)
> +			       buf & ~DP_TEST_SINK_START) < 0) {
>  		DRM_DEBUG_KMS("Sink CRC couldn't be stopped properly\n");
> +		ret = -EIO;
> +		goto out;
> +	}
>  
> +	intel_dp->sink_crc_started = false;
> + out:
>  	hsw_enable_ips(intel_crtc);
> +	return ret;
>  }
>  
>  static int intel_dp_sink_crc_start(struct intel_dp *intel_dp)
> @@ -3981,6 +3989,13 @@ static int intel_dp_sink_crc_start(struct intel_dp *intel_dp)
>  	struct intel_digital_port *dig_port = dp_to_dig_port(intel_dp);
>  	struct intel_crtc *intel_crtc = to_intel_crtc(dig_port->base.base.crtc);
>  	u8 buf;
> +	int ret;
> +
> +	if (intel_dp->sink_crc_started) {
> +		ret = intel_dp_sink_crc_stop(intel_dp);
> +		if (ret)
> +			return ret;
> +	}
>  
>  	if (drm_dp_dpcd_readb(&intel_dp->aux, DP_TEST_SINK_MISC, &buf) < 0)
>  		return -EIO;
> @@ -3999,6 +4014,7 @@ static int intel_dp_sink_crc_start(struct intel_dp *intel_dp)
>  		return -EIO;
>  	}
>  
> +	intel_dp->sink_crc_started = true;
>  	return 0;
>  }
>  
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index 47cef0e..cc74400 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -714,6 +714,7 @@ struct intel_dp {
>  	/* sink rates as reported by DP_SUPPORTED_LINK_RATES */
>  	uint8_t num_sink_rates;
>  	int sink_rates[DP_MAX_SUPPORTED_RATES];
> +	bool sink_crc_started;
>  	struct drm_dp_aux aux;
>  	uint8_t train_set[4];
>  	int panel_power_up_delay;
> -- 
> 2.1.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx


More information about the Intel-gfx mailing list