backend/drm: async page flip (tearing) support for DrmSurface/DrmCompositor - #2099
Closed
s0kil wants to merge 6 commits into
Closed
backend/drm: async page flip (tearing) support for DrmSurface/DrmCompositor#2099s0kil wants to merge 6 commits into
s0kil wants to merge 6 commits into
Conversation
Author
|
Consumer implementing wp_tearing_control_v1 on top of this: pop-os/cosmic-comp#2588 (validation details there). |
Member
|
I suggest cooperating on the existing approaches on implementing this feature: Additionally you completely ignored the PR template and the whole thing looks very AI-generated. |
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.
What
Adds async page flip (tearing) support to the DRM backend:
DrmSurface::page_flip(planes, event, async_flip)— whenasync_flipis true on an atomic surface, the commit carriesDRM_MODE_PAGE_FLIP_ASYNC(presented immediately, no vblank wait). Legacy surfaces currently ignore the flag (documented).FrameFlags::ALLOW_ASYNC_PAGE_FLIP+DrmCompositor::queue_frame_with_flags(user_data, flags)— async intent is scoped to the specific queued frame (carried inQueuedFrame, so deferred submits and interleaved plainqueue_framecalls can never inherit a stale flag).The existing
queue_frameAPI and all default paths are behavior-identical (flag threading only,falseeverywhere).Why
Compositors need this to implement
wp_tearing_control_v1. Smithay currently offers no path toDRM_MODE_PAGE_FLIP_ASYNC—NONBLOCKcommits are still vblank-aligned.Validation
Consumed by a cosmic-comp branch implementing tearing-control (PR linked in comments). End-to-end on real hardware (i915 eDP scanout, kernel 7.x,
DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP=1): fullscreen Vulkan client at 240fps on a 144Hz panel with visible tearing, zero rejected flips over extended play; with the feature unused, behavior is byte-identical to before (verified by review of the flag paths and by an unmodified consumer compiling and running unchanged).Open questions (draft status)
DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP; today that costs one rejected ioctl + sync retry per frame. ShouldDrmSurface/DrmCompositorexpose the cap (and/or refuse early)?queue_frame_with_flagsaccepts fullFrameFlagsbut only honorsALLOW_ASYNC_PAGE_FLIP— happy to reshape (dedicated parameter/type) to taste.wp_presentationfeedback still reportsKind::Vsyncfor async-flipped frames; fixing that properly probably belongs in this PR's scope — guidance welcome.PAGE_FLIP_ASYNC; currently ignored on the legacy path. Support or hard error?Implementation was developed with AI assistance and human review/testing on real hardware; happy to iterate per maintainer direction.