app_server: stop dropping damage when a page flip is refused - #222
Open
schotek wants to merge 1 commit into
Open
app_server: stop dropping damage when a page flip is refused#222schotek wants to merge 1 commit into
schotek wants to merge 1 commit into
Conversation
On two laptops with integrated Intel graphics (Surface Book 2, Dell XPS 17) parts of the UI - and seemingly random rectangles of the screen - flickered between old and new content. QEMU is unaffected: its virtual scanout accepts page flips at any time, while real hardware paced by vsync routinely refuses them. Verified fixed on both machines. Three cooperating defects in the DRM flip path: * A refused drmModePageFlip/_AtomicFlip (EBUSY while the CRTC is busy is routine) threw the accumulated damage away. The pixels had already been blitted into one buffer but never reached the other, so that region kept alternating between stale and fresh content on every subsequent flip. The damage is now kept and the flip retried on the next event-loop pass. * Damage that arrived while a flip was in flight was copied into the buffer that had just left the screen, and nothing scheduled a follow-up flip - the update stayed invisible until unrelated damage came along. fNeedsFlip makes the completion handler ask for it. * The completion handler cleared fPageFlipPending before swapping the buffer pointers. In that window CopyBackToFront() took the "no flip in flight" path and blitted into the buffer the CRTC had just started scanning out. Swap first, clear the flag after.
This was referenced Aug 10, 2026
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.
Fixes #219.
Three defects in the DRM flip path made parts of the UI flicker on integrated Intel graphics (verified on a Surface Book 2 and a Dell XPS 17). QEMU is unaffected — its virtual scanout accepts flips at any time, real hardware paced by vsync refuses them routinely.
fPageFlipPendingbefore swapping the buffer pointersReproduced on
843b7eabtoday, fixed on both machines with this change, no regression under QEMU.