From 023a78b551f5696322bec3f0ecb689fec303fcd5 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Wed, 27 Dec 2017 10:46:04 +0900 Subject: [PATCH] tpl_wl_vk_thread: Enqueue tbm_surface before set sync_fd. Change-Id: I6e1d29275448aa43bc1232545510553c1ae2cd4a Signed-off-by: joonbum.ko --- src/tpl_wl_vk_thread.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/tpl_wl_vk_thread.c b/src/tpl_wl_vk_thread.c index b1eaf75..8167b3d 100644 --- a/src/tpl_wl_vk_thread.c +++ b/src/tpl_wl_vk_thread.c @@ -353,6 +353,15 @@ __tpl_wl_vk_wsi_surface_enqueue_buffer(tpl_surface_t *surface, return TPL_ERROR_INVALID_PARAMETER; } + tsq_err = tbm_surface_queue_enqueue(wayland_vk_wsi_surface->tbm_queue, + tbm_surface); + if (tsq_err == TBM_SURFACE_QUEUE_ERROR_NONE) { + tbm_surface_internal_unref(tbm_surface); + } else { + TPL_ERR("Failed to enqeueue tbm_surface. | tsq_err = %d", tsq_err); + return TPL_ERROR_INVALID_OPERATION; + } + if (sync_fence != -1) { tpl_result_t res = TPL_ERROR_NONE; res = twe_surface_set_sync_fd(wayland_vk_wsi_surface->twe_surface, @@ -363,18 +372,10 @@ __tpl_wl_vk_wsi_surface_enqueue_buffer(tpl_surface_t *surface, } } - tsq_err = tbm_surface_queue_enqueue(wayland_vk_wsi_surface->tbm_queue, - tbm_surface); - if (tsq_err == TBM_SURFACE_QUEUE_ERROR_NONE) { - tbm_surface_internal_unref(tbm_surface); - } else { - TPL_ERR("Failed to enqeueue tbm_surface. | tsq_err = %d", tsq_err); - return TPL_ERROR_INVALID_OPERATION; - } - - TPL_LOG_T("WL_VK", "[ENQ] tbm_surface(%p) bo(%d)", + TPL_LOG_T("WL_VK", "[ENQ] tbm_surface(%p) bo(%d) sync_fence(%d)", tbm_surface, - tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); + tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0)), + sync_fence); return TPL_ERROR_NONE; } -- 2.7.4