AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] drm/amd/display: Rebuild the VRR vtotal limits on a modeset
@ 2026-11-26  5:36 Matthew Schwartz
  2026-11-26  5:36 ` [PATCH 1/2] " Matthew Schwartz
  2026-11-26  5:36 ` [PATCH 2/2] drm/amd/display: Test VRR vtotal limits across " Matthew Schwartz
  0 siblings, 2 replies; 4+ messages in thread
From: Matthew Schwartz @ 2026-11-26  5:36 UTC (permalink / raw)
  To: amd-gfx
  Cc: Harry Wentland, Leo Li, Rodrigo Siqueira, Alex Deucher,
	Ivan Lipski, Fangzhi Zuo, Aurabindo Pillai, Pei-Hsin Yang,
	Matthew Schwartz

A modeset between two modes with the same refresh rate keeps the
previous mode's v_total_min/max when VRR stays enabled across it, since
mod_freesync_build_vrr_params() only rebuilds them when the VRR state or
refresh range changes. Commit 33c995709121 handled this for the inactive
state. With VRR active and no BTR, the old limits stay in use for as
long as the client keeps flipping at the refresh rate.

This came up with gamescope, which keeps VRR_ENABLED set across mode
changes and, with its adaptive_sync_idle_hold option, presents on every
vblank while the Steam UI is focused. Switching from 1080p60 to 4K60 in
Steam's display settings then gave no picture on a number of HDMI
displays, a Dell S2721QS (40-60 Hz) and an LG CX among them. In the
Dell's log the atomic commit intervals after the switch were 8.3 ms,
12.5 ms and 20.8 ms. Those are 1125, 1687 and 1125 + 1687 lines of the
4K timing, the 1080p limits for 60 and 40 Hz. Without the hold the idle
UI flips slowly enough to reach the fixed refresh path, which rebuilds
the limits, so the problem stayed hidden.

Tested on an ASUS ROG Xbox Ally X20 (internal panel, 30-120 Hz) with a
7.3.1-based kernel and a small KMS test. It sets two 50 Hz modes with
vtotals of 2764 and 2592, turns VRR on in the first and flips at full
rate across a modeset to the second. Without patch 1 the second mode
flips every 21.33 ms, which is the first mode's v_total_min, until VRR
is toggled. With it the interval is 20.1 ms.

Patch 1 clears the saved VRR params on a modeset so they are rebuilt
from the new stream. Patch 2 adds KUnit cases for it.

Matthew Schwartz (2):
  drm/amd/display: Rebuild the VRR vtotal limits on a modeset
  drm/amd/display: Test VRR vtotal limits across a modeset

 .../display/amdgpu_dm/amdgpu_dm_freesync.c    | 10 ++++
 .../amdgpu_dm/tests/amdgpu_dm_freesync_test.c | 52 +++++++++++++++++++
 2 files changed, 62 insertions(+)


base-commit: da37959f4a22c6bb25a337fcc7946101c8a10f7b
-- 
2.54.0 (Apple Git-157)


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

end of thread, other threads:[~2026-11-26  8:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-26  5:36 [PATCH 0/2] drm/amd/display: Rebuild the VRR vtotal limits on a modeset Matthew Schwartz
2026-11-26  5:36 ` [PATCH 1/2] " Matthew Schwartz
2026-11-26  8:26   ` sashiko-bot
2026-11-26  5:36 ` [PATCH 2/2] drm/amd/display: Test VRR vtotal limits across " Matthew Schwartz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox