PRESENT-NG (v4) - #145
Draft
notbabaisyou wants to merge 15 commits into
Draft
Conversation
No functional change, for now.
Move flip_pending, flip_active and unflip_event_id from per-Screen to per-CRTC present_crtc_priv. Replace global present_exec_queue and present_flip_queue with a per-CRTC exec_queue and flip_queue.
Add BlockHandler hook to present_screen_priv and wrap screen BlockHandler in present_screen_priv_init. Add stub present_scmd_block_handler that chains to saved handler. No functional change.
Move scheduling to per-Screen BlockHandler. Add present_scmd_replace_queued_per_crtc and present_scmd_block_handler that for each CRTC does exclusive coalescing, checks fence and flip state, arms vblank or executes when ready. Make present_scmd_pixmap enqueue-only.
Use QueueWorkProc to wake BlockHandler for wait fences, syncobj and vblank events. Keep flip completion immediate.
Merge per-CRTC exec and flip queues into a single queue with bypass for blocked flips. Keep TearFree guard and fake queue global.
Enqueue was not waking server, so first frame with exec_msc <= crtc_msc never armed a vblank fd and stayed in poll. Queue work to run BlockHandler.
Call AdjustWaitForDelay 0 when no candidate due to fence or pending flip, so poll does not sleep with work queued.
Use RegisterBlockAndWakeupHandlers per Screen with data=ScreenPtr. Remove ScreenBlockHandler wrap. Keep single scan and non-NULL wakeup.
Schedule future presents via queue_vblank and bound poll when blocked. Keep single scan per CRTC.
Use WakeupHandler for immediate work (exec <= msc). BlockHandler schedules future via queue_vblank.
notbabaisyou
force-pushed
the
present-v4-internals
branch
from
September 10, 2026 09:37
443a1da to
6bedc6c
Compare
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.
Highly draft and experimental, won't be shipped until 27.1.