Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable atomic commits for DRM rendering #764

Closed
wants to merge 3 commits into from

Conversation

peyton-howe
Copy link

Signed-off: Peyton Howe [email protected]

@davidplowman
Copy link
Collaborator

Hi, thanks for this PR. Is is really just using commit_sync as opposed to commit that makes it work? I never would have guessed...!

One thing I wonder about is whether the code should be reorganised a bit so that the image and overlay are added to the same atomic commit? Presumably that's where the benefit would be, in that we'd only be waiting for one vsync for both as opposed to two. What do you think?

… commit

If the overlay and camera frame are in different atomic commits, then the overlay tends to update at a faster refresh rate, causing the camera feed to 'lag' behind. However, at lower camera framerates, the camera feed renders at the desired framerate, while the overlay updates faster. To remedy the conflicting refresh rates, make sure to only render the overlay with an accompanying camera frame.

Signed-off-by: Peyton Howe <[email protected]>
@peyton-howe
Copy link
Author

peyton-howe commented Aug 3, 2023

I was surprised that commit_sync worked while commit didn't as they both call drmAtomicModeCommit(). The only difference is that commit passes in the DRM_MODE_PAGE_FLIP_EVENT and DRM_MODE_ATOMIC_NONBLOCK flags, while commit_sync doesn't pass in any flags.

Using the same atomic commit for the image and the overlay is definitely the way to go, otherwise the overlay will update at a faster refresh rate than the camera feed.

@davidplowman
Copy link
Collaborator

We're proposing to replace this PR by #925, which should do the same thing.

@davidplowman
Copy link
Collaborator

Closing this as we've merged the "revised version". Hope that's all good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants