Repository navigation
Report the panel's active refresh rate to the gndrm daemon - #22
Closed
utkarshdalal wants to merge 1 commit into
Closed
utkarshdalal wants to merge 1 commit into
utkarshdalal wants to merge 1 commit into
Conversation
… on display changes
utkarshdalal
force-pushed
the
gamescope-active-panel-refresh
branch
from
October 30, 2026 12:14
06ee822 to
9ab5836
Compare
Collaborator
Author
|
Moved to a standalone PR on utkarshdalal/GameNative master, since it does not depend on the scan-out-size work. |
joshuatam
pushed a commit
that referenced
this pull request
Oct 31, 2026
…im gate census (utkarshdalal#2297) * Gamescope payload 20261031.1 (test): FPS limiter on the vblank time grid Payload 20261030.3 with bin/gamescope replaced by the CI build of GameNative/gamescope PR #22 (A52, merge commit 8636e40 of b46a355); everything else byte-identical. Gamescope's non-VRR FPS limiter counted compositor wakeups on the 1200 Hz session grid, and a wakeup more than one tick late skipped ticks that were never counted, so a 60 cap read 54 on the Retroid Pocket 6 with the CPU and GPU idle. The limiter now releases frames on a time grid (previous release plus the target period): 60.0 fps at a 60 cap on the same device. sha256 2b8998691633dc2de3256f9bc24fb937633e564105e19f32d5d62ec5e4fed148 * Gamescope payload 20261031.2: FPS limiter on the vblank time grid, shim gate census Payload 20261030.3 with bin/gamescope from GameNative/gamescope ad78177 (A52, merged #22; byte-identical to the #22 CI build, same tree) and lib/libadrenotools_gamescope.so from GameNative/gamenative-drm 52ed43f (merged #35: VK_KHR_xcb_surface served, acquire-gate census); everything else byte-identical. sha256 fd3deaaee7560ef3ce53303a13eb77be31c4473cd26ea17771bd925d07d3347d --------- Co-authored-by: Utkarsh Dalal <utkarsh.dalal@toptal.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this fixes
Under gamescope the daemon measures the panel's latch grid (
vsync.rs) against the refresh rate the app reports throughGameNativeDrm.nativeSetPanelRefreshHz. The app reporteddetectMaxRefreshRateHz, the fastest mode the panel supports, so on a panel a user holds at 60 Hz the daemon tracked a 120 Hz lattice and told the shims the latch period was 8.33 ms. The gamescope frame-rate limit is about to place its releases on that grid (GameNative/gamescope#21 A52, GameNative/gamenative-drm#33): with the wrong period it snaps to points that are not latch points, and commits land on the edge of the real window. Measured on the Odin 3 (panel at 60 Hz, maximum 120): the ICD loggedpanel grid period=8333us, and the capped session lost more frames at the latch than before.The change
detectActiveRefreshRateHz: the display's current mode (Display.refreshRate), falling back to the maximum only when it cannot be read.nativeStart, and registers aDisplayManager.DisplayListenerthat reports it again ononDisplayChanged, so a mode switch mid-session (a user toggling 60/120, a game-mode profile) reaches the daemon. The listener is unregistered at session exit, just beforenativeStop.detectMaxRefreshRateHzstays for the limiter's ceiling and the emulated mode's rate elsewhere.Verification
:app:compileModernDebugKotlinpasses.Stacked on utkarshdalal#2283 (base branch
fix/gamescope-resolution-scanout).