mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arun Iyengar via B4 Relay <devnull+aiyengar1990.gmail.com@kernel.org>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	 Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	 David Airlie <airlied@gmail.com>,
	Simona Vetter <simona@ffwll.ch>,
	 Jani Nikula <jani.nikula@intel.com>,
	Yaroslav Bolyukin <iam@lach.pw>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	 Arun Iyengar <aiyengar1990@gmail.com>
Subject: [PATCH] drm/edid: Don't mark DisplayID Type VII YCbCr 4:2:0 timings preferred
Date: Tue, 01 Dec 2026 10:08:51 +0000	[thread overview]
Message-ID: <20261201-displayid-t7-y420-v1-1-da4e2c15ec3f@gmail.com> (raw)

From: Arun Iyengar <aiyengar1990@gmail.com>

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")
Signed-off-by: Arun Iyengar <aiyengar1990@gmail.com>
---
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)
 {
 	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))
 		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 <aiyengar1990@gmail.com>



             reply	other threads:[~2026-12-01 10:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 10:08 Arun Iyengar via B4 Relay [this message]
2026-12-01 14:19 ` Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261201-displayid-t7-y420-v1-1-da4e2c15ec3f@gmail.com \
    --to=devnull+aiyengar1990.gmail.com@kernel.org \
    --cc=airlied@gmail.com \
    --cc=aiyengar1990@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=iam@lach.pw \
    --cc=jani.nikula@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®