mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-02-10 04:27:51 -05:00
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.
This commit is contained in:
parent
211eb9d60e
commit
82223e451a
5 changed files with 21 additions and 19 deletions
|
|
@ -64,7 +64,6 @@ struct wlr_wl_buffer {
|
|||
|
||||
bool has_drm_syncobj_waiter;
|
||||
struct wlr_drm_syncobj_timeline_waiter drm_syncobj_waiter;
|
||||
struct wl_listener drm_syncobj_ready;
|
||||
|
||||
struct wlr_drm_syncobj_timeline *fallback_signal_timeline;
|
||||
uint64_t fallback_signal_point;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue