Re: [Intel-gfx] [PATCH 2/3] drm/i915/bios: Don't parse the DPS panel type when the VBT does not have it

2022-06-16 Thread Jani Nikula
On Wed, 15 Jun 2022, Ville Syrjala  wrote:
> From: Ville Syrjälä 
>
> Older VBTs don't have all the stuff we've defined for the
> LVDS options block (40). In particular we're currently parsing
> the DPS panel type bits even though they may not exist, which
> could mean we end up flagging the machine as supporting static
> DRRS when the VBT declared no such thing.
>
> We don't actually have a clear idea which VBT versions have
> which bits so we rely on the block size instead.
>
> Here's a quick list from my VBT stash:
> mgm version 108 -> 4 bytes
> alv version 120 -> 4 bytes
> cst version 134 -> 14 bytes
> pnv version 144 -> 14 bytes
> cl  version 142 -> 16 bytes
> ctg version 155 -> 24 bytes
>
> Signed-off-by: Ville Syrjälä 

Acked-by: Jani Nikula 

> ---
>  drivers/gpu/drm/i915/display/intel_bios.c | 8 
>  1 file changed, 8 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_bios.c 
> b/drivers/gpu/drm/i915/display/intel_bios.c
> index df52f406e1ae..807184fd5618 100644
> --- a/drivers/gpu/drm/i915/display/intel_bios.c
> +++ b/drivers/gpu/drm/i915/display/intel_bios.c
> @@ -758,6 +758,14 @@ parse_panel_options(struct drm_i915_private *i915,
>  
>   panel->vbt.lvds_dither = lvds_options->pixel_dither;
>  
> + /*
> +  * Empirical evidence indicates the block size can be
> +  * either 4,14,16,24+ bytes. For older VBTs no clear
> +  * relationship between the block size vs. BDB version.
> +  */
> + if (get_blocksize(lvds_options) < 16)
> + return;
> +
>   drrs_mode = (lvds_options->dps_panel_type_bits
>   >> (panel_type * 2)) & MODE_MASK;
>   /*

-- 
Jani Nikula, Intel Open Source Graphics Center


[Intel-gfx] [PATCH 2/3] drm/i915/bios: Don't parse the DPS panel type when the VBT does not have it

2022-06-15 Thread Ville Syrjala
From: Ville Syrjälä 

Older VBTs don't have all the stuff we've defined for the
LVDS options block (40). In particular we're currently parsing
the DPS panel type bits even though they may not exist, which
could mean we end up flagging the machine as supporting static
DRRS when the VBT declared no such thing.

We don't actually have a clear idea which VBT versions have
which bits so we rely on the block size instead.

Here's a quick list from my VBT stash:
mgm version 108 -> 4 bytes
alv version 120 -> 4 bytes
cst version 134 -> 14 bytes
pnv version 144 -> 14 bytes
cl  version 142 -> 16 bytes
ctg version 155 -> 24 bytes

Signed-off-by: Ville Syrjälä 
---
 drivers/gpu/drm/i915/display/intel_bios.c | 8 
 1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_bios.c 
b/drivers/gpu/drm/i915/display/intel_bios.c
index df52f406e1ae..807184fd5618 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.c
+++ b/drivers/gpu/drm/i915/display/intel_bios.c
@@ -758,6 +758,14 @@ parse_panel_options(struct drm_i915_private *i915,
 
panel->vbt.lvds_dither = lvds_options->pixel_dither;
 
+   /*
+* Empirical evidence indicates the block size can be
+* either 4,14,16,24+ bytes. For older VBTs no clear
+* relationship between the block size vs. BDB version.
+*/
+   if (get_blocksize(lvds_options) < 16)
+   return;
+
drrs_mode = (lvds_options->dps_panel_type_bits
>> (panel_type * 2)) & MODE_MASK;
/*
-- 
2.35.1