[Intel-gfx] [PATCH 5/5] drm/i915: don't init DP or HDMI when not supported by DDI port

Chris Wilson chris at chris-wilson.co.uk
Wed Sep 11 23:19:22 CEST 2013


On Wed, Sep 11, 2013 at 06:02:51PM -0300, Paulo Zanoni wrote:
> From: Paulo Zanoni <paulo.r.zanoni at intel.com>
> 
> There's no reason to init a DP connector if the encoder just supports
> HDMI: we'll just waste hundreds and hundreds of cycles trying to do DP
> AUX transactions to detect if there's something there. Same goes for a
> DP connector that doesn't support HDMI, but I'm not sure these
> actually exist.
> 
> Signed-off-by: Paulo Zanoni <paulo.r.zanoni at intel.com>
> Reviewed-by: Rodrigo Vivi <rodrigo.vivi at gmail.com>
> ---
>  drivers/gpu/drm/i915/i915_drv.h   |  3 +++
>  drivers/gpu/drm/i915/intel_bios.c | 13 ++++++++++++-
>  drivers/gpu/drm/i915/intel_ddi.c  | 30 ++++++++++++++++++++++--------
>  3 files changed, 37 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 298c671..8533bf1 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1054,6 +1054,9 @@ enum modeset_restore {
>  
>  struct ddi_vbt_port_info {
>  	uint8_t hdmi_level_shift;
> +	bool supports_dvi;
> +	bool supports_hdmi;
> +	bool supports_dp;

Might as well make these uint8_t:1;

> -	if (!intel_dp_init_connector(intel_dig_port, dp_connector)) {
> -		drm_encoder_cleanup(encoder);
> -		kfree(intel_dig_port);
> -		kfree(dp_connector);
> -		return;
> +	if (init_dp) {
> +		if (!intel_dp_init_connector(intel_dig_port, dp_connector)) {
> +			drm_encoder_cleanup(encoder);
> +			kfree(intel_dig_port);
> +			kfree(dp_connector);
> +			return;
> +		}
>  	}

You are mixing styles here. Elsewhere with init_hdmi you have, thankfully,
opted to eliminated the extra level of useless indentation. So please
use if (init_dp && !intel_dp_init_connector()).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre



More information about the Intel-gfx mailing list