mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
linux-explicit-synchronization-v1: extract fence from DMA-BUF
This commit is contained in:
parent
384f2249c7
commit
785549bc3e
1 changed files with 12 additions and 5 deletions
|
|
@ -327,15 +327,22 @@ bool wlr_linux_explicit_synchronization_v1_signal_surface_timeline(
|
|||
uint64_t dst_point) {
|
||||
struct wlr_linux_surface_synchronization_v1 *surface_sync =
|
||||
surface_sync_from_surface(explicit_sync, surface);
|
||||
if (!surface_sync) {
|
||||
// TODO: fallback to DMA-BUF fence export
|
||||
return false;
|
||||
}
|
||||
|
||||
if (surface_sync) {
|
||||
return wlr_render_timeline_import_sync_file(timeline, dst_point,
|
||||
surface_sync->current.acquire_fence_fd);
|
||||
}
|
||||
|
||||
// Client doesn't support explicit sync, try to extract the fence from the
|
||||
// DMA-BUF
|
||||
struct wlr_dmabuf_attributes dmabuf;
|
||||
if (surface->buffer == NULL ||
|
||||
!wlr_buffer_get_dmabuf(&surface->buffer->base, &dmabuf)) {
|
||||
return false;
|
||||
}
|
||||
return wlr_render_timeline_import_dmabuf(timeline, dst_point,
|
||||
dmabuf.fd[0]);
|
||||
}
|
||||
|
||||
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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue