* [PATCH] drm/edid: Don't prefer reduced blanking for standard timings on EDID < 1.4
@ 2026-12-03 17:07 Eriksen Xie
2026-12-03 18:21 ` sashiko-bot
2026-12-03 20:23 ` Jani Nikula
0 siblings, 2 replies; 4+ messages in thread
From: Eriksen Xie @ 2026-12-03 17:07 UTC (permalink / raw)
To: dri-devel
Cc: Jani Nikula, Ville Syrjälä, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, David Airlie, Simona Vetter,
linux-kernel, Eriksen Xie
drm_monitor_supports_rb() can only read the reduced blanking flag from
the range limits descriptor on EDID 1.4. For older EDIDs it just assumes
that every digital sink supports reduced blanking.
drm_mode_std() uses that to prefer the reduced blanking variant of a
standard timing. The preference was added by
commit f6e252bac45c ("drm/edid: Allow drm_mode_find_dmt to hunt for reduced-blanking modes")
and only took effect once
commit 383a6d5fdd9a ("drm/edid: Add the reduced blanking DMT modes to the DMT list")
added the RB entries to the DMT table.
As a result a sink that lists, for example, 1920x1200@60 as a standard
timing (DMT 0x45, 193.25 MHz) gets DMT 0x44 (154.0 MHz, RB) instead,
even if its EDID is 1.3 with only GTF range limits and never claims RB
support. 1680x1050@60 and 1280x800@60 are replaced the same way. A DELL
P2715Q (EDID 1.3) is one such sink.
Where the support is only a guess, keep the plain DMT mode if it is
within the sink's range limits and only fall back to the reduced
blanking mode when it is not, or when there is no range limits
descriptor. That keeps RB for sinks that need it to fit their pixel
clock limit. EDID 1.4 sinks that explicitly declare reduced blanking are
unchanged.
Signed-off-by: Eriksen Xie <xiaolu.xie@intel.com>
---
drivers/gpu/drm/drm_edid.c | 54 ++++++++++++++++++++++++++++++++++++++
1 file changed, 54 insertions(+)
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index b8f882a17..a657da8c5 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3402,6 +3402,45 @@ drm_gtf2_mode(struct drm_device *dev,
return mode;
}
+static bool mode_in_range(const struct drm_display_mode *mode,
+ const struct drm_edid *drm_edid,
+ const struct detailed_timing *timing);
+
+struct std_dmt_range_closure {
+ const struct drm_display_mode *mode;
+ const struct drm_edid *drm_edid;
+ bool found;
+ bool in_range;
+};
+
+static void std_dmt_in_range(const struct detailed_timing *timing, void *data)
+{
+ struct std_dmt_range_closure *closure = data;
+
+ if (!is_display_descriptor(timing, EDID_DETAIL_MONITOR_RANGE))
+ return;
+
+ closure->found = true;
+ closure->in_range = mode_in_range(closure->mode, closure->drm_edid, timing);
+}
+
+/*
+ * True only if the sink has a range limits descriptor and the plain
+ * (non-reduced-blanking) DMT mode is inside it.
+ */
+static bool std_dmt_mode_in_monitor_range(const struct drm_edid *drm_edid,
+ const struct drm_display_mode *mode)
+{
+ struct std_dmt_range_closure closure = {
+ .mode = mode,
+ .drm_edid = drm_edid,
+ };
+
+ drm_for_each_detailed_block(drm_edid, std_dmt_in_range, &closure);
+
+ return closure.found && closure.in_range;
+}
+
/*
* Take the standard timing params (in this case width, aspect, and refresh)
* and convert them into a real mode using CVT/GTF/DMT.
@@ -3473,6 +3512,21 @@ static struct drm_display_mode *drm_mode_std(struct drm_connector *connector,
/* check whether it can be found in default mode table */
if (drm_monitor_supports_rb(drm_edid)) {
+ /*
+ * Before EDID 1.4 reduced blanking support is only guessed, so
+ * don't let the guess replace the timing the sink listed: keep
+ * the plain DMT mode if it is within the sink's range limits.
+ */
+ if (drm_edid->edid->revision < 4) {
+ mode = drm_mode_find_dmt(dev, hsize, vsize,
+ vrefresh_rate, false);
+ if (mode) {
+ if (std_dmt_mode_in_monitor_range(drm_edid, mode))
+ return mode;
+ drm_mode_destroy(dev, mode);
+ }
+ }
+
mode = drm_mode_find_dmt(dev, hsize, vsize, vrefresh_rate,
true);
if (mode)
--
2.43.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/edid: Don't prefer reduced blanking for standard timings on EDID < 1.4
2026-12-03 17:07 [PATCH] drm/edid: Don't prefer reduced blanking for standard timings on EDID < 1.4 Eriksen Xie
@ 2026-12-03 18:21 ` sashiko-bot
2026-12-03 20:23 ` Jani Nikula
1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-12-03 18:21 UTC (permalink / raw)
To: Eriksen Xie, dri-devel
Thank you for your contribution! Sashiko AI review found 4 potential
issues to consider:
- [Medium] drm/edid: std_dmt_in_range() ignores unspecified max pixel
clock
- [Low] drm/edid: std_dmt_in_range() overwrites in_range across range
descriptors
- [Low] drm/edid: missing Fixes trailer for commit f6e252bac45c
- [Low] drm/edid: redundant DMT lookup and alloc/free cycle in
drm_mode_std()
--
commit 2399ce37e3ebb2fde8967f9739e27ee27247f004
Author: Eriksen Xie <xiaolu.xie@intel.com>
> drm/edid: Don't prefer reduced blanking for standard timings on EDID < 1.4
>
> drm_monitor_supports_rb() can only read the reduced blanking flag from
> the range limits descriptor on EDID 1.4. For older EDIDs it just assumes
> that every digital sink supports reduced blanking.
>
> drm_mode_std() uses that to prefer the reduced blanking variant of a
> standard timing. The preference was added by
> commit f6e252bac45c ("drm/edid: Allow drm_mode_find_dmt to hunt for reduced-blanking modes")
> and only took effect once
> commit 383a6d5fdd9a ("drm/edid: Add the reduced blanking DMT modes to the DMT list")
> added the RB entries to the DMT table.
>
> As a result a sink that lists, for example, 1920x1200@60 as a standard
> timing (DMT 0x45, 193.25 MHz) gets DMT 0x44 (154.0 MHz, RB) instead,
> even if its EDID is 1.3 with only GTF range limits and never claims RB
> support. 1680x1050@60 and 1280x800@60 are replaced the same way. A DELL
> P2715Q (EDID 1.3) is one such sink.
>
> Where the support is only a guess, keep the plain DMT mode if it is
> within the sink's range limits and only fall back to the reduced
> blanking mode when it is not, or when there is no range limits
> descriptor. That keeps RB for sinks that need it to fit their pixel
> clock limit. EDID 1.4 sinks that explicitly declare reduced blanking are
> unchanged.
>
> Signed-off-by: Eriksen Xie <xiaolu.xie@intel.com>
[Severity: Low]
This looks like a bug fix for the reduced-blanking preference in
drm_mode_std(). Should this include:
Fixes: f6e252bac45c ("drm/edid: Allow drm_mode_find_dmt to hunt for reduced-blanking modes")
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index b8f882a17c8f1..a657da8c5e2d0 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3402,6 +3402,45 @@ drm_gtf2_mode(struct drm_device *dev,
> return mode;
> }
>
> +static bool mode_in_range(const struct drm_display_mode *mode,
> + const struct drm_edid *drm_edid,
> + const struct detailed_timing *timing);
> +
> +struct std_dmt_range_closure {
> + const struct drm_display_mode *mode;
> + const struct drm_edid *drm_edid;
> + bool found;
> + bool in_range;
> +};
> +
> +static void std_dmt_in_range(const struct detailed_timing *timing, void *data)
> +{
> + struct std_dmt_range_closure *closure = data;
> +
> + if (!is_display_descriptor(timing, EDID_DETAIL_MONITOR_RANGE))
> + return;
> +
> + closure->found = true;
> + closure->in_range = mode_in_range(closure->mode, closure->drm_edid, timing);
> +}
[Severity: Medium]
Can std_dmt_in_range() accept a plain DMT mode when the range limits
descriptor leaves the maximum pixel clock unspecified?
range_pixel_clock() returns 0 when byte 9 is 0 or 255, and
mode_in_range() skips the pixel clock check when max_clock is 0. Plain
and RB 60 Hz DMT pairs like 1920x1200@60 (193.25 MHz vs 154.0 MHz RB)
have nearly identical hsync and vsync, so the plain mode still passes.
On an EDID < 1.4 digital sink limited by single-link DVI (165 MHz) that
leaves byte 9 unspecified, this regression causes the higher-clock plain
mode to be pruned or fail modeset instead of falling back to RB. Should
std_dmt_in_range() require a non-zero range_pixel_clock()?
> +/*
> + * True only if the sink has a range limits descriptor and the plain
> + * (non-reduced-blanking) DMT mode is inside it.
> + */
> +static bool std_dmt_mode_in_monitor_range(const struct drm_edid *drm_edid,
> + const struct drm_display_mode *mode)
> +{
> + struct std_dmt_range_closure closure = {
> + .mode = mode,
> + .drm_edid = drm_edid,
> + };
> +
> + drm_for_each_detailed_block(drm_edid, std_dmt_in_range, &closure);
> +
> + return closure.found && closure.in_range;
> +}
[Severity: Low]
Can std_dmt_in_range() overwrite an earlier match if an EDID has more
than one EDID_DETAIL_MONITOR_RANGE descriptor?
drm_for_each_detailed_block() visits every detailed block across the
base, CEA, and VTB blocks without stopping, so assigning
closure->in_range directly keeps only the last range descriptor's
result instead of matching if any descriptor covers the mode.
Also, closure.found is redundant because closure.in_range starts as
false and is only set inside std_dmt_in_range(). Dropping found and
using closure->in_range |= mode_in_range(...) handles both.
[ ... ]
> @@ -3473,6 +3512,21 @@ static struct drm_display_mode *drm_mode_std(struct drm_connector *connector,
>
> /* check whether it can be found in default mode table */
> if (drm_monitor_supports_rb(drm_edid)) {
> + /*
> + * Before EDID 1.4 reduced blanking support is only guessed, so
> + * don't let the guess replace the timing the sink listed: keep
> + * the plain DMT mode if it is within the sink's range limits.
> + */
> + if (drm_edid->edid->revision < 4) {
> + mode = drm_mode_find_dmt(dev, hsize, vsize,
> + vrefresh_rate, false);
> + if (mode) {
> + if (std_dmt_mode_in_monitor_range(drm_edid, mode))
> + return mode;
> + drm_mode_destroy(dev, mode);
> + }
> + }
> +
> mode = drm_mode_find_dmt(dev, hsize, vsize, vrefresh_rate,
> true);
> if (mode)
[Severity: Low]
Does this path allocate, free, and re-allocate the same plain DMT mode
for standard timings that have no reduced-blanking DMT entry?
On an EDID < 1.4 digital sink without a range limits descriptor, a
timing like 1920x1080@60 allocates the plain mode here, walks all
detailed blocks, destroys it, finds no RB entry, and then calls
drm_mode_find_dmt() with rb = false a second time right below.
Splitting a static non-allocating DMT lookup helper out of
drm_mode_find_dmt() would let drm_mode_std() check for a competing RB
entry first, run std_dmt_mode_in_monitor_range() directly on the const
table entry, and call drm_mode_duplicate() once.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203170755.3958928-1-xiaolu.xie@intel.com?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/edid: Don't prefer reduced blanking for standard timings on EDID < 1.4
2026-12-03 17:07 [PATCH] drm/edid: Don't prefer reduced blanking for standard timings on EDID < 1.4 Eriksen Xie
2026-12-03 18:21 ` sashiko-bot
@ 2026-12-03 20:23 ` Jani Nikula
2026-12-04 2:34 ` Eriksen Xie
1 sibling, 1 reply; 4+ messages in thread
From: Jani Nikula @ 2026-12-03 20:23 UTC (permalink / raw)
To: Eriksen Xie, dri-devel
Cc: Ville Syrjälä, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, linux-kernel,
Eriksen Xie
On Fri, 04 Dec 2026, Eriksen Xie <xiaolu.xie@intel.com> wrote:
> drm_monitor_supports_rb() can only read the reduced blanking flag from
> the range limits descriptor on EDID 1.4. For older EDIDs it just assumes
> that every digital sink supports reduced blanking.
>
> drm_mode_std() uses that to prefer the reduced blanking variant of a
> standard timing. The preference was added by
> commit f6e252bac45c ("drm/edid: Allow drm_mode_find_dmt to hunt for reduced-blanking modes")
> and only took effect once
> commit 383a6d5fdd9a ("drm/edid: Add the reduced blanking DMT modes to the DMT list")
> added the RB entries to the DMT table.
>
> As a result a sink that lists, for example, 1920x1200@60 as a standard
> timing (DMT 0x45, 193.25 MHz) gets DMT 0x44 (154.0 MHz, RB) instead,
> even if its EDID is 1.3 with only GTF range limits and never claims RB
> support. 1680x1050@60 and 1280x800@60 are replaced the same way. A DELL
> P2715Q (EDID 1.3) is one such sink.
Please share the EDID. We might as well add the EDID in the commit
message.
BR,
Jani.
>
> Where the support is only a guess, keep the plain DMT mode if it is
> within the sink's range limits and only fall back to the reduced
> blanking mode when it is not, or when there is no range limits
> descriptor. That keeps RB for sinks that need it to fit their pixel
> clock limit. EDID 1.4 sinks that explicitly declare reduced blanking are
> unchanged.
>
> Signed-off-by: Eriksen Xie <xiaolu.xie@intel.com>
> ---
> drivers/gpu/drm/drm_edid.c | 54 ++++++++++++++++++++++++++++++++++++++
> 1 file changed, 54 insertions(+)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index b8f882a17..a657da8c5 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3402,6 +3402,45 @@ drm_gtf2_mode(struct drm_device *dev,
> return mode;
> }
>
> +static bool mode_in_range(const struct drm_display_mode *mode,
> + const struct drm_edid *drm_edid,
> + const struct detailed_timing *timing);
> +
> +struct std_dmt_range_closure {
> + const struct drm_display_mode *mode;
> + const struct drm_edid *drm_edid;
> + bool found;
> + bool in_range;
> +};
> +
> +static void std_dmt_in_range(const struct detailed_timing *timing, void *data)
> +{
> + struct std_dmt_range_closure *closure = data;
> +
> + if (!is_display_descriptor(timing, EDID_DETAIL_MONITOR_RANGE))
> + return;
> +
> + closure->found = true;
> + closure->in_range = mode_in_range(closure->mode, closure->drm_edid, timing);
> +}
> +
> +/*
> + * True only if the sink has a range limits descriptor and the plain
> + * (non-reduced-blanking) DMT mode is inside it.
> + */
> +static bool std_dmt_mode_in_monitor_range(const struct drm_edid *drm_edid,
> + const struct drm_display_mode *mode)
> +{
> + struct std_dmt_range_closure closure = {
> + .mode = mode,
> + .drm_edid = drm_edid,
> + };
> +
> + drm_for_each_detailed_block(drm_edid, std_dmt_in_range, &closure);
> +
> + return closure.found && closure.in_range;
> +}
> +
> /*
> * Take the standard timing params (in this case width, aspect, and refresh)
> * and convert them into a real mode using CVT/GTF/DMT.
> @@ -3473,6 +3512,21 @@ static struct drm_display_mode *drm_mode_std(struct drm_connector *connector,
>
> /* check whether it can be found in default mode table */
> if (drm_monitor_supports_rb(drm_edid)) {
> + /*
> + * Before EDID 1.4 reduced blanking support is only guessed, so
> + * don't let the guess replace the timing the sink listed: keep
> + * the plain DMT mode if it is within the sink's range limits.
> + */
> + if (drm_edid->edid->revision < 4) {
> + mode = drm_mode_find_dmt(dev, hsize, vsize,
> + vrefresh_rate, false);
> + if (mode) {
> + if (std_dmt_mode_in_monitor_range(drm_edid, mode))
> + return mode;
> + drm_mode_destroy(dev, mode);
> + }
> + }
> +
> mode = drm_mode_find_dmt(dev, hsize, vsize, vrefresh_rate,
> true);
> if (mode)
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] drm/edid: Don't prefer reduced blanking for standard timings on EDID < 1.4
2026-12-03 20:23 ` Jani Nikula
@ 2026-12-04 2:34 ` Eriksen Xie
0 siblings, 0 replies; 4+ messages in thread
From: Eriksen Xie @ 2026-12-04 2:34 UTC (permalink / raw)
To: Jani Nikula
Cc: dri-devel, Ville Syrjälä, Maarten Lankhorst,
Maxime Ripard, Thomas Zimmermann, Eriksen Xie
On Thu, 03 Dec 2026, Jani Nikula <jani.nikula@intel.com> wrote:
> Please share the EDID. We might as well add the EDID in the commit
> message.
Sure. This is the EDID of the DELL P2715Q (EDID 1.3, standard timings
include DMT 0x45 1920x1200@60, GTF range limits 29-75 Hz V, 31-140 kHz H,
max dotclock 600 MHz, no reduced blanking flag):
00 ff ff ff ff ff ff 00 10 ac ce 40 4c 35 33 32
1d 1b 01 03 80 3c 22 78 ea ee 95 a3 54 4c 99 26
0f 50 54 a5 4b 00 d1 00 d1 c0 b3 00 a9 40 81 80
81 00 71 4f 01 01 b8 ce 00 50 f0 70 5a 80 18 10
8a 00 55 50 21 00 00 1e 00 00 00 ff 00 34 30 46
48 46 37 37 48 32 33 35 4c 0a 00 00 00 fc 00 44
45 4c 4c 20 50 32 37 31 35 51 0a 20 00 00 00 fd
00 1d 4b 1f 8c 3c 00 0a 20 20 20 20 20 20 01 ff
02 03 3b f1 55 61 60 5f 5e 5d 10 1f 20 05 14 04
13 12 11 03 02 16 15 07 06 01 23 09 1f 07 83 01
00 00 6d 03 0c 00 10 00 00 3c 20 00 60 03 02 01
67 d8 5d c4 01 78 c8 00 e2 0f 03 08 e8 00 30 f2
70 5a 80 b0 58 8a 00 55 50 21 00 00 1e 04 74 00
30 f2 70 5a 80 b0 58 8a 00 55 50 21 00 00 1e 02
3a 80 18 71 38 2d 40 58 2c 45 00 55 50 21 00 00
1e 00 00 00 00 00 00 00 00 00 00 00 00 00 00 43
Feel free to add it to the commit message when applying.
BR,
Eriksen
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-12-04 2:37 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 17:07 [PATCH] drm/edid: Don't prefer reduced blanking for standard timings on EDID < 1.4 Eriksen Xie
2026-12-03 18:21 ` sashiko-bot
2026-12-03 20:23 ` Jani Nikula
2026-12-04 2:34 ` Eriksen Xie
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.