From bb382a53ddf0774d3597059031d1b6274de524df Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Tue, 28 Nov 2017 19:14:03 +0900 Subject: [PATCH 01/16] tpl_wayland_egl_thread: Modified backend name for printing debug logs. - It will be optimized. Change-Id: Iae60aa3a4e7d7f0b55c332b69a92d9e26c8ce69b Signed-off-by: joonbum.ko --- .vscode/settings.json | 5 +++ src/tpl_wayland_egl_thread.c | 87 +++++++++++++++++++++++--------------------- 2 files changed, 50 insertions(+), 42 deletions(-) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..d10fd7e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,5 @@ +{ + "files.associations": { + "tpl_utils.h": "c" + } +} \ No newline at end of file diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 2e345ab..d3116fd 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -23,6 +23,9 @@ static int buffer_info_key; #define CLIENT_QUEUE_SIZE 3 #define VK_CLIENT_QUEUE_SIZE 3 +/* backend name will be optimized */ +#define BACKEND "WL_VK_GL" + typedef struct _twe_wl_disp_source twe_wl_disp_source; typedef struct _twe_wl_surf_source twe_wl_surf_source; typedef struct _twe_wl_buffer_info twe_wl_buffer_info; @@ -227,7 +230,7 @@ _twe_thread_del_source_finalize(GSource *source) { twe_del_source *del_source = (twe_del_source *)source; - TPL_LOG_T("WL_EGL", "gsource(%p) event_fd(%d)", + TPL_LOG_T(BACKEND, "gsource(%p) event_fd(%d)", source, del_source->event_fd); close(del_source->event_fd); @@ -342,7 +345,7 @@ _twe_thread_tdm_source_finalize(GSource *source) { twe_tdm_source *tdm_source = (twe_tdm_source *)source; - TPL_LOG_T("WL_EGL", "tdm_destroy| tdm_source(%p) tdm_client(%p)", + TPL_LOG_T(BACKEND, "tdm_destroy| tdm_source(%p) tdm_client(%p)", tdm_source, tdm_source->tdm_client); if (tdm_source->tdm_client) { @@ -395,8 +398,8 @@ _twe_thread_tdm_source_create(void) tdm_fd, G_IO_IN); - TPL_LOG_T("WL_EGL", "TPL_WAIT_VBLANK:DEFAULT_ENABLED"); - TPL_LOG_T("WL_EGL", "tdm_source(%p) tdm_client(%p) tdm_fd(%d)", + TPL_LOG_T(BACKEND, "TPL_WAIT_VBLANK:DEFAULT_ENABLED"); + TPL_LOG_T(BACKEND, "tdm_source(%p) tdm_client(%p) tdm_fd(%d)", tdm_source, client, tdm_fd); return tdm_source; @@ -474,7 +477,7 @@ twe_thread_create(void) thread->ctx = _twe_ctx; _twe_ctx->ref_cnt++; - TPL_LOG_T("WL_EGL", "_twe_ctx(%p) twe_thread(%p)", _twe_ctx, thread); + TPL_LOG_T(BACKEND, "_twe_ctx(%p) twe_thread(%p)", _twe_ctx, thread); return thread; } @@ -511,7 +514,7 @@ twe_thread_destroy(twe_thread* thread) _twe_ctx = NULL; } - TPL_LOG_T("WL_EGL", "[THREAD DESTROY] twe_thread(%p)", thread); + TPL_LOG_T(BACKEND, "[THREAD DESTROY] twe_thread(%p)", thread); thread->ctx = NULL; free(thread); @@ -621,7 +624,7 @@ _twe_thread_wl_disp_finalize(GSource *source) { twe_wl_disp_source *disp_source = (twe_wl_disp_source *)source; - TPL_LOG_T("WL_EGL", "finalize| disp_source(%p)", disp_source); + TPL_LOG_T(BACKEND, "finalize| disp_source(%p)", disp_source); __tpl_object_fini(&disp_source->obj); @@ -657,7 +660,7 @@ _twe_display_init_wl_tbm_client(struct wl_display *display, wl_proxy_set_queue(wl_tbm, ev_queue); - TPL_LOG_T("WL_EGL", "wl_tbm_client init| wl_tbm_client(%p)", wl_tbm_client); + TPL_LOG_T(BACKEND, "wl_tbm_client init| wl_tbm_client(%p)", wl_tbm_client); return wl_tbm_client; } @@ -671,7 +674,7 @@ _twe_display_fini_wl_tbm_client(struct wayland_tbm_client *wl_tbm_client) wl_proxy_set_queue(wl_tbm, NULL); } - TPL_LOG_T("WL_EGL", "wl_tbm_client deinit| wl_tbm_client(%p)", wl_tbm_client); + TPL_LOG_T(BACKEND, "wl_tbm_client deinit| wl_tbm_client(%p)", wl_tbm_client); wayland_tbm_client_deinit(wl_tbm_client); } @@ -795,7 +798,7 @@ _twe_display_shm_init(twe_wl_disp_source *disp_source) wl_proxy_set_queue((struct wl_proxy *)disp_source->tss, NULL); - TPL_LOG_T("WL_EGL", "tizen_surface_shm(%p) init.", disp_source->tss); + TPL_LOG_T(BACKEND, "tizen_surface_shm(%p) init.", disp_source->tss); fini: if (queue) @@ -810,7 +813,7 @@ static void _twe_display_shm_fini(twe_wl_disp_source *disp_source) { if (disp_source->tss) { - TPL_LOG_T("WL_EGL", "tizen_surface_shm(%p) fini.", disp_source->tss); + TPL_LOG_T(BACKEND, "tizen_surface_shm(%p) fini.", disp_source->tss); tizen_surface_shm_destroy(disp_source->tss); disp_source->tss = NULL; } @@ -870,7 +873,7 @@ static void _twe_display_vk_fini(twe_wl_disp_source *disp_source) { if (disp_source->wl_vk_client) { - TPL_LOG_T("WL_VK", "wl_vk_client(%p) fini.", disp_source->wl_vk_client); + TPL_LOG_T(BACKEND, "wl_vk_client(%p) fini.", disp_source->wl_vk_client); wayland_vulkan_destroy(disp_source->wl_vk_client); } } @@ -901,7 +904,7 @@ _twe_thread_wl_disp_source_destroy(void *source) wl_event_queue_destroy(disp_source->ev_queue); TPL_OBJECT_UNLOCK(&disp_source->obj); - TPL_LOG_T("WL_EGL", "[DEL] twe_display(%p) wl_display(%p)", + TPL_LOG_T(BACKEND, "[DEL] twe_display(%p) wl_display(%p)", disp_source, disp_source->disp); g_source_remove_poll(&disp_source->gsource, &disp_source->gfd); @@ -975,7 +978,7 @@ twe_display_add(twe_thread* thread, g_source_add_poll(&source->gsource, &source->gfd); g_source_attach(&source->gsource, g_main_loop_get_context(ctx->twe_loop)); - TPL_LOG_T("WL_EGL", "add| gsource(%p) ev_queue(%p) wl_display(%p)", + TPL_LOG_T(BACKEND, "add| gsource(%p) ev_queue(%p) wl_display(%p)", source, source->ev_queue, display); return (twe_display_h)source; @@ -1084,7 +1087,7 @@ __cb_destroy_callback(void *private) twe_wl_surf_source *surf_source = (twe_wl_surf_source *)private; if (surf_source) { - TPL_LOG_T("WL_EGL", "[DESTROY_CB] wl_egl_window(%p) surf_source(%p)", + TPL_LOG_T(BACKEND, "[DESTROY_CB] wl_egl_window(%p) surf_source(%p)", surf_source->wl_egl_window, surf_source); TPL_OBJECT_LOCK(&surf_source->obj); surf_source->wl_egl_window->private = NULL; @@ -1110,7 +1113,7 @@ __cb_resize_callback(struct wl_egl_window *wl_egl_window, void *private) req_w = wl_egl_window->width; req_h = wl_egl_window->height; - TPL_LOG_T("WL_EGL", "[RESIZE_CB] wl_egl_window(%p) (%dx%d) -> (%dx%d)", + TPL_LOG_T(BACKEND, "[RESIZE_CB] wl_egl_window(%p) (%dx%d) -> (%dx%d)", wl_egl_window, cur_w, cur_h, req_w, req_h); if (tbm_surface_queue_reset(source->tbm_queue, req_w, req_h, format) @@ -1129,7 +1132,7 @@ __cb_rotate_callback(struct wl_egl_window *wl_egl_window, void *private) int rotation = wl_egl_window->rotation; twe_wl_surf_source *source = (twe_wl_surf_source *)private; - TPL_LOG_T("WL_EGL", "[ROTATE_CB] wl_egl_window(%p) (%d) -> (%d)", + TPL_LOG_T(BACKEND, "[ROTATE_CB] wl_egl_window(%p) (%d) -> (%d)", wl_egl_window, source->rotation, rotation); source->rotation = rotation; @@ -1162,7 +1165,7 @@ static void __cb_tss_flusher_flush_callback(void *data, twe_wl_disp_source *disp_source = surf_source->disp_source; int ret; - TPL_LOG_T("WL_EGL", "[FLUSH_CB] surf_source(%p)", surf_source); + TPL_LOG_T(BACKEND, "[FLUSH_CB] surf_source(%p)", surf_source); /*First distach pending queue for TPL - dispatch buffer-release @@ -1203,7 +1206,7 @@ static void __cb_tss_flusher_free_flush_callback(void *data, twe_wl_disp_source *disp_source = surf_source->disp_source; int ret; - TPL_LOG_T("WL_EGL", "[FREE_FLUSH_CB] surf_source(%p)", surf_source); + TPL_LOG_T(BACKEND, "[FREE_FLUSH_CB] surf_source(%p)", surf_source); /* First distach panding queue for TPL - dispatch buffer-release @@ -1236,7 +1239,7 @@ __cb_twe_buffer_free_callback(twe_wl_buffer_info *buf_info) twe_wl_surf_source *surf_source = buf_info->surf_source; twe_wl_disp_source *disp_source = surf_source->disp_source; - TPL_LOG_T("WL_EGL", "[FREE] twe_buffer(%p) wl_buffer(%p)", + TPL_LOG_T(BACKEND, "[FREE] twe_buffer(%p) wl_buffer(%p)", buf_info, buf_info->wl_buffer); wl_display_flush(disp_source->disp); @@ -1294,7 +1297,7 @@ __cb_buffer_release_callback(void *data, struct wl_proxy *wl_buffer) TPL_OBJECT_UNLOCK(&surf_source->obj); } - TPL_LOG_T("WL_EGL", "[REL] wl_buffer(%p) tbm_surface(%p) bo(%d)", + TPL_LOG_T(BACKEND, "[REL] wl_buffer(%p) tbm_surface(%p) bo(%d)", buf_info->wl_buffer, tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); tbm_surface_internal_unref(tbm_surface); @@ -1368,7 +1371,7 @@ _twe_surface_set_wl_buffer_info(twe_wl_surf_source *surf_source, TPL_OBJECT_UNLOCK(&surf_source->obj); } - TPL_LOG_T("WL_EGL", + TPL_LOG_T(BACKEND, "[REUSE_BUF] buf_info(%p) tbm_surface(%p) bo(%d) (%dx%d) transform(%d)", buf_info, tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0)), @@ -1452,7 +1455,7 @@ _twe_surface_set_wl_buffer_info(twe_wl_surf_source *surf_source, TPL_OBJECT_UNLOCK(&surf_source->obj); } - TPL_LOG_T("WL_EGL", + TPL_LOG_T(BACKEND, "[NEW_BUF] buf_info(%p) tbm_surface(%p) bo(%d) (%dx%d) transform(%d)", buf_info, tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0)), @@ -1478,7 +1481,7 @@ _twe_surface_cancel_dequeued_buffer(twe_wl_surf_source *surf_source, return; } - TPL_LOG_T("WL_EGL", + TPL_LOG_T(BACKEND, "[CANCEL_BUFFER] Stop tracking of canceled tbm_surface(%p)", tbm_surface); @@ -1495,7 +1498,7 @@ static void __cb_tbm_queue_reset_callback(tbm_surface_queue_h tbm_queue, void *data) { - TPL_LOG_T("WL_EGL", "tbm_queue(%p) has been reset!", tbm_queue); + TPL_LOG_T(BACKEND, "tbm_queue(%p) has been reset!", tbm_queue); } static void @@ -1688,7 +1691,7 @@ _twe_thread_wl_vk_surface_commit(twe_wl_surf_source *surf_source, buf_info->sync_timestamp++; - TPL_LOG_T("WL_VK", "[COMMIT] wl_buffer(%p) tbm_surface(%p) bo(%d)", + TPL_LOG_T(BACKEND, "[COMMIT] wl_buffer(%p) tbm_surface(%p) bo(%d)", buf_info->wl_buffer, tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); @@ -1780,7 +1783,7 @@ _twe_thread_wl_surface_commit(twe_wl_surf_source *surf_source, buf_info->need_to_commit = TPL_FALSE; - TPL_LOG_T("WL_EGL", "[COMMIT] wl_buffer(%p) tbm_surface(%p) bo(%d)", + TPL_LOG_T(BACKEND, "[COMMIT] wl_buffer(%p) tbm_surface(%p) bo(%d)", buf_info->wl_buffer, tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); @@ -1821,7 +1824,7 @@ _twe_thread_wl_surface_acquire_and_commit(twe_wl_surf_source *surf_source) } if (!disp_source->is_vulkan_dpy && !surf_source->vblank_done) { - TPL_LOG_T("WL_EGL", "[ACQ_skip] It will be acquired next vblank."); + TPL_LOG_T(BACKEND, "[ACQ_skip] It will be acquired next vblank."); TPL_OBJECT_UNLOCK(&surf_source->obj); return; } @@ -1847,7 +1850,7 @@ _twe_thread_wl_surface_acquire_and_commit(twe_wl_surf_source *surf_source) } if (!disp_source->is_vulkan_dpy) { /* wayland_egl */ - TPL_LOG_T("WL_EGL", "[ACQ] tbm_surface(%p) bo(%d)", + TPL_LOG_T(BACKEND, "[ACQ] tbm_surface(%p) bo(%d)", tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); @@ -1861,7 +1864,7 @@ _twe_thread_wl_surface_acquire_and_commit(twe_wl_surf_source *surf_source) case TPL_DISPLAY_PRESENT_MODE_MAILBOX: if (surf_source->draw_done_buffer) { g_mutex_lock(&surf_source->free_queue_mutex); - TPL_LOG_T("WL_VK", "[SKIP] tbm_surface(%p) bo(%d)", + TPL_LOG_T(BACKEND, "[SKIP] tbm_surface(%p) bo(%d)", tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo( tbm_surface, 0))); @@ -1943,7 +1946,7 @@ _twe_thread_wl_surface_finalize(GSource *source) { twe_wl_surf_source *surf_source = (twe_wl_surf_source *)source; - TPL_LOG_T("WL_EGL", "gsource(%p) event_fd(%d)", + TPL_LOG_T(BACKEND, "gsource(%p) event_fd(%d)", source, surf_source->event_fd); close(surf_source->event_fd); @@ -1975,7 +1978,7 @@ _twe_surface_buffer_flusher_init(twe_wl_surf_source *surf_source) tizen_surface_shm_flusher_add_listener(surf_source->tss_flusher, &tss_flusher_listener, surf_source); - TPL_LOG_T("WL_EGL", + TPL_LOG_T(BACKEND, "tss_flusher init. surf_source(%p) tss_flusher(%p)", surf_source, surf_source->tss_flusher); } @@ -1984,7 +1987,7 @@ static void _twe_surface_buffer_flusher_fini(twe_wl_surf_source *surf_source) { if (surf_source->tss_flusher) { - TPL_LOG_T("WL_EGL", + TPL_LOG_T(BACKEND, "tss_flusher fini. surf_source(%p) tss_flusher(%p)", surf_source, surf_source->tss_flusher); tizen_surface_shm_flusher_destroy(surf_source->tss_flusher); @@ -2019,7 +2022,7 @@ _twe_surface_create_vblank(tdm_client *tdm_client) tdm_client_vblank_set_enable_fake(vblank, 1); tdm_client_vblank_set_sync(vblank, 0); - TPL_LOG_T("WL_EGL", "[VBLANK INIT] vblank(%p)", vblank); + TPL_LOG_T(BACKEND, "[VBLANK INIT] vblank(%p)", vblank); return vblank; } @@ -2165,7 +2168,7 @@ _twe_thread_wl_surf_source_destroy(void *source) } if (surf_source->vblank) { - TPL_LOG_T("WL_EGL", "[VBLANK FINI] twe_wl_surf_source(%p) vblank(%p)", + TPL_LOG_T(BACKEND, "[VBLANK FINI] twe_wl_surf_source(%p) vblank(%p)", surf_source, surf_source->vblank); tdm_client_vblank_destroy(surf_source->vblank); } @@ -2174,7 +2177,7 @@ _twe_thread_wl_surf_source_destroy(void *source) surf_source->rotate_cb = NULL; if (surf_source->wl_egl_window) { - TPL_LOG_T("WL_EGL", "twe_surface(%p) wl_egl_window(%p) wl_surface(%p)", + TPL_LOG_T(BACKEND, "twe_surface(%p) wl_egl_window(%p) wl_surface(%p)", surf_source, surf_source->wl_egl_window, surf_source->surf); surf_source->wl_egl_window->destroy_window_callback = NULL; surf_source->wl_egl_window->resize_callback = NULL; @@ -2298,7 +2301,7 @@ twe_surface_add(twe_thread* thread, g_mutex_init(&source->free_queue_mutex); g_cond_init(&source->free_queue_cond); - TPL_LOG_T("WL_EGL", + TPL_LOG_T(BACKEND, "gsource(%p) native_handle(%p) wl_surface(%p) event_fd(%d)", source, native_handle, source->surf, source->event_fd); @@ -2328,7 +2331,7 @@ twe_surface_del(twe_surface_h twe_surface) return TPL_ERROR_INVALID_PARAMETER; } - TPL_LOG_T("WL_EGL", "twe_surface(%p) will be destroyed in thread", + TPL_LOG_T(BACKEND, "twe_surface(%p) will be destroyed in thread", twe_surface); surf_del_source = surf_source->surf_del_source; @@ -2428,9 +2431,9 @@ twe_surface_create_swapchain(twe_surface_h twe_surface, surf_source->swapchain_properties.present_mode = present_mode; surf_source->swapchain_properties.buffer_count = buffer_count; - TPL_LOG_T("WL_VK", "[SWAPCHAIN_CREATE][1/2] twe_surface(%p) tbm_queue(%p)", + TPL_LOG_T(BACKEND, "[SWAPCHAIN_CREATE][1/2] twe_surface(%p) tbm_queue(%p)", twe_surface, surf_source->tbm_queue); - TPL_LOG_T("WL_VK", + TPL_LOG_T(BACKEND, "[SWAPCHAIN_CREATE][2/2] w(%d) h(%d) f(%d) p(%d) b_cnt(%d)", width, height, format, present_mode, buffer_count); @@ -2447,7 +2450,7 @@ twe_surface_destroy_swapchain(twe_surface_h twe_surface) return TPL_ERROR_INVALID_PARAMETER; } - TPL_LOG_T("WL_VK", "[SWAPCHAIN_DESTROY] twe_surface(%p) tbm_queue(%p)", + TPL_LOG_T(BACKEND, "[SWAPCHAIN_DESTROY] twe_surface(%p) tbm_queue(%p)", twe_surface, surf_source->tbm_queue); if (surf_source->tbm_queue) { @@ -2502,7 +2505,7 @@ twe_surface_set_rotation_capablity(twe_surface_h twe_surface, tpl_bool_t set) return; } - TPL_LOG_T("WL_EGL", "twe_surface(%p) rotation capability set to [%s]", + TPL_LOG_T(BACKEND, "twe_surface(%p) rotation capability set to [%s]", source, (set ? "TRUE" : "FALSE")); source->rotation_capability = set; -- 2.7.4 From 72d0a97060e6191f467f3063a9ecdded570231b3 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Wed, 29 Nov 2017 12:00:29 +0900 Subject: [PATCH 02/16] tpl_wayland_egl_thread: Added the missing code to allocate list. - vblank_waiting_buffers list is needed to support FIFO & FIFO_RELAXED modes. Change-Id: I93a90ad4711bcb8f13640cc0942dc4175cdff8cc Signed-off-by: joonbum.ko --- src/tpl_wayland_egl_thread.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index d3116fd..7944b82 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -2158,6 +2158,12 @@ _twe_thread_wl_surf_source_destroy(void *source) surf_source->committed_buffers = NULL; } + if (surf_source->vblank_waiting_buffers) { + __tpl_list_free(surf_source->vblank_waiting_buffers, + (tpl_free_func_t)__cb_buffer_remove_from_list); + surf_source->vblank_waiting_buffers = NULL; + } + if (!disp_source->is_vulkan_dpy) { _twe_surface_buffer_flusher_fini(surf_source); } @@ -2425,6 +2431,11 @@ twe_surface_create_swapchain(twe_surface_h twe_surface, return TPL_ERROR_INVALID_OPERATION; } + if (present_mode == TPL_DISPLAY_PRESENT_MODE_FIFO + || present_mode == TPL_DISPLAY_PRESENT_MODE_FIFO_RELAXED) { + surf_source->vblank_waiting_buffers = __tpl_list_alloc(); + } + surf_source->format = format; surf_source->swapchain_properties.width = width; surf_source->swapchain_properties.height = height; -- 2.7.4 From 25a1f86e50b1a9a863ac0b3022f65ee4864175ba Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Thu, 30 Nov 2017 14:34:26 +0900 Subject: [PATCH 03/16] tpl_wayland_egl_thread: Fixed to work with IMMEDIATE in case vblank creation failed. Change-Id: I3c5a8addf4a3b2ab4cf25c8bccfc66bcddfebb02 Signed-off-by: joonbum.ko --- src/tpl_wayland_egl_thread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 7944b82..4c60f59 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1887,8 +1887,10 @@ _twe_thread_wl_surface_acquire_and_commit(twe_wl_surf_source *surf_source) if (surf_source->vblank_waiting_buffers) { __tpl_list_push_back(surf_source->vblank_waiting_buffers, (void *)tbm_surface); - if (_twe_surface_wait_vblank(surf_source) != TPL_ERROR_NONE) - TPL_ERR("Failed to set wait vblank"); + if (_twe_surface_wait_vblank(surf_source) != TPL_ERROR_NONE) { + TPL_WARN("Failed to set wait vblank. Falling back to IMMEDIATE_MODE."); + _twe_thread_wl_vk_surface_commit(surf_source, tbm_surface); + } } else { TPL_ERR("Invalid list. vblank_waiting_buffers is NULL."); } -- 2.7.4 From 480bf591c42d1fe1e77def21e2612926ea784d55 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Thu, 30 Nov 2017 20:06:50 +0900 Subject: [PATCH 04/16] tpl_wl_vk_thread: Added TRACE point to debug. Change-Id: Ia622b63760e5ec3f955eb3322a2d708e50ee0af1 Signed-off-by: joonbum.ko --- src/tpl_wayland_egl_thread.c | 10 ++++++++++ src/tpl_wl_vk_thread.c | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 4c60f59..07b2d35 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1297,6 +1297,10 @@ __cb_buffer_release_callback(void *data, struct wl_proxy *wl_buffer) TPL_OBJECT_UNLOCK(&surf_source->obj); } + TRACE_ASYNC_END((int)tbm_surface, "[COMMIT ~ RELEASE] BO(%d)", + tbm_bo_export(tbm_surface_internal_get_bo( + tbm_surface, 0))); + TPL_LOG_T(BACKEND, "[REL] wl_buffer(%p) tbm_surface(%p) bo(%d)", buf_info->wl_buffer, tbm_surface, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); @@ -1689,6 +1693,9 @@ _twe_thread_wl_vk_surface_commit(twe_wl_surf_source *surf_source, surf_source->swapchain_properties.height); wl_surface_commit(wl_surface); + TRACE_ASYNC_BEGIN((int)tbm_surface, "[COMMIT ~ RELEASE] BO(%d)", + tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); + buf_info->sync_timestamp++; TPL_LOG_T(BACKEND, "[COMMIT] wl_buffer(%p) tbm_surface(%p) bo(%d)", @@ -1781,6 +1788,9 @@ _twe_thread_wl_surface_commit(twe_wl_surf_source *surf_source, wl_surface_commit(wl_surface); + TRACE_ASYNC_BEGIN((int)tbm_surface, "[COMMIT ~ RELEASE] BO(%d)", + tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); + buf_info->need_to_commit = TPL_FALSE; TPL_LOG_T(BACKEND, "[COMMIT] wl_buffer(%p) tbm_surface(%p) bo(%d)", diff --git a/src/tpl_wl_vk_thread.c b/src/tpl_wl_vk_thread.c index 197b133..b917001 100644 --- a/src/tpl_wl_vk_thread.c +++ b/src/tpl_wl_vk_thread.c @@ -423,8 +423,10 @@ __tpl_wl_vk_wsi_surface_dequeue_buffer(tpl_surface_t *surface, if (lock_ret == TPL_ERROR_NONE) twe_display_unlock(wayland_vk_wsi_display->twe_display); TPL_OBJECT_UNLOCK(surface); + TRACE_BEGIN("WAIT_DEQUEUEABLE"); res = twe_surface_wait_dequeueable(wayland_vk_wsi_surface->twe_surface, timeout_ns); + TRACE_END(); TPL_OBJECT_LOCK(surface); lock_ret = twe_display_lock(wayland_vk_wsi_display->twe_display); -- 2.7.4 From 926dae9c7a6f548fe5abc0435e9fc75d22a456a9 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Thu, 30 Nov 2017 20:20:55 +0900 Subject: [PATCH 05/16] tpl_wayland_egl_thread: Add tbm_surface_queue_release on buffer flush cb This patch fixes the case that unnecessary buffer release cb is called after buffer flush. Change-Id: Iaa2023ecb6d990815e89b63a48f6709e694bbaeb Signed-off-by: joonbum.ko --- src/tpl_wayland_egl_thread.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 07b2d35..4db6a8c 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1193,6 +1193,20 @@ static void __cb_tss_flusher_flush_callback(void *data, TPL_OBJECT_LOCK(&surf_source->obj); __tpl_list_fini(surf_source->committed_buffers, (tpl_free_func_t)__cb_buffer_remove_from_list); + while (!__tpl_list_is_empty(surf_source->committed_buffers)) { + tbm_surface_queue_error_e tsq_err = TBM_SURFACE_QUEUE_ERROR_NONE; + tbm_surface_h tbm_surface = + __tpl_list_pop_front(surf_source->committed_buffers, + (tpl_free_func_t)__cb_buffer_remove_from_list); + + TRACE_ASYNC_END((int)tbm_surface, "[COMMIT ~ RELEASE] BO(%d)", + tbm_bo_export(tbm_surface_internal_get_bo( + tbm_surface, 0))); + tsq_err = tbm_surface_queue_release(surf_source->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(&surf_source->obj); } -- 2.7.4 From 54361c826d1ff271d68419b10c5d0ebf08c8fe72 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Tue, 5 Dec 2017 17:04:17 +0900 Subject: [PATCH 06/16] Package version up tp 1.5.0 - minor version up to 5 from 4. (4 -> 5) - minor version is separated from tizen_4.0 Change-Id: I5f5b7eff3a60e32fc1437f1f91a7d0393330e857 Signed-off-by: joonbum.ko --- packaging/libtpl-egl.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index d643afa..38d6051 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -2,8 +2,8 @@ #TPL VERSION MACROS %define TPL_VERSION_MAJOR 1 -%define TPL_VERSION_MINOR 4 -%define TPL_VERSION_PATCH 12 +%define TPL_VERSION_MINOR 5 +%define TPL_VERSION_PATCH 0 %define TPL_VERSION %{TPL_VERSION_MAJOR}.%{TPL_VERSION_MINOR}.%{TPL_VERSION_PATCH} #TPL WINDOW SYSTEM DEFINITION -- 2.7.4 From 29ea8ad6fbd8d2212dafc29077a6869f01ce2da5 Mon Sep 17 00:00:00 2001 From: Hoyub Lee Date: Wed, 13 Dec 2017 12:08:51 +0900 Subject: [PATCH 07/16] tpl_wayland_egl_thread: Add necessity check for buffer release On buffer release cb, there was no checking mechanism to check if this buffer needs to be released or not. This patch will add checking if this buffer has to be released or not. Therefore, unnecessary buffer release cb will be detected and handled correctly. Change-Id: I51b9d614da44fac4919539749612ca024b56aa9a Signed-off-by: Hoyub Lee --- src/tpl_wayland_egl_thread.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 4db6a8c..e8bf76b 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -135,6 +135,9 @@ struct _twe_wl_buffer_info { int *rects; tpl_bool_t need_to_commit; + /* for checking need release */ + tpl_bool_t need_to_release; + /* for checking draw done */ tpl_bool_t draw_done; tbm_fd draw_done_fence; @@ -1292,7 +1295,7 @@ __cb_buffer_release_callback(void *data, struct wl_proxy *wl_buffer) if (tbm_surface_internal_is_valid(tbm_surface)) { tbm_surface_internal_get_user_data(tbm_surface, KEY_BUFFER_INFO, (void **)&buf_info); - if (buf_info) { + if (buf_info && buf_info->need_to_release) { twe_wl_surf_source *surf_source = buf_info->surf_source; tbm_surface_queue_error_e tsq_err; @@ -1311,6 +1314,8 @@ __cb_buffer_release_callback(void *data, struct wl_proxy *wl_buffer) TPL_OBJECT_UNLOCK(&surf_source->obj); } + buf_info->need_to_release = TPL_FALSE; + TRACE_ASYNC_END((int)tbm_surface, "[COMMIT ~ RELEASE] BO(%d)", tbm_bo_export(tbm_surface_internal_get_bo( tbm_surface, 0))); @@ -1806,6 +1811,7 @@ _twe_thread_wl_surface_commit(twe_wl_surf_source *surf_source, tbm_bo_export(tbm_surface_internal_get_bo(tbm_surface, 0))); buf_info->need_to_commit = TPL_FALSE; + buf_info->need_to_release = TPL_TRUE; TPL_LOG_T(BACKEND, "[COMMIT] wl_buffer(%p) tbm_surface(%p) bo(%d)", buf_info->wl_buffer, tbm_surface, -- 2.7.4 From dc0662688ed4dc1c6c99ad6b5dd26f33941b537f Mon Sep 17 00:00:00 2001 From: Hoyub Lee Date: Wed, 13 Dec 2017 22:10:48 +0900 Subject: [PATCH 08/16] tpl_wayland_egl_thread: Replace unnecessary internal header with public one Change-Id: I1307adf16f3a3373de8d5da746d8756823083481 Signed-off-by: Hoyub Lee --- src/tpl_wayland_egl_thread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tpl_wayland_egl_thread.h b/src/tpl_wayland_egl_thread.h index 4c2fd4f..3e22829 100644 --- a/src/tpl_wayland_egl_thread.h +++ b/src/tpl_wayland_egl_thread.h @@ -1,7 +1,7 @@ #include #include +#include -#include "wayland-egl/wayland-egl-priv.h" #include "tpl.h" typedef struct _twe_thread twe_thread; -- 2.7.4 From c12a520284783bb650fa4917a22a1df644ca6470 Mon Sep 17 00:00:00 2001 From: Hoyub Lee Date: Wed, 13 Dec 2017 21:10:08 +0900 Subject: [PATCH 09/16] tc: Add member variable for choosing backend on Config Change-Id: Ifd04a8f8c5840248d234b1b2fdb82d28b598f4ee Signed-off-by: Hoyub Lee --- tc/src/tpl-test_base.h | 1 + 1 file changed, 1 insertion(+) diff --git a/tc/src/tpl-test_base.h b/tc/src/tpl-test_base.h index 309400a..071357e 100644 --- a/tc/src/tpl-test_base.h +++ b/tc/src/tpl-test_base.h @@ -31,6 +31,7 @@ typedef struct { int width; int height; int depth; + tpl_backend_type_t backend; } Config; -- 2.7.4 From f367e0d244b210f8a3f6339818d257038c59cf79 Mon Sep 17 00:00:00 2001 From: Hoyub Lee Date: Wed, 13 Dec 2017 21:20:50 +0900 Subject: [PATCH 10/16] tc: Add parsing backend functionality on Config parsing function Change-Id: Ibbabb404114ebad01fb695ba8aeeb5ded5182d20 Signed-off-by: Hoyub Lee --- tc/src/main.cpp | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/tc/src/main.cpp b/tc/src/main.cpp index e9c9b1c..25bb681 100644 --- a/tc/src/main.cpp +++ b/tc/src/main.cpp @@ -20,9 +20,11 @@ void tpl_test_print_help() { printf("\n\n=== How to setup test configurations ===\n\n"); - printf("--config.width=WIDTH (default: 720)\n"); - printf("--config.height=HEIGHT (default: 1280)\n"); - printf("--config.depth=DEPTH (default: 24)\n"); + printf("--config.width=WIDTH (default: 720)\n"); + printf("--config.height=HEIGHT (default: 1280)\n"); + printf("--config.depth=DEPTH (default: 24)\n"); + printf("--config.backend=BACKEND BACKEND is 'TPL_WAYLAND', 'TPL_WAYLAND_THREAD', or 'TPL_TBM'.\n"); + printf(" (default: TPL_WAYLAND)\n"); printf("\n\n"); } @@ -35,17 +37,20 @@ tpl_test_parse_arguments(int argc, char **argv) config.width = 720; config.height = 1280; config.depth = 24; + config.backend = TPL_BACKEND_WAYLAND; // Check option int opt_width = 0; int opt_height = 0; int opt_depth = 0; + int opt_backend = 0; struct option longopts[] = { {"help", no_argument, NULL, 'h'}, {"config.width", required_argument, &opt_width, 1}, {"config.height", required_argument, &opt_height, 1}, {"config.depth", optional_argument, &opt_depth, 1}, + {"config.backend", required_argument, &opt_backend, 1}, {NULL, 0, NULL, 0} }; @@ -69,6 +74,23 @@ tpl_test_parse_arguments(int argc, char **argv) printf("Depth set: %s\n", optarg); config.depth = atoi(optarg); opt_depth = 0; + } else if (opt_backend == 1) { + char backend[100]; + strncpy(backend, optarg, 100); + + // Parse backend argument + if (strncmp(backend, "TPL_WAYLAND", 100) == 0) { + config.backend = TPL_BACKEND_WAYLAND; + } else if (strncmp(backend, "TPL_WAYLAND_THREAD", 100) == 0) { + config.backend = TPL_BACKEND_WAYLAND_THREAD; + } else if (strncmp(backend, "TPL_TBM", 100) == 0) { + config.backend = TPL_BACKEND_TBM; + } else { + printf("Unrecognized backend: %s, Using default backend.", backend); + strncpy(backend, "TPL_WAYLAND", 100); + } + + printf("Backend set: %s\n", backend); } else { break; } -- 2.7.4 From d96e2c234d1b48e3e931a4b1153ef947a558c3ec Mon Sep 17 00:00:00 2001 From: Hoyub Lee Date: Wed, 13 Dec 2017 21:27:16 +0900 Subject: [PATCH 11/16] tc: Apply config.backend on TPLWayland Change-Id: I40a1f898d76b1fac772ce42a29b1ee71deae38b7 Signed-off-by: Hoyub Lee --- tc/src/tpl-test_wayland.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tc/src/tpl-test_wayland.cpp b/tc/src/tpl-test_wayland.cpp index 9ba3722..591d595 100644 --- a/tc/src/tpl-test_wayland.cpp +++ b/tc/src/tpl-test_wayland.cpp @@ -84,7 +84,7 @@ TPLWayland::tpl_backend_initialize(Config *config) wl_win.native = wl_egl_window_create(wl_win.surface, config->width, config->height); - tpl_display = tpl_display_create(TPL_BACKEND_WAYLAND, + tpl_display = tpl_display_create(config->backend, (tpl_handle_t)wl_disp.display); tpl_surface = tpl_surface_create(tpl_display, (tpl_handle_t)wl_win.native, -- 2.7.4 From 14898ed4b38fa4487c9c88123585cff03c18d91f Mon Sep 17 00:00:00 2001 From: Hoyub Lee Date: Wed, 13 Dec 2017 21:28:16 +0900 Subject: [PATCH 12/16] tc: Make tpl-test backend choosable Change-Id: I2bac7c16fa4087edf1930e1cde14971af9fe149f Signed-off-by: Hoyub Lee --- tc/src/main.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/tc/src/main.cpp b/tc/src/main.cpp index 25bb681..fa0afd3 100644 --- a/tc/src/main.cpp +++ b/tc/src/main.cpp @@ -107,7 +107,19 @@ main(int argc, char **argv) TPLTestBase::config = tpl_test_parse_arguments(argc, argv); // Initialize backend - TPLTestBase::backend = new TPLWayland(); + switch(TPLTestBase::config.backend) { + case TPL_BACKEND_WAYLAND: + case TPL_BACKEND_WAYLAND_THREAD: + TPLTestBase::backend = new TPLWayland(); + break; + case TPL_BACKEND_TBM: + // TODO + break; + default: + printf("config is not set correctly.\n"); + printf("Exit program now.\n"); + return -1; + } ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); -- 2.7.4 From 4d79f46dcb28cb272cd9d273c765e9e75a8ff728 Mon Sep 17 00:00:00 2001 From: Hoyub Lee Date: Fri, 15 Dec 2017 16:20:11 +0900 Subject: [PATCH 13/16] build: Add output variable for configuring build setting of wayland-egl Change-Id: I28ca6958910ae9de0c49854b950b972dfb01a084 Signed-off-by: Hoyub Lee --- configure.ac | 3 +++ src/wayland-egl/Makefile.am | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c0b7aae..48ec7ed 100644 --- a/configure.ac +++ b/configure.ac @@ -168,6 +168,9 @@ TPL_LIBS+="$TPL_ESSENTIAL_LIBS" AC_SUBST([TPL_CFLAGS]) AC_SUBST([TPL_LIBS]) +AC_SUBST([WL_EGL_CFLAGS]) +AC_SUBST([WL_EGL_LIBS]) + # Checks for typedefs, structures, and compiler characteristics. AC_C_INLINE AC_TYPE_INT32_T diff --git a/src/wayland-egl/Makefile.am b/src/wayland-egl/Makefile.am index 8953b87..e51bc63 100644 --- a/src/wayland-egl/Makefile.am +++ b/src/wayland-egl/Makefile.am @@ -4,8 +4,10 @@ libwayland_egl_ladir = $(libdir) libwayland_egl_lainclude_HEADERS = wayland-egl-tizen.h libwayland_egl_laincludedir = $(includedir) -libwayland_egl_la_CFLAGS = -I$(srcdir) -libwayland_egl_la_LIBADD = +libwayland_egl_la_CFLAGS = -I$(srcdir) \ + @WL_EGL_CFLAGS@ + +libwayland_egl_la_LIBADD = @WL_EGL_LIBS@ libwayland_egl_la_LDFLAGS = -version-number @WL_EGL_VERSION_MAJOR@:@WL_EGL_VERSION_MINOR@:@WL_EGL_VERSION_PATCH@ libwayland_egl_la_SOURCES = wayland-egl.c -- 2.7.4 From 753ed2639149010f1442e38a98ca640c4a183cb8 Mon Sep 17 00:00:00 2001 From: Hoyub Lee Date: Fri, 15 Dec 2017 19:03:11 +0900 Subject: [PATCH 14/16] build: Add support for gcov Change-Id: I4a70f6180469514dd68e7ed545fdff4d3e2dd312 Signed-off-by: Hoyub Lee --- configure.ac | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/configure.ac b/configure.ac index 48ec7ed..8a6985c 100644 --- a/configure.ac +++ b/configure.ac @@ -162,6 +162,21 @@ AS_IF([test "${with_utest}" = "yes" || test "${with_utest}" = "1"], AM_CONDITIONAL([WITH_UTEST], [test "${with_utest}" = "yes" || test "${with_utest}" = "1"]) +AC_ARG_ENABLE([gcov], + [AS_HELP_STRING([--enable-gcov=yes|no],[Enable gcov.])], + [], + []) + +# TODO: Apply pkgconfig on gcov +AS_IF([test "${enable_gcov}" = "yes" || test "${enable_gcov}" = "1"], + [TPL_CFLAGS+=" -fprofile-arcs -ftest-coverage" + TPL_LIBS+=" -lgcov " + WL_EGL_CFLAGS+=" -fprofile-arcs -ftest-coverage" + WL_EGL_LIBS+=" -lgcov "], + []) + +AM_CONDITIONAL([ENABLE_GCOV], [test "${enable_gcov}" = "yes" || test "${enable_gcov}" = "1"]) + TPL_CFLAGS+="$TPL_ESSENTIAL_CFLAGS" TPL_LIBS+="$TPL_ESSENTIAL_LIBS" -- 2.7.4 From 56500e2f3c1f2972146781813d988cf14fa12cdc Mon Sep 17 00:00:00 2001 From: Hoyub Lee Date: Fri, 15 Dec 2017 19:04:12 +0900 Subject: [PATCH 15/16] build: Add ENABLE_TPL_TEST_GCOV option on spec Change-Id: I984348d96269bb8230cd41141d556bd76b2447be Signed-off-by: Hoyub Lee --- packaging/libtpl-egl.spec | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 38d6051..53f8edc 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -1,4 +1,5 @@ %bcond_with utest +%bcond_with utest_gcov #TPL VERSION MACROS %define TPL_VERSION_MAJOR 1 @@ -19,7 +20,8 @@ %define ENABLE_DEFAULT_WL_THREAD 0 #TPL INSTALL OPTION -%define ENABLE_TPL_TEST 0 +%define ENABLE_TPL_TEST 0 +%define ENABLE_TPL_TEST_GCOV 0 #WAYLAND-EGL VERSION MACROS %define WL_EGL_VERSION_MAJOR 1 @@ -153,6 +155,9 @@ export WL_EGL_VERSION_PATCH=%{WL_EGL_VERSION_PATCH} %endif %if %{with utest} || "%{ENABLE_TPL_TEST}" == "1" --with-utest=yes \ +%if %{with utest_gcov} || "%{ENABLE_TPL_TEST_GCOV}" == "1" + --enable-gcov=yes \ +%endif %endif --enable-dlog=%{ENABLE_DLOG} \ --enable-dlog-default=%{ENABLE_DEFAULT_LOG} \ -- 2.7.4 From 5df571b0a458bdedef3a601fc57052a519fbaa28 Mon Sep 17 00:00:00 2001 From: Hoyub Lee Date: Fri, 15 Dec 2017 19:09:32 +0900 Subject: [PATCH 16/16] tc: Apply gcov on tpl-test Change-Id: Ia4d65ce73d4d34393203a9883f6f55bf4a71afc7 Signed-off-by: Hoyub Lee --- src/Makefile.am | 4 ++++ src/wayland-egl/Makefile.am | 4 ++++ tc/src/main.cpp | 3 +++ tc/src/tpl-test_base.cpp | 5 +++++ 4 files changed, 16 insertions(+) diff --git a/src/Makefile.am b/src/Makefile.am index af61301..8c4f651 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,6 +7,10 @@ libtpl_egl_laincludedir = $(includedir) libtpl_egl_la_CFLAGS = -I$(srcdir) \ @TPL_CFLAGS@ +if ENABLE_GCOV +libtpl_egl_la_CFLAGS += -DTIZEN_TEST_GCOV +endif + libtpl_egl_la_LIBADD = @TPL_LIBS@ libtpl_egl_la_LDFLAGS = -version-number @TPL_VERSION_MAJOR@:@TPL_VERSION_MINOR@:@TPL_VERSION_PATCH@ diff --git a/src/wayland-egl/Makefile.am b/src/wayland-egl/Makefile.am index e51bc63..cf0a9e6 100644 --- a/src/wayland-egl/Makefile.am +++ b/src/wayland-egl/Makefile.am @@ -7,6 +7,10 @@ libwayland_egl_laincludedir = $(includedir) libwayland_egl_la_CFLAGS = -I$(srcdir) \ @WL_EGL_CFLAGS@ +if ENABLE_GCOV +libwayland_egl_la_CFLAGS += -DTIZEN_TEST_GCOV +endif + libwayland_egl_la_LIBADD = @WL_EGL_LIBS@ libwayland_egl_la_LDFLAGS = -version-number @WL_EGL_VERSION_MAJOR@:@WL_EGL_VERSION_MINOR@:@WL_EGL_VERSION_PATCH@ libwayland_egl_la_SOURCES = wayland-egl.c diff --git a/tc/src/main.cpp b/tc/src/main.cpp index fa0afd3..3dd5afe 100644 --- a/tc/src/main.cpp +++ b/tc/src/main.cpp @@ -103,6 +103,9 @@ tpl_test_parse_arguments(int argc, char **argv) int main(int argc, char **argv) { +#ifdef TIZEN_TEST_GCOV + setenv("GCOV_PREFIX", "/tmp/daemon", 1); +#endif // Setup configurations TPLTestBase::config = tpl_test_parse_arguments(argc, argv); diff --git a/tc/src/tpl-test_base.cpp b/tc/src/tpl-test_base.cpp index a1ef6b4..d6c5b75 100644 --- a/tc/src/tpl-test_base.cpp +++ b/tc/src/tpl-test_base.cpp @@ -21,5 +21,10 @@ void TPLTestBase::TearDownTestCase() { backend->tpl_backend_finalize(&config); + +#ifdef TIZEN_TEST_GCOV + void __gcov_flush(void); + __gcov_flush(); +#endif } -- 2.7.4