Allow tearing with an overlay up (again) - #2284
Draft
matte-schwartz wants to merge 3 commits into
Draft
Conversation
gamescope set DRM_MODE_PAGE_FLIP_ASYNC before liftoff built the request, and liftoff passes the flags straight through to its own test commits. An async flip may only change FB_ID, so every frame that reassigns planes emits CRTC_ID and color changes that the kernel rejects. liftoff then reports that it needs composition, and we cache that layout as impossible and never retry it, even on later synchronous frames. Let liftoff search with synchronous flags instead, and probe the finished request with a test-only async commit. We tear only when the kernel accepts the request as a pure flip, and commit synchronously for that frame otherwise. liftoff has no notion of async-capable allocations, so a layout that is only valid synchronously now scans out without tearing rather than falling back to composition.
The convar zeroed nIgnoredOverlayRepaints at the top of every loop iteration, before any of the flip paths could read it, so it also disabled the escalation that stops an overlay repaint from starving behind a game that has stopped submitting frames while tearing. Honour the convar where the adaptive sync path reads the counter instead. The adaptive sync path already guards its own increment the same way, so its behaviour is unchanged, and the counter now survives for the other flip paths.
Tearing was disabled whenever an overlay was up, because the async flag made liftoff fail to find a plane allocation and fall back to composition, which stuttered. The DRM backend now probes async flips after liftoff has built the request, so an overlay no longer costs us the allocation and we can keep tearing while one is visible. An overlay repaint that the game does not follow with a frame of its own still forces a synchronous flip through nIgnoredOverlayRepaints, so overlay updates cannot be starved. Set tearing_ignore_overlay to 0 to get the old behaviour back.
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.
Pending further on-device testing.