All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/panel: anchor to highest vrefresh fixed mode without a VRR reference
@ 2026-12-02 12:35 cengjianeng
  2026-12-02 12:53 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: cengjianeng @ 2026-12-02 12:35 UTC (permalink / raw)
  To: intel-gfx
  Cc: jani.nikula, rodrigo.vivi, joonas.lahtinen, tursulin, airlied,
	simona, linux-kernel, Jianeng Ceng

From: Jianeng Ceng <cengjianeng@huaqin.corp-partner.google.com>

intel_panel_fixed_mode_vrr() picks the fixed mode whose vrefresh is
closest to the requested one. When the pipe is newly enabled, or when a
seamless update has no compatible reference mode, there is no
vrr_ref_mode to constrain the choice, and the closest-vrefresh pick
happens to select a fixed mode from a different pixel clock family on
panels with non-VRR-compatible fixed modes. The pipe is then anchored on
that lower clock family.

Since VRR can only extend the vblank to lower the effective refresh
rate, a later seamless switch to a higher vrefresh cannot be done from
that anchor: the pixel clock differs, so the switch requires a full
modeset and the panel blinks.

Instead, when there is no vrr_ref_mode, anchor on the highest vrefresh
fixed mode of the requested resolution, so that every lower refresh rate
stays in the same clock family and can be reached by stretching the
vblank. The seamless switch to the higher refresh rate then no longer
needs a full modeset.

Signed-off-by: Jianeng Ceng <cengjianeng@huaqin.corp-partner.google.com>
---
 drivers/gpu/drm/i915/display/intel_panel.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c
index 81e638d0c7b3..3a6ed5c5a8d8 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;
+
+			if (!best_mode || fixed_mode_vrefresh >
+			    drm_mode_vrefresh(best_mode))
+				best_mode = fixed_mode;
+
+			continue;
+		}
+
 		if (is_best_fixed_mode(connector, vrefresh,
 				       fixed_mode_vrefresh, best_mode))
 			best_mode = fixed_mode;
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-12-02 12:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.