From: Jani Nikula <jani.nikula@intel.com>
To: Eriksen Xie <xiaolu.xie@intel.com>, dri-devel@lists.freedesktop.org
Cc: "Ville Syrjälä" <ville.syrjala@linux.intel.com>,
"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>,
linux-kernel@vger.kernel.org,
"Eriksen Xie" <xiaolu.xie@intel.com>
Subject: Re: [PATCH] drm/edid: Don't prefer reduced blanking for standard timings on EDID < 1.4
Date: Thu, 03 Dec 2026 22:23:52 +0200 [thread overview]
Message-ID: <59a45731615cc6b5b521625f88fed44d6c4758e7@intel.com> (raw)
In-Reply-To: <20261203170755.3958928-1-xiaolu.xie@intel.com>
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
prev parent reply other threads:[~2026-12-03 20:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 17:07 Eriksen Xie
2026-12-03 20:23 ` Jani Nikula [this message]
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=59a45731615cc6b5b521625f88fed44d6c4758e7@intel.com \
--to=jani.nikula@intel.com \
--cc=airlied@gmail.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=simona@ffwll.ch \
--cc=tzimmermann@suse.de \
--cc=ville.syrjala@linux.intel.com \
--cc=xiaolu.xie@intel.com \
/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®