Documentation for <wlr/types/wlr_linux_drm_syncobj_v1.h>

Back to index

Table of contents

struct wlr_linux_drm_syncobj_manager_v1

struct wlr_linux_drm_syncobj_manager_v1 {
	struct wl_global *global;
	
	struct {
		int drm_fd;
		
		struct wl_listener display_destroy;
	} WLR_PRIVATE;
};

wlr_linux_drm_syncobj_manager_v1_create()

struct wlr_linux_drm_syncobj_manager_v1 *wlr_linux_drm_syncobj_manager_v1_create(​struct wl_display *display, uint32_t version, int drm_fd);

Advertise explicit synchronization support to clients.

The compositor must be prepared to handle fences coming from clients and to send release fences correctly. In particular, both the renderer and the backend need to support explicit synchronization.

struct wlr_linux_drm_syncobj_surface_v1_state

struct wlr_linux_drm_syncobj_surface_v1_state {
	struct wlr_drm_syncobj_timeline *acquire_timeline;
	uint64_t acquire_point;
	
	struct {
		bool committed;
		struct wlr_drm_syncobj_timeline *release_timeline;
		uint64_t release_point;
		struct wlr_drm_syncobj_merger *release_merger;
	} WLR_PRIVATE;
};

wlr_linux_drm_syncobj_v1_get_surface_state()

struct wlr_linux_drm_syncobj_surface_v1_state *wlr_linux_drm_syncobj_v1_get_surface_state(​struct wlr_surface *surface);

wlr_linux_drm_syncobj_v1_state_add_release_from_implicit_sync()

bool wlr_linux_drm_syncobj_v1_state_add_release_from_implicit_sync(​struct wlr_linux_drm_syncobj_surface_v1_state *state, struct wlr_buffer *buffer, struct wl_event_loop *event_loop);

Register the DMA-BUF release of a buffer for buffer usage. Non-dmabuf buffers are considered to be immediately available (no wait).

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 platform may not support DMA-BUF fence merges, a wl_event_loop must be supplied to schedule a wait internally, if needed

Waits for write access

wlr_linux_drm_syncobj_v1_state_add_release_point()

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);

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

wlr_linux_drm_syncobj_v1_state_signal_release_with_buffer()

bool wlr_linux_drm_syncobj_v1_state_signal_release_with_buffer(​struct wlr_linux_drm_syncobj_surface_v1_state *state, struct wlr_buffer *buffer);

Signal the release point when wlr_buffer.events.release is emitted.

Compositors unwilling to track fine-grained commit release can call this helper on surface commit.