Re: [PATCH 1/3] drm/i915/ddi: Move DDI port detection to the corresponding helper

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 20 Dec 2018, Imre Deak <imre.deak@xxxxxxxxx> wrote:
> We have already a function to detect DDI ports using VBT, so instead of
> opencoding the DDI specific version of this, move the opencoded part to
> the existing helper.
>
> Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
> Cc: Mika Kahola <mika.kahola@xxxxxxxxx>
> Signed-off-by: Imre Deak <imre.deak@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/intel_bios.c    | 9 +++++++++
>  drivers/gpu/drm/i915/intel_display.c | 4 +---
>  2 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c
> index 764d84d4109b..fa4091c0768b 100644
> --- a/drivers/gpu/drm/i915/intel_bios.c
> +++ b/drivers/gpu/drm/i915/intel_bios.c
> @@ -1947,6 +1947,15 @@ bool intel_bios_is_port_present(struct drm_i915_private *dev_priv, enum port por
>  	};
>  	int i;
>  
> +	if (HAS_DDI(dev_priv)) {
> +		const struct ddi_vbt_port_info *port_info =
> +			&dev_priv->vbt.ddi_port_info[port];
> +
> +		return port_info->supports_dp ||
> +		       port_info->supports_dvi ||
> +		       port_info->supports_hdmi;
> +	}
> +

I think it's pretty silly that we have two ways to parse the child
device info, pre-ddi and post-ddi... but it's not a problem with this
specific patch.

Also this doesn't work for DSI... but not a problem with this specific
patch either...

I guess a bit hesitant

Reviewed-by: Jani Nikula <jani.nikula@xxxxxxxxx>


BR,
Jani.

>  	/* FIXME maybe deal with port A as well? */
>  	if (WARN_ON(port == PORT_A) || port >= ARRAY_SIZE(port_mapping))
>  		return false;
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 3b7094822aa9..a2f8aaf61c61 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -14315,9 +14315,7 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>  		 * On SKL we don't have a way to detect DDI-E so we rely on VBT.
>  		 */
>  		if (IS_GEN9_BC(dev_priv) &&
> -		    (dev_priv->vbt.ddi_port_info[PORT_E].supports_dp ||
> -		     dev_priv->vbt.ddi_port_info[PORT_E].supports_dvi ||
> -		     dev_priv->vbt.ddi_port_info[PORT_E].supports_hdmi))
> +		    intel_bios_is_port_present(dev_priv, PORT_E))
>  			intel_ddi_init(dev_priv, PORT_E);
>  
>  	} else if (HAS_PCH_SPLIT(dev_priv)) {

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux