[Intel-gfx] [PATCH v2 4/4] drm/i915/display: hide workaround for broken vbt in intel_bios.c

Jani Nikula jani.nikula at linux.intel.com
Wed Apr 28 07:02:45 UTC 2021


On Tue, 27 Apr 2021, Lucas De Marchi <lucas.demarchi at intel.com> wrote:
> Instead of poluting the normal code path in intel_display.c, make
> intel_bios.c handle the brokenness of the VBT.
>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_bios.c    | 15 +++++++++++++++
>  drivers/gpu/drm/i915/display/intel_display.c | 14 ++------------
>  2 files changed, 17 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c b/drivers/gpu/drm/i915/display/intel_bios.c
> index befab891a6b9..e9f828452412 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -1852,6 +1852,14 @@ intel_bios_encoder_supports_edp(const struct intel_bios_encoder_data *devdata)
>  		devdata->child.device_type & DEVICE_TYPE_INTERNAL_CONNECTOR;
>  }
>  
> +static bool skip_broken_vbt(struct drm_i915_private *i915, enum port port)
> +{
> +	if (port == PORT_F && (IS_ICELAKE(i915) || IS_CANNONLAKE(i915)))
> +		return !IS_ICL_WITH_PORT_F(i915) && !IS_CNL_WITH_PORT_F(i915);
> +
> +	return false;
> +}
> +
>  static void parse_ddi_port(struct drm_i915_private *i915,
>  			   struct intel_bios_encoder_data *devdata)
>  {
> @@ -1865,6 +1873,13 @@ static void parse_ddi_port(struct drm_i915_private *i915,
>  	if (port == PORT_NONE)
>  		return;
>  
> +	if (skip_broken_vbt(i915, port)) {
> +		drm_dbg_kms(&i915->drm,
> +			    "VBT reports port %c as supported, but that can't be true: skipping\n",
> +			    port_name(port));
> +		return;
> +	}
> +
>  	info = &i915->vbt.ddi_port_info[port];
>  
>  	if (info->devdata) {
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 55f8f2ceada2..64a2a3b9a480 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -10868,15 +10868,7 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>  		intel_ddi_init(dev_priv, PORT_C);
>  		intel_ddi_init(dev_priv, PORT_D);
>  		intel_ddi_init(dev_priv, PORT_E);
> -
> -		/*
> -		 * On some ICL SKUs port F is not present, but broken VBTs mark
> -		 * the port as present. Only try to initialize port F for the
> -		 * SKUs that may actually have it.
> -		 */
> -		if (IS_ICL_WITH_PORT_F(dev_priv))
> -			intel_ddi_init(dev_priv, PORT_F);
> -
> +		intel_ddi_init(dev_priv, PORT_F);
>  		icl_dsi_init(dev_priv);
>  	} else if (IS_GEMINILAKE(dev_priv) || IS_BROXTON(dev_priv)) {
>  		intel_ddi_init(dev_priv, PORT_A);
> @@ -10889,9 +10881,7 @@ static void intel_setup_outputs(struct drm_i915_private *dev_priv)
>  		intel_ddi_init(dev_priv, PORT_C);
>  		intel_ddi_init(dev_priv, PORT_D);
>  		intel_ddi_init(dev_priv, PORT_E);
> -
> -		if (IS_CNL_WITH_PORT_F(dev_priv))
> -			intel_ddi_init(dev_priv, PORT_F);
> +		intel_ddi_init(dev_priv, PORT_E);

Whoops, not PORT_E, but I guess you noticed. :)


>  	} else if (HAS_DDI(dev_priv)) {
>  		u32 found;

-- 
Jani Nikula, Intel Open Source Graphics Center


More information about the Intel-gfx mailing list