[Intel-gfx] [PATCH 1/6] drm/i915/bios: Introduce has_ddi_port_info()

Jani Nikula jani.nikula at linux.intel.com
Wed Dec 22 08:48:41 UTC 2021


On Fri, 17 Dec 2021, Ville Syrjala <ville.syrjala at linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
>
> Pull the "do we want to use i915->vbt.ports[]?" check into
> a central place.
>
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Reviewed-by: Jani Nikula <jani.nikula at intel.com>

> ---
>  drivers/gpu/drm/i915/display/intel_bios.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index 76a8f001f4c4..fce1ea7a6693 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -2073,6 +2073,11 @@ static void parse_ddi_port(struct drm_i915_private *i915,
>  	i915->vbt.ports[port] = devdata;
>  }
>  
> +static bool has_ddi_port_info(struct drm_i915_private *i915)
> +{
> +	return HAS_DDI(i915);
> +}
> +
>  static void parse_ddi_ports(struct drm_i915_private *i915)
>  {
>  	struct intel_bios_encoder_data *devdata;
> @@ -2673,7 +2678,7 @@ bool intel_bios_is_port_present(struct drm_i915_private *i915, enum port port)
>  		[PORT_F] = { DVO_PORT_DPF, DVO_PORT_HDMIF, },
>  	};
>  
> -	if (HAS_DDI(i915))
> +	if (has_ddi_port_info(i915))
>  		return i915->vbt.ports[port];
>  
>  	/* FIXME maybe deal with port A as well? */
> @@ -2713,7 +2718,7 @@ bool intel_bios_is_port_edp(struct drm_i915_private *i915, enum port port)
>  		[PORT_F] = DVO_PORT_DPF,
>  	};
>  
> -	if (HAS_DDI(i915)) {
> +	if (has_ddi_port_info(i915)) {
>  		const struct intel_bios_encoder_data *devdata;
>  
>  		devdata = intel_bios_encoder_data_lookup(i915, port);
> @@ -2768,7 +2773,7 @@ bool intel_bios_is_port_dp_dual_mode(struct drm_i915_private *i915,
>  	};
>  	const struct intel_bios_encoder_data *devdata;
>  
> -	if (HAS_DDI(i915)) {
> +	if (has_ddi_port_info(i915)) {
>  		const struct intel_bios_encoder_data *devdata;
>  
>  		devdata = intel_bios_encoder_data_lookup(i915, port);

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list