[Intel-gfx] [PATCH 3/5] drm/i915: digital_port_connected sort platforms newer-to-older

Ville Syrjälä ville.syrjala at linux.intel.com
Fri Oct 19 19:50:01 UTC 2018


On Fri, Oct 19, 2018 at 12:03:33PM -0700, Rodrigo Vivi wrote:
> Just sorting this "if" block from newer to older platform.
> 
> The main difference here is the addition of a
> missing case with return false that should never occur.
> And if it occurs it is better than to raise a warn
> than use the icl one.
> 
> The gen >= 11 was already present in the previous logic,
> although hidden.
> 
> So, in summary no real functional change.
> 
> Cc: Jani Nikula <jani.nikula at intel.com>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_dp.c | 27 +++++++++++++++------------
>  1 file changed, 15 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
> index 3384a9bbdafd..8c38efef77a1 100644
> --- a/drivers/gpu/drm/i915/intel_dp.c
> +++ b/drivers/gpu/drm/i915/intel_dp.c
> @@ -5035,20 +5035,23 @@ bool intel_digital_port_connected(struct intel_encoder *encoder)
>  			return g4x_digital_port_connected(encoder);
>  	}
>  
> -	if (IS_GEN5(dev_priv))
> -		return ilk_digital_port_connected(encoder);
> -	else if (IS_GEN6(dev_priv))
> -		return snb_digital_port_connected(encoder);
> -	else if (IS_GEN7(dev_priv))
> -		return ivb_digital_port_connected(encoder);
> -	else if (IS_GEN8(dev_priv))
> -		return bdw_digital_port_connected(encoder);
> +	if (INTEL_GEN(dev_priv) >= 11)
> +		return icl_digital_port_connected(encoder);
> +	else if (IS_GEN10(dev_priv) || IS_GEN9_BC(dev_priv))
> +		return spt_digital_port_connected(encoder);
>  	else if (IS_GEN9_LP(dev_priv))
>  		return bxt_digital_port_connected(encoder);

Tough choice here between skl+/cnl vs. bxt/glk. I guess this
is pretty much as good as the other order.

Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Might also be good vfunc territory here. If we made it per-encoder
we could even remove the port A special cases from these. At the
cost of some extra function pointers in our structs.

> -	else if (IS_GEN9_BC(dev_priv) || IS_GEN10(dev_priv))
> -		return spt_digital_port_connected(encoder);
> -	else
> -		return icl_digital_port_connected(encoder);
> +	else if (IS_GEN8(dev_priv))
> +		return bdw_digital_port_connected(encoder);
> +	else if (IS_GEN7(dev_priv))
> +		return ivb_digital_port_connected(encoder);
> +	else if (IS_GEN6(dev_priv))
> +		return snb_digital_port_connected(encoder);
> +	else if (IS_GEN5(dev_priv))
> +		return ilk_digital_port_connected(encoder);
> +
> +	MISSING_CASE(INTEL_GEN(dev_priv));
> +	return false;
>  }
>  
>  static struct edid *
> -- 
> 2.19.1
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Ville Syrjälä
Intel


More information about the Intel-gfx mailing list