This repository was archived by the owner on Nov 1, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -327,13 +327,20 @@ bool wlr_linux_explicit_synchronization_v1_signal_surface_timeline(
327
327
uint64_t dst_point ) {
328
328
struct wlr_linux_surface_synchronization_v1 * surface_sync =
329
329
surface_sync_from_surface (explicit_sync , surface );
330
- if (! surface_sync ) {
331
- // TODO: fallback to DMA-BUF fence export
332
- return false ;
330
+ if (surface_sync ) {
331
+ return wlr_render_timeline_import_sync_file ( timeline , dst_point ,
332
+ surface_sync -> current . acquire_fence_fd ) ;
333
333
}
334
334
335
- return wlr_render_timeline_import_sync_file (timeline , dst_point ,
336
- surface_sync -> current .acquire_fence_fd );
335
+ // Client doesn't support explicit sync, try to extract the fence from the
336
+ // DMA-BUF
337
+ struct wlr_dmabuf_attributes dmabuf ;
338
+ if (surface -> buffer == NULL ||
339
+ !wlr_buffer_get_dmabuf (& surface -> buffer -> base , & dmabuf )) {
340
+ return false;
341
+ }
342
+ return wlr_render_timeline_import_dmabuf (timeline , dst_point ,
343
+ dmabuf .fd [0 ]);
337
344
}
338
345
339
346
bool wlr_linux_explicit_synchronization_v1_wait_surface_timeline (
You can’t perform that action at this time.
0 commit comments