On Tue, 01 Dec 2026, Arun Iyengar via B4 Relay 
<[email protected]> wrote:
> From: Arun Iyengar <[email protected]>
>
> In a DisplayID Type VII timing data block of revision 2 or later, bit 7
> of the timing options means YCbCr 4:2:0 support, not preferred timing.
> Only treat it as preferred in Type I and older Type VII blocks.
>
> Fixes: 80ecb5d7c0f2 ("drm/edid: Support type 7 timings")

Cc: <[email protected]> # v5.18+

> Signed-off-by: Arun Iyengar <[email protected]>
> ---
> edid-decode reads bit 7 the same way. Local KUnit case: a Type VII
> revision 2 timing with bit 7 set was preferred before and is not after;
> Type I and Type VII revisions 0 and 1 are unchanged. No such display tested.
>
> If "drm/edid: Add the modes of CTA Type VII video timing data blocks"
> lands first, I will send a v2 that passes the revision there too.
>
> Developed with Claude (Anthropic), which wrote the code and commit message; I 
> reviewed it.
> ---
>  drivers/gpu/drm/drm_edid.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index b8f882a17c8f..e171d6fd8377 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -7053,7 +7053,7 @@ static void update_display_info(struct drm_connector 
> *connector,
>  
>  static struct drm_display_mode *drm_mode_displayid_detailed(struct 
> drm_device *dev,
>                                                           const struct 
> displayid_detailed_timings_1 *timings,
> -                                                         bool type_7)
> +                                                         bool type_7, u8 
> block_rev)

Should probably be just int block_rev.

>  {
>       struct drm_display_mode *mode;
>       unsigned int pixel_clock = (timings->pixel_clock[0] |
> @@ -7091,7 +7091,8 @@ static struct drm_display_mode 
> *drm_mode_displayid_detailed(struct drm_device *d
>       mode->flags |= vsync_positive ? DRM_MODE_FLAG_PVSYNC : 
> DRM_MODE_FLAG_NVSYNC;
>       mode->type = DRM_MODE_TYPE_DRIVER;
>  
> -     if (timings->flags & 0x80)
> +     /* Type VII block revision 2+ uses bit 7 for YCbCr 4:2:0, not preferred 
> */
> +     if ((timings->flags & 0x80) && !(type_7 && block_rev >= 2))

I think conceptually, for humans, this reads better:

        if ((!type_7 || block_rev < 2) && (timings->flags & 0x80))

i.e. don't look at the flag before you've actually ensured you need to
look at the flag.

Overall this matches the spec either way,

Reviewed-by: Jani Nikula <[email protected]>

>               mode->type |= DRM_MODE_TYPE_PREFERRED;
>       drm_mode_set_name(mode);
>  
> @@ -7115,7 +7116,8 @@ static int add_displayid_detailed_1_modes(struct 
> drm_connector *connector,
>       for (i = 0; i < num_timings; i++) {
>               struct displayid_detailed_timings_1 *timings = &det->timings[i];
>  
> -             newmode = drm_mode_displayid_detailed(connector->dev, timings, 
> type_7);
> +             newmode = drm_mode_displayid_detailed(connector->dev, timings, 
> type_7,
> +                                                   block->rev & 0x7);
>               if (!newmode)
>                       continue;
>  
>
> ---
> base-commit: c408466a4dfaee4b12587e926c5b85e68c8b3c40
> change-id: 20261130-displayid-t7-y420-058c00501fb0
>
> Best regards,
> --  
> Arun Iyengar <[email protected]>
>
>

-- 
Jani Nikula, Intel

Reply via email to