linux_drm_syncobj_v1: add release point accumulation

This changes the behavior of wlr_linux_drm_syncobj_surface_v1 to
automatically signal release of previous commits as they are replaced.

Users must call wlr_linux_drm_syncobj_v1_state_add_release_point or
wlr_linux_drm_syncobj_v1_state_signal_release_with_buffer to delay the
signal as appropriate.
This commit is contained in:
Félix Poisot 2026-03-12 23:03:10 +00:00
parent e83a679e23
commit bfd6e619fc
2 changed files with 57 additions and 10 deletions

View file

@ -19,8 +19,11 @@ struct wlr_linux_drm_syncobj_surface_v1_state {
struct wlr_drm_syncobj_timeline *acquire_timeline;
uint64_t acquire_point;
struct wlr_drm_syncobj_timeline *release_timeline;
uint64_t release_point;
struct {
struct wlr_drm_syncobj_timeline *release_timeline;
uint64_t release_point;
struct wlr_drm_syncobj_merger *release_merger;
} WLR_PRIVATE;
};
struct wlr_linux_drm_syncobj_manager_v1 {
@ -55,4 +58,19 @@ struct wlr_linux_drm_syncobj_surface_v1_state *wlr_linux_drm_syncobj_v1_get_surf
bool wlr_linux_drm_syncobj_v1_state_signal_release_with_buffer(
struct wlr_linux_drm_syncobj_surface_v1_state *state, struct wlr_buffer *buffer);
/**
* Register a release point for buffer usage.
*
* This function may be called multiple times for the same commit. The client's
* release point will be signalled when all registered points are signalled, and
* a new buffer has been committed.
*
* Because the given release point may not be materialized, a wl_event_loop must
* be supplied to schedule a wait internally, if needed
*/
bool wlr_linux_drm_syncobj_v1_state_add_release_point(
struct wlr_linux_drm_syncobj_surface_v1_state *state,
struct wlr_drm_syncobj_timeline *release_timeline, uint64_t release_point,
struct wl_event_loop *event_loop);
#endif