[Intel-gfx] [PATCH] Wake up DP sinks for DPCD read-based detection.

Chris Wilson chris at chris-wilson.co.uk
Fri Aug 16 10:01:28 CEST 2013


On Thu, Aug 15, 2013 at 05:30:32PM -0700, james.ausmus at intel.com wrote:
>  static bool intel_dp_get_hw_state(struct intel_encoder *encoder,
>  				  enum pipe *pipe)
>  {
> @@ -2330,6 +2336,12 @@ intel_dp_detect(struct drm_connector *connector, bool force)
>  
>  	intel_dp->has_audio = false;
>  
> +	/* Ensure the sink is awake for DPCD/EDID reads. */

I would try using the force parameter to return the last known status to
avoid the extra busy work.

> +	if (connector->dpms != DRM_MODE_DPMS_ON) {
> +		/* Bypass DPCD check, since we obtain it during detection. */
> +		intel_dp_do_sink_dpms(intel_dp, DRM_MODE_DPMS_ON);
> +	}
> +
>  	if (HAS_PCH_SPLIT(dev))
>  		status = ironlake_dp_detect(intel_dp);
>  	else
> @@ -2339,8 +2351,11 @@ intel_dp_detect(struct drm_connector *connector, bool force)
>  			   32, 1, dpcd_hex_dump, sizeof(dpcd_hex_dump), false);
>  	DRM_DEBUG_KMS("DPCD: %s\n", dpcd_hex_dump);
>  
> -	if (status != connector_status_connected)
> +	if (status != connector_status_connected) {
> +		if (connector->dpms != DRM_MODE_DPMS_ON)
> +			intel_dp_do_sink_dpms(intel_dp, connector->dpms);
>  		return status;
> +	}
>  
>  	intel_dp_probe_oui(intel_dp);
>  
> @@ -2356,6 +2371,11 @@ intel_dp_detect(struct drm_connector *connector, bool force)
>  
>  	if (intel_encoder->type != INTEL_OUTPUT_EDP)
>  		intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT;
> +
> +	/* Restore the sink state */
> +	if (connector->dpms != DRM_MODE_DPMS_ON)
> +		intel_dp_do_sink_dpms(intel_dp, connector->dpms);
> +
>  	return connector_status_connected;
>  }

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list