Commit graph

12 commits

Author SHA1 Message Date
Kenny Levinsen
b84aadb5c1 Add wlr_compositor_dmabuf_waiter
This helper monitors buffers for implicit and explicit work
synchronization, delaying the surface commit until the fences are ready
to be consumed for synchronization (i.e., fences have materialized), or
for the work to be complete, depending on the specified waiter mode.

Through this, the compositor can avoid stalling on incomplete work,
staying fully interactive until the buffer is ready to be sampled.

This is a generalization of Simon's patch that added a waiter for
traditional implicit sync.

Based-on-patch-by: Simon Ser <contact@emersion.fr>
2026-04-07 17:48:58 +02:00
Simon Ser
a1ed6fca52 render/drm_syncobj: fix flags docs for wlr_drm_syncobj_timeline_waiter_init()
wlr_drm_syncobj_timeline_check() is a bit different because zero
will error out if the point has not materialized yet.

Kernel docs for struct drm_syncobj_eventfd:
https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#c.drm_syncobj_eventfd
2026-03-27 18:02:46 +00:00
Félix Poisot
0af9b9d003 render/drm_syncobj: add wlr_drm_syncobj_timeline_signal() 2026-03-17 18:13:10 +00:00
Alexander Orzechowski
c1eb053f5e render/drm_syncobj: Remove the ready signal from timeline_waiter
It's unused.
2025-01-26 18:02:14 -05:00
Alexander Orzechowski
82223e451a render/drm_syncobj: Add a callback when ready
The old approach of using a signal is fundamentally broken for a common
usecase: When the waiter is ready, it's common to immediately finish and
free any resources associated with it.
Because of the semantics of wl_signal_emit_mutable() this is UB.
wl_signal_emit_mutable() always excepts that the waiter hasn't been freed
until the signal has finished being emitted.

Instead of over engineering the solution, let's just add a callback required
by wlr_drm_syncobj_timeline_waiter_init(). In this callback, the implementation
is free to finish() or free() any resource it likes.
2025-01-26 18:02:05 -05:00
Simon Ser
ca29f43a54 render/drm_syncobj: add addon set 2024-11-11 15:22:22 +00:00
Kirill Primak
6006023a37 Use WLR_PRIVATE for private fields 2024-10-25 07:51:51 +03:00
Simon Ser
edb867bc05 render/drm_syncobj: add wlr_drm_syncobj_timeline_export() 2024-08-06 17:37:06 +00:00
Simon Ser
5552de65f8 render/drm_syncobj: add wlr_drm_syncobj_timeline_transfer() 2024-08-06 17:37:06 +00:00
Simon Ser
d9bfb47648 render/drm_syncobj: add helpers to wait for timeline points
References: https://patchwork.freedesktop.org/patch/506761/
2024-06-12 18:39:45 +02:00
Simon Ser
ea75aa3065 render/drm_syncobj: add wlr_drm_syncobj_timeline_import() 2024-06-12 18:38:42 +02:00
Simon Ser
7fc00ef777 render/drm_syncobj: introduce wlr_drm_syncobj_timeline
wlr_drm_syncobj_timeline is a synchronization primitive based on
drm_syncobj timelines. They are heavily inspired from Vulkan
timeline semaphores [1].

[1]: https://www.khronos.org/blog/vulkan-timeline-semaphores
2024-06-12 17:45:06 +02:00