From: Joonbum Ko Date: Thu, 9 Apr 2020 07:19:17 +0000 (+0900) Subject: [explicit_sync] Implemented to set acquire fence to wl_surface. X-Git-Tag: submit/tizen/20200810.080631~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dbede8e9eba44be114e442241ee1614dc6f5adfb;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git [explicit_sync] Implemented to set acquire fence to wl_surface. - acquire_fence is set only when use_surface_sync is TPL_TRUE. Otherwise, wait for sync_fd to be signaled in twe_thread. Change-Id: Ib778b5fe81710fa136ca330539e59d2085263b95 Signed-off-by: Joonbum Ko --- diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index de98abe..fbdc44b 100755 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -2503,11 +2503,20 @@ _twe_thread_wl_surface_dispatch(GSource *source, GSourceFunc cb, gpointer data) int sync_fd = surf_source->sync_info.sync_fd; tbm_surface_h tbm_surface = surf_source->sync_info.tbm_surface; - res = _twe_thread_fence_wait_source_attach(surf_source, tbm_surface, sync_fd); - if (res != TPL_ERROR_NONE) { - TPL_ERR("Failed to attach source with fence_fd(%d) ret(%d)", - sync_fd, res); - surf_source->use_sync_fence = TPL_FALSE; + if (surf_source->use_surface_sync) { + zwp_linux_surface_synchronization_v1_set_acquire_fence( + surf_source->surface_sync, sync_fd); + close(sync_fd); + } else { + ret = _twe_thread_fence_wait_source_attach(surf_source, tbm_surface, sync_fd); + if (ret != TPL_ERROR_NONE) { + TPL_ERR("Failed to attach source with fence_fd(%d) ret(%d)", + sync_fd, ret); + surf_source->use_sync_fence = TPL_FALSE; + return ret; + } + + surf_source->use_sync_fence = TPL_TRUE; } surf_source->sync_info.sync_fd = -1;