From: Joonbum Ko Date: Fri, 27 Jan 2023 11:16:44 +0000 (+0900) Subject: wl_egl: Implement the backend function of fence_sync_is_available X-Git-Tag: accepted/tizen/unified/20230321.123222^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=375b62b16fa791832b95023cfc255a6f7021c385;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git wl_egl: Implement the backend function of fence_sync_is_available Change-Id: I7e6a6891ff12b6869e66cf3a2d5f64098b04cb94 Signed-off-by: Joonbum Ko --- diff --git a/src/tpl_wl_egl_thread.c b/src/tpl_wl_egl_thread.c index 681b8ac..032c9dc 100755 --- a/src/tpl_wl_egl_thread.c +++ b/src/tpl_wl_egl_thread.c @@ -152,6 +152,7 @@ struct _tpl_wl_egl_surface { tpl_bool_t vblank_done; tpl_bool_t set_serial_is_used; tpl_bool_t initialized_in_thread; + tpl_bool_t frontbuffer_activated; /* To make sure that tpl_gsource has been successfully finalized. */ tpl_bool_t gsource_finalized; @@ -1799,6 +1800,7 @@ __tpl_wl_egl_surface_init(tpl_surface_t *surface) wl_egl_surface->set_serial_is_used = TPL_FALSE; wl_egl_surface->gsource_finalized = TPL_FALSE; wl_egl_surface->initialized_in_thread = TPL_FALSE; + wl_egl_surface->frontbuffer_activated = TPL_FALSE; wl_egl_surface->latest_transform = -1; wl_egl_surface->render_done_cnt = 0; @@ -2357,6 +2359,15 @@ __tpl_wl_egl_surface_get_size(tpl_surface_t *surface, int *width, int *height) *height = tbm_surface_queue_get_height(wl_egl_surface->tbm_queue); } +static tpl_bool_t +__tpl_wl_egl_surface_fence_sync_is_available(tpl_surface_t *surface) +{ + tpl_wl_egl_surface_t *wl_egl_surface = + (tpl_wl_egl_surface_t *)surface->backend.data; + + return !wl_egl_surface->frontbuffer_activated; +} + #define CAN_DEQUEUE_TIMEOUT_MS 10000 tpl_result_t @@ -2650,6 +2661,7 @@ __tpl_wl_egl_surface_dequeue_buffer(tpl_surface_t *surface, uint64_t timeout_ns, wl_egl_surface->reset) { surface->frontbuffer = NULL; wl_egl_surface->need_to_enqueue = TPL_TRUE; + wl_egl_surface->frontbuffer_activated = TPL_FALSE; TPL_INFO("[FRONTBUFFER RENDERING STOP]", "wl_egl_surface(%p) wl_egl_window(%p)", wl_egl_surface, wl_egl_surface->wl_egl_window); @@ -2661,6 +2673,7 @@ __tpl_wl_egl_surface_dequeue_buffer(tpl_surface_t *surface, uint64_t timeout_ns, TRACE_ASYNC_BEGIN((intptr_t)surface->frontbuffer, "[DEQ]~[ENQ] BO_NAME:%d", bo_name); + wl_egl_surface->frontbuffer_activated = TPL_TRUE; tpl_gmutex_unlock(&wl_egl_display->wl_event_mutex); return surface->frontbuffer; } @@ -3643,6 +3656,8 @@ __tpl_surface_init_backend_wl_egl_thread(tpl_surface_backend_t *backend) __tpl_wl_egl_surface_set_post_interval; backend->get_size = __tpl_wl_egl_surface_get_size; + backend->fence_sync_is_available = + __tpl_wl_egl_surface_fence_sync_is_available; } static void