From 1b22c4216b6b745a01bb220a061632205afb1017 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Mon, 23 Jul 2018 14:43:33 +0900 Subject: [PATCH 01/16] Package version up to 1.5.11 Change-Id: I247df5594ceadb92f7a53d0bd6eefeb56b27cf15 Signed-off-by: Joonbum Ko --- packaging/libtpl-egl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 442120d..cd74845 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -4,7 +4,7 @@ #TPL VERSION MACROS %define TPL_VERSION_MAJOR 1 %define TPL_VERSION_MINOR 5 -%define TPL_VERSION_PATCH 10 +%define TPL_VERSION_PATCH 11 %define TPL_VERSION %{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR}.%{TPL_VERSION_PATCH} #TPL WINDOW SYSTEM DEFINITION -- 2.7.4 From a39d57611f9f64dcda6efe72fa6ed4ba54107f2e Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Wed, 25 Jul 2018 15:35:03 +0900 Subject: [PATCH 02/16] tpl_utils: Added internal util function to find node from given list with data. Change-Id: I5754db81f7edc27728d7b839985a124923671e6f Signed-off-by: Joonbum Ko --- src/tpl_utils.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/src/tpl_utils.h b/src/tpl_utils.h index 11aad8c..4237247 100644 --- a/src/tpl_utils.h +++ b/src/tpl_utils.h @@ -569,6 +569,52 @@ __tpl_list_insert(tpl_list_node_t *pos, void *data) return TPL_ERROR_NONE; } +static TPL_INLINE tpl_list_node_t * +__tpl_list_find_node(tpl_list_t *list, void *data, int occurrence, + tpl_free_func_t func) +{ + tpl_list_node_t *node = NULL; + tpl_list_node_t *res_node = NULL; + + TPL_ASSERT(list); + + if (occurrence == TPL_FIRST) { + node = list->head.next; + + while (node != &list->tail) { + tpl_list_node_t *curr; + + curr = node; + node = node->next; + + TPL_ASSERT(curr); + TPL_ASSERT(node); + + if (curr->data == data) { + res_node = curr; + } + } + } else if (occurrence == TPL_LAST) { + node = list->tail.prev; + + while (node != &list->head) { + tpl_list_node_t *curr; + + curr = node; + node = node->prev; + + TPL_ASSERT(curr); + TPL_ASSERT(node); + + if (curr->data == data) { + res_node = curr; + } + } + } + + return res_node; +} + static TPL_INLINE void __tpl_list_remove_data(tpl_list_t *list, void *data, int occurrence, tpl_free_func_t func) -- 2.7.4 From 5bedc776b5d4187eca392ee48b6c6badec849d9a Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Wed, 25 Jul 2018 15:40:09 +0900 Subject: [PATCH 03/16] tpl_wayland_egl: Modified to track committed wl_buffer using global list. - If more than one release event is processed for only once committed wl_buffer, the tbm_surface that should not be destroyed can be destroyed. - Save wl_buffer during from wl_surface_commit to wl_buffer_release to a global list called committed_wl_buffers to filter out unwanted release events. [The cases of the problem] 1. Multi-surfaces client. 2. client want to render in iconified status. Change-Id: I09ea2f0ba26b7066695971238d9bed003443e9e4 Signed-off-by: Joonbum Ko --- src/tpl_wayland_egl.c | 87 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 76 insertions(+), 11 deletions(-) diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index b2e5fbb..3dc6f43 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -66,6 +66,9 @@ struct _tpl_wayland_egl_buffer { struct wl_proxy *wl_proxy; /* wl_buffer proxy */ }; +static tpl_list_t *committed_wl_buffers = NULL; +static pthread_mutex_t g_list_mutex; + static const struct wl_buffer_listener buffer_release_listener; static int tpl_wayland_egl_buffer_key; @@ -201,6 +204,14 @@ __tpl_wayland_egl_display_init(tpl_display_t *display) goto free_wl_display; } + if (!committed_wl_buffers) { + committed_wl_buffers = __tpl_list_alloc(); + if (!committed_wl_buffers) + TPL_ERR("Failed to allocate committed_wl_buffers list."); + if (pthread_mutex_init(&g_list_mutex, NULL) != 0) + TPL_ERR("g_list_mutex init failed."); + } + wayland_egl_display->wl_dpy = wl_dpy; __tpl_wayland_egl_display_buffer_flusher_init(wayland_egl_display); @@ -285,6 +296,16 @@ __tpl_wayland_egl_display_fini(tpl_display_t *display) free(wayland_egl_display); } + if (pthread_mutex_lock(&g_list_mutex) == 0) { + if (committed_wl_buffers) + __tpl_list_free(committed_wl_buffers, NULL); + committed_wl_buffers = NULL; + pthread_mutex_unlock(&g_list_mutex); + } + + if (pthread_mutex_destroy(&g_list_mutex) != 0) + TPL_ERR("Failed to destroy g_list_mutex"); + display->backend.data = NULL; } @@ -606,9 +627,9 @@ add_reset_cb_fail: tbm_surface_queue_destroy(wayland_egl_surface->tbm_queue); wayland_egl_surface->tbm_queue = NULL; queue_create_fail: - __tpl_list_free(wayland_egl_surface->attached_buffers, NULL); -alloc_dequeue_buffers_fail: __tpl_list_free(wayland_egl_surface->dequeued_buffers, NULL); +alloc_dequeue_buffers_fail: + __tpl_list_free(wayland_egl_surface->attached_buffers, NULL); alloc_attached_buffers_fail: __tpl_object_fini(&wayland_egl_surface->base); tpl_object_init_fail: @@ -662,8 +683,8 @@ __tpl_wayland_egl_surface_fini(tpl_surface_t *surface) /* When surface is destroyed, unreference tbm_surface which tracked by * the list of attached_buffers in order to free the created resources. * (tpl_wayland_egl_buffer_t or wl_buffer) */ + TPL_OBJECT_LOCK(&wayland_egl_surface->base); if (wayland_egl_surface->attached_buffers) { - TPL_OBJECT_LOCK(&wayland_egl_surface->base); while (!__tpl_list_is_empty(wayland_egl_surface->attached_buffers)) { tbm_surface_queue_error_e tsq_err; tbm_surface_h tbm_surface = @@ -680,8 +701,8 @@ __tpl_wayland_egl_surface_fini(tpl_surface_t *surface) __tpl_list_free(wayland_egl_surface->attached_buffers, NULL); wayland_egl_surface->attached_buffers = NULL; - TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); } + TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); if (lock_res == 0) pthread_mutex_unlock(&wayland_egl_display->wl_event_mutex); @@ -842,12 +863,21 @@ __tpl_wayland_egl_surface_commit(tpl_surface_t *surface, wayland_egl_buffer->wl_proxy, wayland_egl_buffer->width, wayland_egl_buffer->height); + TPL_OBJECT_LOCK(&wayland_egl_surface->base); if (wayland_egl_surface->attached_buffers) { - TPL_OBJECT_LOCK(&wayland_egl_surface->base); /* Start tracking of this tbm_surface until release_cb called. */ __tpl_list_push_back(wayland_egl_surface->attached_buffers, (void *)tbm_surface); - TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); + } + TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); + + if (pthread_mutex_lock(&g_list_mutex) == 0) { + if (committed_wl_buffers) { + /* Start tracking of wl_buffer which is committed by this wayland_egl_surface */ + __tpl_list_push_back(committed_wl_buffers, + (void *)wayland_egl_buffer->wl_proxy); + } + pthread_mutex_unlock(&g_list_mutex); } /* TPL_WAIT_VBLANK = 1 */ @@ -1411,7 +1441,26 @@ __cb_client_buffer_release_callback(void *data, struct wl_proxy *proxy) tbm_surface_h tbm_surface = NULL; tbm_surface_queue_error_e tsq_err = TBM_SURFACE_QUEUE_ERROR_NONE; - TPL_ASSERT(data); + if (proxy && (pthread_mutex_lock(&g_list_mutex) == 0)) { + if (committed_wl_buffers) { + /* Look for the given wl_proxy in the global list(committed_wl_buffers), + * whether its release event has not been processed since wl_surface_commit + * with this wl_proxy */ + tpl_list_node_t *node = + __tpl_list_find_node(committed_wl_buffers, (void *)proxy, + TPL_FIRST, NULL); + + /* If the proxy can not be found in the committed_wl_buffers list, + * it has not been committed or has already been released. + * In this case, it is not an error, but the log will be printed. */ + if (!node) { + TPL_ERR("wl_buffer(%p) already has been released.", proxy); + pthread_mutex_unlock(&g_list_mutex); + return; + } + } + pthread_mutex_unlock(&g_list_mutex); + } tbm_surface = (tbm_surface_h) data; @@ -1432,13 +1481,13 @@ __cb_client_buffer_release_callback(void *data, struct wl_proxy *proxy) if (wayland_egl_buffer->need_to_release) { wayland_egl_surface = wayland_egl_buffer->wayland_egl_surface; + TPL_OBJECT_LOCK(&wayland_egl_surface->base); if (wayland_egl_surface->attached_buffers) { - TPL_OBJECT_LOCK(&wayland_egl_surface->base); /* Stop tracking of this released tbm_surface. */ __tpl_list_remove_data(wayland_egl_surface->attached_buffers, (void *)tbm_surface, TPL_FIRST, NULL); - TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); } + TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); tsq_err = tbm_surface_queue_release(wayland_egl_surface->tbm_queue, tbm_surface); @@ -1449,12 +1498,22 @@ __cb_client_buffer_release_callback(void *data, struct wl_proxy *proxy) wayland_egl_buffer->need_to_release = TPL_FALSE; tbm_surface_internal_unref(tbm_surface); + + if (pthread_mutex_lock(&g_list_mutex) == 0) { + /* This wl_buffer should be removed from committed_wl_buffers list. */ + __tpl_list_remove_data(committed_wl_buffers, (void *)proxy, + TPL_FIRST, NULL); + pthread_mutex_unlock(&g_list_mutex); + } + } else { TPL_WARN("No need to release buffer | wl_buffer(%p) tbm_surface(%p) bo(%d)", proxy, tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); } } + } else { + TPL_ERR("Failed to process release_event. Invalid tbm_surface(%p)", tbm_surface); } } @@ -1668,8 +1727,9 @@ static void __cb_tizen_surface_shm_flusher_flush_callback(void *data, * Then, client does not need to wait for release_callback to unreference * attached buffer. */ + + TPL_OBJECT_LOCK(&wayland_egl_surface->base); if (wayland_egl_surface->attached_buffers) { - TPL_OBJECT_LOCK(&wayland_egl_surface->base); while (!__tpl_list_is_empty(wayland_egl_surface->attached_buffers)) { tbm_surface_queue_error_e tsq_err; tbm_surface_h tbm_surface = @@ -1683,7 +1743,12 @@ static void __cb_tizen_surface_shm_flusher_flush_callback(void *data, TPL_ERR("Failed to release. tbm_surface(%p) tsq_err(%d)", tbm_surface, tsq_err); } - TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); + } + TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); + + if (pthread_mutex_lock(&g_list_mutex) == 0) { + __tpl_list_fini(committed_wl_buffers, NULL); + pthread_mutex_unlock(&g_list_mutex); } if (lock_res == 0) pthread_mutex_unlock(&wayland_egl_display->wl_event_mutex); -- 2.7.4 From 9c4032c4ee0e7aceb44494870931b1fc8f578e1f Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Wed, 25 Jul 2018 16:04:44 +0900 Subject: [PATCH 04/16] Package version up to 1.5.12 Change-Id: I52a5b1ad8c3e0c1f6c5c4332307ecc142eb30101 Signed-off-by: Joonbum Ko --- packaging/libtpl-egl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index cd74845..3347626 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -4,7 +4,7 @@ #TPL VERSION MACROS %define TPL_VERSION_MAJOR 1 %define TPL_VERSION_MINOR 5 -%define TPL_VERSION_PATCH 11 +%define TPL_VERSION_PATCH 12 %define TPL_VERSION %{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR}.%{TPL_VERSION_PATCH} #TPL WINDOW SYSTEM DEFINITION -- 2.7.4 From 8558ab8456e2ff2cf7e421349ef00f995de4e094 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 31 Jul 2018 16:13:01 +0900 Subject: [PATCH 05/16] tpl_wayland_egl: Modified to remove only flushed buffers from committed_wl_buffers. - If flush_callback removes all buffers from committed_wl_buffers, it can cause problems on non-iconified surfaces if they are multi-surfaces. Change-Id: I6f1e6d6faa024e15961669bcfef1c6d62dc89037 Signed-off-by: Joonbum Ko --- src/tpl_wayland_egl.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index 3dc6f43..7bc48bb 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -1734,9 +1734,19 @@ static void __cb_tizen_surface_shm_flusher_flush_callback(void *data, tbm_surface_queue_error_e tsq_err; tbm_surface_h tbm_surface = __tpl_list_pop_front(wayland_egl_surface->attached_buffers, NULL); + tpl_wayland_egl_buffer_t *wayland_egl_buffer = + __tpl_wayland_egl_get_wayland_buffer_from_tbm_surface(tbm_surface); + TRACE_ASYNC_END((int)tbm_surface, "[COMMIT ~ RELEASE_CB] BO_NAME:%d", tbm_bo_export(tbm_surface_internal_get_bo( tbm_surface, 0))); + + if (wayland_egl_buffer && pthread_mutex_lock(&g_list_mutex) == 0) { + __tpl_list_remove_data(committed_wl_buffers, (void *)wayland_egl_buffer->wl_proxy, + TPL_FIRST, NULL); + pthread_mutex_unlock(&g_list_mutex); + } + tbm_surface_internal_unref(tbm_surface); tsq_err = tbm_surface_queue_release(wayland_egl_surface->tbm_queue, tbm_surface); if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE) @@ -1746,11 +1756,6 @@ static void __cb_tizen_surface_shm_flusher_flush_callback(void *data, } TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); - if (pthread_mutex_lock(&g_list_mutex) == 0) { - __tpl_list_fini(committed_wl_buffers, NULL); - pthread_mutex_unlock(&g_list_mutex); - } - if (lock_res == 0) pthread_mutex_unlock(&wayland_egl_display->wl_event_mutex); } -- 2.7.4 From c8d1581d83029b7ace80c47ca05489edf2e99227 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 31 Jul 2018 16:18:09 +0900 Subject: [PATCH 06/16] tpl_utils: Modified to avoid unnecessary loop. Change-Id: I8a63c27414b50e19b5425771d726e1c6fbeb8400 Signed-off-by: Joonbum Ko --- src/tpl_utils.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/tpl_utils.h b/src/tpl_utils.h index 4237247..7f55fec 100644 --- a/src/tpl_utils.h +++ b/src/tpl_utils.h @@ -592,6 +592,7 @@ __tpl_list_find_node(tpl_list_t *list, void *data, int occurrence, if (curr->data == data) { res_node = curr; + break; } } } else if (occurrence == TPL_LAST) { @@ -608,6 +609,7 @@ __tpl_list_find_node(tpl_list_t *list, void *data, int occurrence, if (curr->data == data) { res_node = curr; + break; } } } -- 2.7.4 From 8a847d97de5109a4a3a698d9c4c7743310c2d83a Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Tue, 31 Jul 2018 16:18:46 +0900 Subject: [PATCH 07/16] Package version up to 1.5.13 Change-Id: I5b929878b1097e9dfe771cbab76099bea732f4d6 Signed-off-by: Joonbum Ko --- packaging/libtpl-egl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 3347626..3375711 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -4,7 +4,7 @@ #TPL VERSION MACROS %define TPL_VERSION_MAJOR 1 %define TPL_VERSION_MINOR 5 -%define TPL_VERSION_PATCH 12 +%define TPL_VERSION_PATCH 13 %define TPL_VERSION %{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR}.%{TPL_VERSION_PATCH} #TPL WINDOW SYSTEM DEFINITION -- 2.7.4 From 43ee41c57a3efe623cc1d8aff7f9adcf46080913 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 9 Aug 2018 14:03:08 +0900 Subject: [PATCH 08/16] tpl_display: Added a new API to get existed display with backend type. - Added API below. Get TPL display object for the given native display. If there's already existing TPL display for the given native display and backend type, then return the existed TPL display object. If the given backend type is TPL_BACKEND_UNKNWON, it behaves the same as tpl_display_get(). Otherwise, it searches for the tpl_display created with the given type. @param type backend type of the given native display. @param native_dpy handle to the native display. @return pointer to the display on success, NULL on failure. tpl_display_t * tpl_display_get_with_backend_type(tpl_backend_type_t type, tpl_handle_t native_dpy); Change-Id: I82f65da4f168f47b2669e5e82f92aae4e77968a0 Signed-off-by: Joonbum Ko --- src/tpl.h | 18 ++++++++++++++++++ src/tpl_display.c | 15 ++++++++++++++- 2 files changed, 32 insertions(+), 1 deletion(-) diff --git a/src/tpl.h b/src/tpl.h index 3c6b70b..aaf6998 100644 --- a/src/tpl.h +++ b/src/tpl.h @@ -318,6 +318,24 @@ tpl_display_t * tpl_display_get(tpl_handle_t native_dpy); /** + * Get TPL display object for the given native display. + * + * If there's already existing TPL display for the given native display and backend type, + * then return the existed TPL display object. + * + * If the given backend type is TPL_BACKEND_UNKNWON, + * it behaves the same as tpl_display_get(). + * Otherwise, it searches for the tpl_display created with the given type. + * + * @param type backend type of the given native display. + * @param native_dpy handle to the native display. + * @return pointer to the display on success, NULL on failure. + */ +tpl_display_t * +tpl_display_get_with_backend_type(tpl_backend_type_t type, + tpl_handle_t native_dpy); + +/** * Get the native display handle which the given TPL display is created for. * * @param display display to get native handle. diff --git a/src/tpl_display.c b/src/tpl_display.c index f62fcfe..a125a3f 100644 --- a/src/tpl_display.c +++ b/src/tpl_display.c @@ -89,12 +89,25 @@ tpl_display_get(tpl_handle_t native_dpy) { tpl_display_t *display; - /* Search for an already connected display for the given native display. */ + /* Search for an already created tpl_display for the given native display. */ display = __tpl_runtime_find_display(TPL_BACKEND_UNKNOWN, native_dpy); return display; } +tpl_display_t * +tpl_display_get_with_backend_type(tpl_backend_type_t type, + tpl_handle_t native_dpy) +{ + tpl_display_t *display; + + /* Search for an already created tpl_display + * for the given native display and type. */ + display = __tpl_runtime_find_display(type, native_dpy); + + return display; +} + tpl_handle_t tpl_display_get_native_handle(tpl_display_t *display) { -- 2.7.4 From f15688c950ee6528077fcdd55f9e504416e473df Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 9 Aug 2018 17:43:31 +0900 Subject: [PATCH 09/16] Package version up to 1.5.14 Change-Id: Iad63a60908ac832f806b004984f34b4e53e6be5e Signed-off-by: Joonbum Ko --- packaging/libtpl-egl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 3375711..0c092de 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -4,7 +4,7 @@ #TPL VERSION MACROS %define TPL_VERSION_MAJOR 1 %define TPL_VERSION_MINOR 5 -%define TPL_VERSION_PATCH 13 +%define TPL_VERSION_PATCH 14 %define TPL_VERSION %{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR}.%{TPL_VERSION_PATCH} #TPL WINDOW SYSTEM DEFINITION -- 2.7.4 From 5669f756b3e43fa3ce7b6d86ccf051b0072df311 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 30 Aug 2018 16:17:02 +0900 Subject: [PATCH 10/16] tpl_wayland_egl_thread: Fixed a bug to prevent tearing. - In the case of vulkan, the meaning of enqueue is not render_done state. Therefore, vulkan surface should check the can_acquire count in the dirty_queue of tbm_queue as well as the draw_done_count of surf_source. Change-Id: Ibdd3e2438ac158fa78d2f897ae83f1cceb289efb Signed-off-by: Joonbum Ko --- src/tpl_wayland_egl_thread.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 7a091aa..7a4764f 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1857,6 +1857,11 @@ _twe_thread_wl_surface_acquire_and_commit(twe_wl_surf_source *surf_source) * to commit or pending, depending on whether vblank_done * after acquire as much as possible. */ while (tbm_surface_queue_can_acquire(surf_source->tbm_queue, 0)) { + /* If its backend is vulkan, it should be checked with draw_done_count. + * Because vulkan surface's [enqueue] doesn't mean render done state */ + if (disp_source->is_vulkan_dpy && surf_source->draw_done_count <= 0) + return; + tsq_err = tbm_surface_queue_acquire(surf_source->tbm_queue, &tbm_surface); if (!tbm_surface || tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE) { TPL_ERR("Failed to acquire from tbm_queue(%p)", @@ -1897,6 +1902,9 @@ _twe_thread_wl_surface_acquire_and_commit(twe_wl_surf_source *surf_source) TPL_LOG_T(BACKEND, "[ACQ] tbm_surface(%p) bo(%d)", tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); + + surf_source->draw_done_count--; + switch (surf_source->swapchain_properties.present_mode) { case TPL_DISPLAY_PRESENT_MODE_IMMEDIATE: _twe_thread_wl_vk_surface_commit(surf_source, tbm_surface); @@ -1980,10 +1988,7 @@ _twe_thread_wl_surface_dispatch(GSource *source, GSourceFunc cb, gpointer data) if (surf_source->disp_source->is_vulkan_dpy && surf_source->use_sync_fence) { g_mutex_lock(&surf_source->sub_thread_mutex); - while (surf_source->draw_done_count > 0) { - _twe_thread_wl_surface_acquire_and_commit(surf_source); - surf_source->draw_done_count--; - } + _twe_thread_wl_surface_acquire_and_commit(surf_source); g_mutex_unlock(&surf_source->sub_thread_mutex); } else { _twe_thread_wl_surface_acquire_and_commit(surf_source); @@ -2895,7 +2900,6 @@ _twe_thread_sync_draw_source_dispatch(GSource *source, GSourceFunc cb, gpointer if (ret == -1) { TPL_ERR("failed to send acquirable event. tbm_surface(%p)", tbm_surface); - return G_SOURCE_REMOVE; } TRACE_END(); -- 2.7.4 From efcdbcdb59d0fcfedec4d42209be9851e8fcbfc9 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 30 Aug 2018 18:07:25 +0900 Subject: [PATCH 11/16] tpl_wayland_egl_thread: Added enqueue trace callback to tbm_queue. - Tracking dequeued buffers in the in_use_buffers is only from dequeue to enqueue. Change-Id: I0ba57d16fc181898f9ccd7e2c76767f082b83472 Signed-off-by: Joonbum Ko --- src/tpl_wayland_egl_thread.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 7a4764f..e399e6b 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1471,6 +1471,24 @@ _twe_surface_cancel_dequeued_buffer(twe_wl_surf_source *surf_source, } static void +_twe_surface_trace_enqueue_buffer(twe_wl_surf_source *surf_source, + tbm_surface_h tbm_surface) +{ + if (!surf_source) { + TPL_ERR("Invalid parameter. twe_surface(%p)", surf_source); + return; + } + + if (surf_source->in_use_buffers) { + g_mutex_lock(&surf_source->surf_mutex); + /* Stop tracking of this canceled tbm_surface */ + __tpl_list_remove_data(surf_source->in_use_buffers, + (void *)tbm_surface, TPL_FIRST, NULL); + g_mutex_unlock(&surf_source->surf_mutex); + } +} + +static void __cb_tbm_queue_reset_callback(tbm_surface_queue_h tbm_queue, void *data) { @@ -1529,6 +1547,9 @@ static void __cb_tbm_queue_trace_callback(tbm_surface_queue_h tbm_queue, case TBM_SURFACE_QUEUE_TRACE_CANCEL_DEQUEUE: _twe_surface_cancel_dequeued_buffer(surf_source, tbm_surface); break; + case TBM_SURFACE_QUEUE_TRACE_ENQUEUE: + _twe_surface_trace_enqueue_buffer(surf_source, tbm_surface); + break; default: break; } @@ -1716,8 +1737,6 @@ _twe_thread_wl_vk_surface_commit(twe_wl_surf_source *surf_source, } if (surf_source->committed_buffers) { - __tpl_list_remove_data(surf_source->in_use_buffers, - (void *)tbm_surface, TPL_FIRST, NULL); __tpl_list_push_back(surf_source->committed_buffers, tbm_surface); } @@ -1825,9 +1844,6 @@ _twe_thread_wl_surface_commit(twe_wl_surf_source *surf_source, if (surf_source->committed_buffers) { __tpl_list_push_back(surf_source->committed_buffers, tbm_surface); - /* Stop tracking of this released tbm_surface. */ - __tpl_list_remove_data(surf_source->in_use_buffers, - (void *)tbm_surface, TPL_FIRST, NULL); } } -- 2.7.4 From 7abd921b796854447ccd31baa78ccd0d97891359 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 30 Aug 2018 18:10:13 +0900 Subject: [PATCH 12/16] tpl_wayland_egl_thread: Deleted meaningless lines. Change-Id: I51e14837e6daa4fdbab04bda2f80ffab2210906a Signed-off-by: Joonbum Ko --- src/tpl_wayland_egl_thread.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index e399e6b..8a00580 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1442,21 +1442,11 @@ static void _twe_surface_cancel_dequeued_buffer(twe_wl_surf_source *surf_source, tbm_surface_h tbm_surface) { - twe_wl_buffer_info *buf_info = NULL; - if (!surf_source) { TPL_ERR("Invalid parameter. twe_surface(%p)", surf_source); return; } - tbm_surface_internal_get_user_data(tbm_surface, KEY_BUFFER_INFO, - (void **)&buf_info); - if (!buf_info) { - TPL_ERR("Failed to get twe_wl_buffer_info from tbm_surface(%p)", - tbm_surface); - return; - } - TPL_LOG_T(BACKEND, "[CANCEL_BUFFER] Stop tracking of canceled tbm_surface(%p)", tbm_surface); -- 2.7.4 From ba7256c4b357984d3e541baeabd756a7ef680880 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Mon, 3 Sep 2018 12:01:35 +0900 Subject: [PATCH 13/16] tpl_wayland_egl: Fixed bug related with deadlock. - Using wl_event_mutex in the shm_flush_callback can cause deadlock problem with polling in the wait_dequeuable(). Change-Id: I624bf18e120492cda6825fc84a061e9d27f6a02d Signed-off-by: Joonbum Ko --- src/tpl_wayland_egl.c | 86 +++++++++++++++++++-------------------------------- 1 file changed, 31 insertions(+), 55 deletions(-) diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index 7bc48bb..e2d8924 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -1459,7 +1459,6 @@ __cb_client_buffer_release_callback(void *data, struct wl_proxy *proxy) return; } } - pthread_mutex_unlock(&g_list_mutex); } tbm_surface = (tbm_surface_h) data; @@ -1499,12 +1498,9 @@ __cb_client_buffer_release_callback(void *data, struct wl_proxy *proxy) tbm_surface_internal_unref(tbm_surface); - if (pthread_mutex_lock(&g_list_mutex) == 0) { - /* This wl_buffer should be removed from committed_wl_buffers list. */ - __tpl_list_remove_data(committed_wl_buffers, (void *)proxy, - TPL_FIRST, NULL); - pthread_mutex_unlock(&g_list_mutex); - } + /* This wl_buffer should be removed from committed_wl_buffers list. */ + __tpl_list_remove_data(committed_wl_buffers, (void *)proxy, + TPL_FIRST, NULL); } else { TPL_WARN("No need to release buffer | wl_buffer(%p) tbm_surface(%p) bo(%d)", @@ -1515,6 +1511,8 @@ __cb_client_buffer_release_callback(void *data, struct wl_proxy *proxy) } else { TPL_ERR("Failed to process release_event. Invalid tbm_surface(%p)", tbm_surface); } + + pthread_mutex_unlock(&g_list_mutex); } static const struct wl_buffer_listener buffer_release_listener = { @@ -1699,22 +1697,12 @@ static void __cb_tizen_surface_shm_flusher_flush_callback(void *data, { tpl_surface_t *surface = data; tpl_wayland_egl_surface_t *wayland_egl_surface; - tpl_wayland_egl_display_t *wayland_egl_display; - int lock_res = 0; TPL_CHECK_ON_NULL_RETURN(surface); wayland_egl_surface = surface->backend.data; TPL_CHECK_ON_NULL_RETURN(wayland_egl_surface); - TPL_CHECK_ON_NULL_RETURN(surface->display); - wayland_egl_display = surface->display->backend.data; - TPL_CHECK_ON_NULL_RETURN(wayland_egl_display); - - TPL_CHECK_ON_NULL_RETURN(wayland_egl_display->wl_dpy); - TPL_CHECK_ON_NULL_RETURN(wayland_egl_display->wl_tbm_event_queue); TPL_CHECK_ON_NULL_RETURN(wayland_egl_surface->tbm_queue); - lock_res = pthread_mutex_lock(&wayland_egl_display->wl_event_mutex); - TPL_LOG_B("WL_EGL", "[FLUSH_CB] tpl_wayland_egl_surface_t(%p)", wayland_egl_surface); @@ -1728,35 +1716,35 @@ static void __cb_tizen_surface_shm_flusher_flush_callback(void *data, * attached buffer. */ - TPL_OBJECT_LOCK(&wayland_egl_surface->base); - if (wayland_egl_surface->attached_buffers) { - while (!__tpl_list_is_empty(wayland_egl_surface->attached_buffers)) { - tbm_surface_queue_error_e tsq_err; - tbm_surface_h tbm_surface = - __tpl_list_pop_front(wayland_egl_surface->attached_buffers, NULL); - tpl_wayland_egl_buffer_t *wayland_egl_buffer = - __tpl_wayland_egl_get_wayland_buffer_from_tbm_surface(tbm_surface); - - TRACE_ASYNC_END((int)tbm_surface, "[COMMIT ~ RELEASE_CB] BO_NAME:%d", - tbm_bo_export(tbm_surface_internal_get_bo( - tbm_surface, 0))); - - if (wayland_egl_buffer && pthread_mutex_lock(&g_list_mutex) == 0) { - __tpl_list_remove_data(committed_wl_buffers, (void *)wayland_egl_buffer->wl_proxy, - TPL_FIRST, NULL); - pthread_mutex_unlock(&g_list_mutex); - } + if (pthread_mutex_lock(&g_list_mutex) == 0) { + TPL_OBJECT_LOCK(&wayland_egl_surface->base); + if (wayland_egl_surface->attached_buffers) { + while (!__tpl_list_is_empty(wayland_egl_surface->attached_buffers)) { + tbm_surface_queue_error_e tsq_err; + tbm_surface_h tbm_surface = + __tpl_list_pop_front(wayland_egl_surface->attached_buffers, NULL); + tpl_wayland_egl_buffer_t *wayland_egl_buffer = + __tpl_wayland_egl_get_wayland_buffer_from_tbm_surface(tbm_surface); + + TRACE_ASYNC_END((int)tbm_surface, "[COMMIT ~ RELEASE_CB] BO_NAME:%d", + tbm_bo_export(tbm_surface_internal_get_bo( + tbm_surface, 0))); + + if (wayland_egl_buffer) { + __tpl_list_remove_data(committed_wl_buffers, (void *)wayland_egl_buffer->wl_proxy, + TPL_FIRST, NULL); + } - tbm_surface_internal_unref(tbm_surface); - tsq_err = tbm_surface_queue_release(wayland_egl_surface->tbm_queue, tbm_surface); - if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE) - TPL_ERR("Failed to release. tbm_surface(%p) tsq_err(%d)", - tbm_surface, tsq_err); + tbm_surface_internal_unref(tbm_surface); + tsq_err = tbm_surface_queue_release(wayland_egl_surface->tbm_queue, tbm_surface); + if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE) + TPL_ERR("Failed to release. tbm_surface(%p) tsq_err(%d)", + tbm_surface, tsq_err); + } } + TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); + pthread_mutex_unlock(&g_list_mutex); } - TPL_OBJECT_UNLOCK(&wayland_egl_surface->base); - - if (lock_res == 0) pthread_mutex_unlock(&wayland_egl_display->wl_event_mutex); } static void __cb_tizen_surface_shm_flusher_free_flush_callback(void *data, @@ -1764,28 +1752,16 @@ static void __cb_tizen_surface_shm_flusher_free_flush_callback(void *data, { tpl_surface_t *surface = data; tpl_wayland_egl_surface_t *wayland_egl_surface; - tpl_wayland_egl_display_t *wayland_egl_display; - int lock_res; TPL_CHECK_ON_NULL_RETURN(surface); wayland_egl_surface = surface->backend.data; TPL_CHECK_ON_NULL_RETURN(wayland_egl_surface); - TPL_CHECK_ON_NULL_RETURN(surface->display); - wayland_egl_display = surface->display->backend.data; - TPL_CHECK_ON_NULL_RETURN(wayland_egl_display); - - TPL_CHECK_ON_NULL_RETURN(wayland_egl_display->wl_dpy); - TPL_CHECK_ON_NULL_RETURN(wayland_egl_display->wl_tbm_event_queue); TPL_CHECK_ON_NULL_RETURN(wayland_egl_surface->tbm_queue); - lock_res = pthread_mutex_lock(&wayland_egl_display->wl_event_mutex); - TPL_LOG_B("WL_EGL", "[FLUSH_CB] tpl_wayland_egl_surface_t(%p)", wayland_egl_surface); tbm_surface_queue_free_flush(wayland_egl_surface->tbm_queue); - - if (lock_res == 0) pthread_mutex_unlock(&wayland_egl_display->wl_event_mutex); } static const struct tizen_surface_shm_flusher_listener -- 2.7.4 From 49037db87e7f8e9fac6b84ade0ae8d01abb6a21a Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Mon, 3 Sep 2018 14:53:17 +0900 Subject: [PATCH 14/16] Package version up to 1.5.15 Change-Id: I28db1a95f4f2f6043b8e0dd9e0660236ee8d4f7b Signed-off-by: Joonbum Ko --- packaging/libtpl-egl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 0c092de..32d62e8 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -4,7 +4,7 @@ #TPL VERSION MACROS %define TPL_VERSION_MAJOR 1 %define TPL_VERSION_MINOR 5 -%define TPL_VERSION_PATCH 14 +%define TPL_VERSION_PATCH 15 %define TPL_VERSION %{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR}.%{TPL_VERSION_PATCH} #TPL WINDOW SYSTEM DEFINITION -- 2.7.4 From 85d33705bcbeeb3b7c631cdef3ddfd3cf82c06be Mon Sep 17 00:00:00 2001 From: Harsh Aggarwal Date: Tue, 31 Jul 2018 16:33:53 +0530 Subject: [PATCH 15/16] Add support for VK_KHR_incremental_present: pass wl_surface_damage rects to compositor + added based on wl_surface protocol version + for vulkan the coordindate system is top left (so no inverted y) Change-Id: I00d47db5044ce00c855f898b55a1d15d443be9ae --- src/tpl_wayland_egl_thread.c | 29 ++++++++++++++++++++++++++++- src/tpl_wl_vk_thread.c | 10 ++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 8a00580..24b74c3 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1692,6 +1692,7 @@ _twe_thread_wl_vk_surface_commit(twe_wl_surf_source *surf_source, twe_wl_buffer_info *buf_info = NULL; struct wl_surface *wl_surface = surf_source->surf; tbm_surface_queue_error_e tsq_err = TBM_SURFACE_QUEUE_ERROR_NONE; + uint32_t version; tbm_surface_internal_get_user_data(tbm_surface, KEY_BUFFER_INFO, (void **)&buf_info); @@ -1701,12 +1702,38 @@ _twe_thread_wl_vk_surface_commit(twe_wl_surf_source *surf_source, return; } + version = wl_proxy_get_version((struct wl_proxy *)wl_surface); wl_surface_attach(wl_surface, (void *)buf_info->wl_buffer, 0, 0); - wl_surface_damage(wl_surface, 0, 0, + if (buf_info->num_rects < 1 || buf_info->rects == NULL) { + if (version < 4) { + wl_surface_damage(wl_surface, 0, 0, + surf_source->swapchain_properties.width, + surf_source->swapchain_properties.height); + } else { + wl_surface_damage_buffer(wl_surface, 0, 0, surf_source->swapchain_properties.width, surf_source->swapchain_properties.height); + } + } else { + int i; + for (i = 0; i < buf_info->num_rects; i++) { + if (version < 4) { + wl_surface_damage(wl_surface, + buf_info->rects[i * 4 + 0], + buf_info->rects[i * 4 + 1], + buf_info->rects[i * 4 + 2], + buf_info->rects[i * 4 + 3]); + } else { + wl_surface_damage_buffer(wl_surface, + buf_info->rects[i * 4 + 0], + buf_info->rects[i * 4 + 1], + buf_info->rects[i * 4 + 2], + buf_info->rects[i * 4 + 3]); + } + } + } wl_surface_commit(wl_surface); TRACE_MARK("[COMMIT] BO(%d)", diff --git a/src/tpl_wl_vk_thread.c b/src/tpl_wl_vk_thread.c index 09716c6..17ffa5c 100644 --- a/src/tpl_wl_vk_thread.c +++ b/src/tpl_wl_vk_thread.c @@ -354,6 +354,16 @@ __tpl_wl_vk_wsi_surface_enqueue_buffer(tpl_surface_t *surface, return TPL_ERROR_INVALID_PARAMETER; } + /* If there are received region information, + * save it to buf_info in tbm_surface user_data using below API. */ + if (num_rects && rects) { + tpl_result_t ret = TPL_ERROR_NONE; + ret = twe_surface_set_damage_region(tbm_surface, num_rects, rects); + if (ret != TPL_ERROR_NONE) { + TPL_WARN("Failed to set damage region. num_rects(%d) rects(%p)", + num_rects, rects); + } + } tsq_err = tbm_surface_queue_enqueue(wayland_vk_wsi_surface->tbm_queue, tbm_surface); if (tsq_err == TBM_SURFACE_QUEUE_ERROR_NONE) { -- 2.7.4 From eb989d5d811180d6fda32f1f7a1e333a10516cc7 Mon Sep 17 00:00:00 2001 From: Juyeon Lee Date: Fri, 17 Aug 2018 14:11:23 +0900 Subject: [PATCH 16/16] wayland_egl: Added new APIs related with serial - once dequeue, increase serial number and assign it both on wl_egl_window and twe_wl_buffer_info. - at the same time of wl_surface_commit, deliver the serial to wayland-tbm server by using wayland_tbm_client_set_buffer_serial - New wayland_egl API: unsigned int wl_egl_window_tizen_get_window_serial(struct wl_egl_window *egl_window) egl_window cannot be NULL Change-Id: I8a607be8c44b2a37e8ba90cceae3e3962a128ec9 --- src/tpl_wayland_egl.c | 7 +++++++ src/tpl_wayland_egl_thread.c | 12 +++++++++++- src/wayland-egl/wayland-egl-priv.h | 1 + src/wayland-egl/wayland-egl-tizen.c | 11 +++++++++++ src/wayland-egl/wayland-egl-tizen.h | 3 +++ src/wayland-egl/wayland-egl.c | 2 +- 6 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/tpl_wayland_egl.c b/src/tpl_wayland_egl.c index e2d8924..01be90d 100644 --- a/src/tpl_wayland_egl.c +++ b/src/tpl_wayland_egl.c @@ -64,6 +64,7 @@ struct _tpl_wayland_egl_buffer { tpl_bool_t is_new; /* for frontbuffer mode */ tpl_bool_t need_to_release; /* for checking need release */ struct wl_proxy *wl_proxy; /* wl_buffer proxy */ + unsigned int serial; /* increase while dequeue */ }; static tpl_list_t *committed_wl_buffers = NULL; @@ -851,6 +852,9 @@ __tpl_wayland_egl_surface_commit(tpl_surface_t *surface, } } + wayland_tbm_client_set_buffer_serial(wayland_egl_display->wl_tbm_client, + (void *)wayland_egl_buffer->wl_proxy, + wayland_egl_buffer->serial); wl_surface_commit(wl_egl_window->surface); wayland_egl_buffer->need_to_release = TPL_TRUE; @@ -1310,6 +1314,9 @@ __tpl_wayland_egl_surface_dequeue_buffer(tpl_surface_t *surface, uint64_t timeou wl_display_flush(wayland_egl_display->wl_dpy); + ++wl_egl_window->serial; + wayland_egl_buffer->serial = wl_egl_window->serial; + wayland_egl_buffer->dx = wl_egl_window->dx; wayland_egl_buffer->dy = wl_egl_window->dy; wayland_egl_buffer->width = wl_egl_window->width; diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 24b74c3..7f5808b 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -165,6 +165,9 @@ struct _twe_wl_buffer_info { tbm_surface_h tbm_surface; twe_wl_surf_source *surf_source; + + /* for wayland_tbm_client_set_buffer_serial */ + unsigned int serial; }; struct _vk_sync_draw_source { @@ -1314,6 +1317,8 @@ _twe_surface_set_wl_buffer_info(twe_wl_surf_source *surf_source, buf_info->transform = wl_egl_window->transform; buf_info->dx = wl_egl_window->dx; buf_info->dy = wl_egl_window->dy; + ++wl_egl_window->serial; + buf_info->serial = wl_egl_window->serial; } if (buf_info->rects) { @@ -1378,6 +1383,8 @@ _twe_surface_set_wl_buffer_info(twe_wl_surf_source *surf_source, } buf_info->transform = wl_egl_window->transform; + ++wl_egl_window->serial; + buf_info->serial = wl_egl_window->serial; } else { buf_info->dx = 0; buf_info->dy = 0; @@ -1386,6 +1393,7 @@ _twe_surface_set_wl_buffer_info(twe_wl_surf_source *surf_source, buf_info->w_transform = 0; buf_info->w_rotated = TPL_FALSE; buf_info->rotated = TPL_FALSE; + buf_info->serial = 0; } buf_info->sync_timestamp = 0; @@ -1842,7 +1850,9 @@ _twe_thread_wl_surface_commit(twe_wl_surf_source *surf_source, } } } - + wayland_tbm_client_set_buffer_serial(disp_source->wl_tbm_client, + (void *)buf_info->wl_buffer, + buf_info->serial); wl_surface_commit(wl_surface); TRACE_ASYNC_BEGIN((int)tbm_surface, "[COMMIT ~ RELEASE] BO(%d)", diff --git a/src/wayland-egl/wayland-egl-priv.h b/src/wayland-egl/wayland-egl-priv.h index 3e1f08a..0f87713 100644 --- a/src/wayland-egl/wayland-egl-priv.h +++ b/src/wayland-egl/wayland-egl-priv.h @@ -30,6 +30,7 @@ struct wl_egl_window { int frontbuffer_mode; int transform; int window_transform; + unsigned int serial; void *private; void (*destroy_window_callback)(void *); diff --git a/src/wayland-egl/wayland-egl-tizen.c b/src/wayland-egl/wayland-egl-tizen.c index a342cca..d3af986 100644 --- a/src/wayland-egl/wayland-egl-tizen.c +++ b/src/wayland-egl/wayland-egl-tizen.c @@ -139,3 +139,14 @@ wl_egl_window_tizen_set_window_transform(struct wl_egl_window *egl_window, egl_window->window_transform = window_transform; } + +unsigned int +wl_egl_window_tizen_get_window_serial(struct wl_egl_window *egl_window) +{ + if (egl_window == NULL) { + WL_EGL_ERR("egl_window is NULL"); + return 0; + } + + return egl_window->serial; +} \ No newline at end of file diff --git a/src/wayland-egl/wayland-egl-tizen.h b/src/wayland-egl/wayland-egl-tizen.h index cbc03f6..6c76177 100644 --- a/src/wayland-egl/wayland-egl-tizen.h +++ b/src/wayland-egl/wayland-egl-tizen.h @@ -66,6 +66,9 @@ void wl_egl_window_tizen_set_window_transform(struct wl_egl_window *egl_window, int window_transform); +unsigned int +wl_egl_window_tizen_get_window_serial(struct wl_egl_window *egl_window); + #ifdef __cplusplus } #endif diff --git a/src/wayland-egl/wayland-egl.c b/src/wayland-egl/wayland-egl.c index 5c16bcf..cdb8b6a 100644 --- a/src/wayland-egl/wayland-egl.c +++ b/src/wayland-egl/wayland-egl.c @@ -106,6 +106,7 @@ wl_egl_window_create(struct wl_surface *surface, egl_window->frontbuffer_mode = 0; egl_window->transform = 0; egl_window->window_transform = 0; + egl_window->serial = 0; egl_window->private = NULL; egl_window->rotate_callback = NULL; @@ -240,4 +241,3 @@ wl_egl_window_set_window_transform(struct wl_egl_window *egl_window, egl_window->window_transform = window_transform; } - -- 2.7.4