atomic: use sequence_handler and drmEventcontext version 4#236
Draft
gulafaran wants to merge 2 commits into
Draft
atomic: use sequence_handler and drmEventcontext version 4#236gulafaran wants to merge 2 commits into
gulafaran wants to merge 2 commits into
Conversation
vaxerski
reviewed
Feb 5, 2026
| .version = 3, | ||
| .version = 4, | ||
| .page_flip_handler2 = ::handlePF, | ||
| .sequence_handler = ::handleCRTCSequence, |
Member
There was a problem hiding this comment.
what if drm doesn't support version 4? We should check this somewhere
Contributor
Author
There was a problem hiding this comment.
its behind a #if #endif check now which technically shouldnt be needed, but who knows what bsd ships so oh well doesnt hurt. the getcrtc will fail if driver doesnt support this, so its never queued and never triggered. and it goes the pageflip path.
use CRTC Sequence handler if we can, poll the current sequence drmCrtcGetSequence and if it succeeds, try queue the next one if we can or fallback to the old pageflip handler. by using crtc sequences we are allowed a much higher resolution timestamp and get much more correct timestamps for our presentation events that is not rounded away. will reduce jitters and drifting in timestamps and get us lower latencies.
make the pageflips be the one that drives the frames if we can, instead of always relying on returning early and waiting for dispatching idle, it makes the start of each frame wait an large amount of time. do this by adding a isFrameRunning and dont schedule an idle frame if set.
Contributor
Author
|
sadly looks like nvidia doesnt support this anyways :( |
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.
use CRTC Sequence handler if we can, poll the current sequence drmCrtcGetSequence and if it succeeds, try queue the next one if we can or fallback to the old pageflip handler.
by using crtc sequences we are allowed a much higher resolution timestamp and get much more correct timestamps for our presentation events that is not rounded away.
will reduce jitters and drifting in timestamps and get us lower latencies.