This repository has been archived by the owner on Nov 1, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
linux-explicit-synchronization-v1: new protocol implementation
This patch adds support for the linux-explicit-synchronization-unstable-v1 protocol. To test, run weston-simple-dmabuf-egl.
- Loading branch information
Showing
4 changed files
with
435 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
/* | ||
* This an unstable interface of wlroots. No guarantees are made regarding the | ||
* future consistency of this API. | ||
*/ | ||
#ifndef WLR_USE_UNSTABLE | ||
#error "Add -DWLR_USE_UNSTABLE to enable unstable wlroots features" | ||
#endif | ||
|
||
#ifndef WLR_TYPES_WLR_LINUX_EXPLICIT_SYNCHRONIZATION_H | ||
#define WLR_TYPES_WLR_LINUX_EXPLICIT_SYNCHRONIZATION_H | ||
|
||
#include <wayland-server-core.h> | ||
#include <wlr/util/addon.h> | ||
|
||
struct wlr_linux_surface_synchronization_v1_state { | ||
int acquire_fence_fd; | ||
struct wlr_linux_buffer_release_v1 *buffer_release; | ||
}; | ||
|
||
struct wlr_linux_surface_synchronization_v1 { | ||
struct wl_resource *resource; | ||
struct wlr_surface *surface; | ||
|
||
// private state | ||
|
||
struct wlr_addon addon; | ||
|
||
struct wlr_linux_surface_synchronization_v1_state pending, current; | ||
|
||
struct wl_listener surface_commit; | ||
}; | ||
|
||
struct wlr_linux_buffer_release_v1 { | ||
struct wl_resource *resource; | ||
}; | ||
|
||
struct wlr_linux_explicit_synchronization_v1 { | ||
struct wl_global *global; | ||
|
||
struct { | ||
struct wl_signal destroy; | ||
} events; | ||
|
||
// private state | ||
|
||
struct wl_listener display_destroy; | ||
}; | ||
|
||
/** | ||
* 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_explicit_synchronization_v1 * | ||
wlr_linux_explicit_synchronization_v1_create(struct wl_display *display); | ||
|
||
bool wlr_linux_explicit_synchronization_v1_signal_surface_timeline( | ||
struct wlr_linux_explicit_synchronization_v1 *explicit_sync, | ||
struct wlr_surface *surface, struct wlr_render_timeline *timeline, | ||
uint64_t dst_point); | ||
|
||
bool wlr_linux_explicit_synchronization_v1_wait_surface_timeline( | ||
struct wlr_linux_explicit_synchronization_v1 *explicit_sync, | ||
struct wlr_surface *surface, struct wlr_render_timeline *timeline, | ||
uint64_t src_point); | ||
|
||
#endif |
This file contains 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
This file contains 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
Oops, something went wrong.