From: sashiko-bot@kernel.org
To: cengjianeng <cengjianeng@huaqin.corp-partner.google.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/panel: anchor to highest vrefresh fixed mode without a VRR reference
Date: Wed, 02 Dec 2026 12:53:08 +0000 [thread overview]
Message-ID: <sashiko-outbox-245812@kernel.org> (raw)
In-Reply-To: <20261202123523.1181723-1-cengjianeng@huaqin.corp-partner.google.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] drm/i915/panel: resolution check in
intel_panel_fixed_mode_vrr() breaks pfit
- [Medium] drm/i915/panel: highest-vrefresh pick in
intel_panel_fixed_mode_vrr() issues
--
commit d8dd1559a8bbd09428dc3a244bd9e5fd5dc86f8d
Author: Jianeng Ceng <cengjianeng@huaqin.corp-partner.google.com>
drm/i915/panel: anchor to highest vrefresh fixed mode without a VRR reference
This commit updates intel_panel_fixed_mode_vrr() to select the highest
vrefresh fixed mode of the requested resolution when vrr_ref_mode is NULL.
> diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c
> index 81e638d0c7b33..3a6ed5c5a8d8a 100644
> --- a/drivers/gpu/drm/i915/display/intel_panel.c
> +++ b/drivers/gpu/drm/i915/display/intel_panel.c
> @@ -115,6 +115,27 @@ intel_panel_fixed_mode_vrr(struct intel_connector *connector,
> !is_vrr_compatible(fixed_mode, vrr_ref_mode))
> continue;
>
> + /*
> + * Without a vrr_ref_mode (pipe newly enabled, or a seamless
> + * update without a compatible reference) always anchor at the
> + * highest vrefresh mode of the requested resolution. VRR can
> + * only stretch the vblank down, so picking the closest mode
> + * would anchor the pipe to a lower clock family, and a
> + * subsequent seamless switch to a higher vrefresh would need a
> + * full modeset and blink the panel.
> + */
> + if (!vrr_ref_mode) {
> + if (fixed_mode->hdisplay != mode->hdisplay ||
> + fixed_mode->vdisplay != mode->vdisplay)
> + continue;
[Severity: High]
Won't comparing fixed_mode against mode->hdisplay and mode->vdisplay reject
every entry in connector->panel.fixed_modes when userspace requests a
non-native resolution to be scaled by the panel fitter?
is_alt_fixed_mode() only adds fixed modes matching the preferred mode's
native hdisplay and vdisplay, and intel_panel_compute_config() runs before
intel_pfit_compute_config() to replace the requested mode in adjusted_mode
with a native panel fixed mode. With this check, any non-native scaled
mode causes intel_panel_fixed_mode_vrr() to return NULL and fall back to
intel_panel_compute_config_fixed_rr(), which fails with -EINVAL whenever
the requested refresh rate is more than 1 Hz away from a fixed mode (and
otherwise picks the closest-vrefresh fixed mode without VRR vtotal
adjustment).
> +
> + if (!best_mode || fixed_mode_vrefresh >
> + drm_mode_vrefresh(best_mode))
> + best_mode = fixed_mode;
> +
> + continue;
> + }
[Severity: Medium]
In intel_panel_compute_config_vrr(), vrr_ref_mode is NULL on every commit
with state->base.allow_modeset == true as well as on the !allow_modeset
fallback. Does unconditionally picking the highest-vrefresh fixed mode
whenever vrr_ref_mode is NULL cause several unintended regressions?
First, commit 4a2bdf0c87c7 ("drm/i915/panel: Attempt VRR based refresh rate
change for !allow_modeset") kept closest-vrefresh selection when
allow_modeset is true so lower-clock fixed modes can be used to save power;
always anchoring to the highest-vrefresh mode makes lower-clock fixed modes
in the VRR range unreachable, and breaks fastboot takeover if BIOS booted
the panel in a lower-clock fixed mode.
Second, on panels with VRR-compatible fixed modes sharing the same clock,
an allow_modeset=true commit at a lower refresh rate will synthesize vtotal
from the integer vrefresh of the highest-vrefresh mode, whereas a later
allow_modeset=false commit (where vrr_ref_mode is non-NULL) picks the exact
lower-vrefresh EDID fixed mode via is_best_fixed_mode(). When a
!allow_modeset commit has no compatible reference and falls back to
vrr_ref_mode == NULL, switching to a different clock family still fails
intel_pipe_config_compare() and returns -EINVAL.
Third, intel_panel_mode_valid() validates target_clock against
intel_panel_fixed_mode() (closest vrefresh), so intel_panel_fixed_mode_vrr()
can now pick a highest-vrefresh fixed mode whose clock was not validated for
the requested mode and exceeds link or dotclock limits.
Finally, because intel_vrr_compute_guardband() clamps vrr.guardband to
intel_vrr_max_guardband() (which shrinks with a shorter vblank at the
highest refresh rate) and intel_pipe_config_compare() checks vrr.guardband
on fastset, anchoring at the highest-vrefresh fixed mode still requires a
full modeset when switching to the highest refresh rate whenever
vrr.guardband changes.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261202123523.1181723-1-cengjianeng@huaqin.corp-partner.google.com?part=1
prev parent reply other threads:[~2026-12-02 12:53 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 12:35 [PATCH] drm/i915/panel: anchor to highest vrefresh fixed mode without a VRR reference cengjianeng
2026-12-02 12:53 ` sashiko-bot [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=sashiko-outbox-245812@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=cengjianeng@huaqin.corp-partner.google.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 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.