From: Joonbum Ko Date: Tue, 13 Feb 2024 11:31:13 +0000 (+0900) Subject: wl_egl: Add logs for debuging X-Git-Tag: accepted/tizen/8.0/unified/20240311.164600~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=96beff43f50d25134167fdba282e9e7869a7a9af;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git wl_egl: Add logs for debuging Change-Id: I18bf09a54d5075630c562cb6a652c0543e4a9ef0 Signed-off-by: Joonbum Ko --- diff --git a/src/tpl_wl_egl_thread.c b/src/tpl_wl_egl_thread.c index f77d7ad..5d5b263 100755 --- a/src/tpl_wl_egl_thread.c +++ b/src/tpl_wl_egl_thread.c @@ -702,6 +702,8 @@ _thread_wl_display_fini(tpl_wl_egl_display_t *wl_egl_display) wl_egl_display, wl_egl_display->wl_tbm_client); wayland_tbm_client_deinit(wl_egl_display->wl_tbm_client); wl_egl_display->wl_tbm_client = NULL; + TPL_INFO("[WL_TBM_DEINIT_DONE]", + "wl_egl_display(%p)", wl_egl_display); } wl_event_queue_destroy(wl_egl_display->ev_queue); @@ -836,8 +838,12 @@ __thread_func_disp_finalize(tpl_gsource *gsource) TPL_LOG_D("[D_FINALIZE]", "wl_egl_display(%p) tpl_gsource(%p)", wl_egl_display, gsource); + TPL_INFO("[FINALIZE_BEGIN]", "wl_egl_display(%p) tpl_gsource(%p)", + wl_egl_display, gsource); if (wl_egl_display->wl_initialized) _thread_wl_display_fini(wl_egl_display); + TPL_INFO("[FINALIZE_END]", "wl_egl_display(%p) tpl_gsource(%p)", + wl_egl_display, gsource); wl_egl_display->gsource_finalized = TPL_TRUE; @@ -1019,7 +1025,7 @@ __tpl_wl_egl_display_fini(tpl_display_t *display) wl_egl_display = (tpl_wl_egl_display_t *)display->backend.data; if (wl_egl_display) { - TPL_INFO("[DISPLAY_FINI]", + TPL_INFO("[DISPLAY_FINI_BEGIN]", "wl_egl_display(%p) tpl_gthread(%p) wl_display(%p)", wl_egl_display, wl_egl_display->thread, @@ -1041,21 +1047,26 @@ __tpl_wl_egl_display_fini(tpl_display_t *display) tpl_gmutex_unlock(&wl_egl_display->tdm.tdm_mutex); } + tpl_gmutex_lock(&wl_egl_display->disp_mutex); + TPL_INFO("[DISP_SOURCE_DESTROY_BEGIN]", "wl_egl_display(%p) disp_source(%p)", + wl_egl_display, wl_egl_display->disp_source); if (wl_egl_display->disp_source) { - tpl_gmutex_lock(&wl_egl_display->disp_mutex); // Send destroy mesage to thread tpl_gsource_destroy(wl_egl_display->disp_source, TPL_TRUE); + /* This is a protection to prevent problems that arise in unexpected situations * that g_cond_wait cannot work normally. * When calling tpl_gsource_destroy() with destroy_in_thread is TPL_TRUE, * caller should use tpl_gcond_wait() in the loop with checking finalized flag * */ - while (!wl_egl_display->gsource_finalized) { + do { tpl_gcond_wait(&wl_egl_display->disp_cond, &wl_egl_display->disp_mutex); - } + } while (!wl_egl_display->gsource_finalized); + wl_egl_display->disp_source = NULL; - tpl_gmutex_unlock(&wl_egl_display->disp_mutex); } + TPL_INFO("[DISP_SOURCE_DESTROY_END]", "wl_egl_display(%p)", wl_egl_display); + tpl_gmutex_unlock(&wl_egl_display->disp_mutex); if (wl_egl_display->thread) { tpl_gthread_destroy(wl_egl_display->thread); @@ -1069,6 +1080,9 @@ __tpl_wl_egl_display_fini(tpl_display_t *display) tpl_gmutex_clear(&wl_egl_display->wl_event_mutex); + TPL_INFO("[DISPLAY_FINI_END]", + "wl_egl_display(%p)", wl_egl_display); + free(wl_egl_display); }