From bb4ddfbc86b7dcaab25de58ae743d909656d329c Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 21 Oct 2021 20:39:24 +0900 Subject: [PATCH] Modified to create wl_buffer only just before surface commit. - While surface is destroyed, it is to prevent unintentional generation of wl_proxy. Change-Id: Ic4b90c33d213453bad38ffd72cb9c2efbbfa5aa5 Signed-off-by: Joonbum Ko --- src/tpl_wl_egl_thread.c | 31 +++---------------------------- 1 file changed, 3 insertions(+), 28 deletions(-) diff --git a/src/tpl_wl_egl_thread.c b/src/tpl_wl_egl_thread.c index ac8d2c4..0c27e50 100755 --- a/src/tpl_wl_egl_thread.c +++ b/src/tpl_wl_egl_thread.c @@ -2800,31 +2800,6 @@ _thread_surface_queue_acquire(tpl_wl_egl_surface_t *wl_egl_surface) wl_egl_buffer, tbm_surface, _get_tbm_surface_bo_name(tbm_surface)); - if (wl_egl_buffer->wl_buffer == NULL) { - tpl_wl_egl_display_t *wl_egl_display = wl_egl_surface->wl_egl_display; - wl_egl_buffer->wl_buffer = - (struct wl_proxy *)wayland_tbm_client_create_buffer( - wl_egl_display->wl_tbm_client, tbm_surface); - - if (!wl_egl_buffer->wl_buffer) { - TPL_WARN("Failed to create wl_buffer. wl_tbm_client(%p) tbm_surface(%p)", - wl_egl_display->wl_tbm_client, tbm_surface); - } else { - TPL_INFO("[WL_BUFFER_CREATE]", - "wl_egl_buffer(%p) wl_buffer(%p) tbm_surface(%p)", - wl_egl_buffer, wl_egl_buffer->wl_buffer, tbm_surface); -#if TIZEN_FEATURE_ENABLE - if (!wl_egl_display->use_explicit_sync || - !wl_egl_surface->surface_sync) -#endif - { - wl_buffer_add_listener((struct wl_buffer *)wl_egl_buffer->wl_buffer, - &wl_buffer_release_listener, - wl_egl_buffer); - } - } - } - if (wl_egl_buffer->acquire_fence_fd != -1) { #if TIZEN_FEATURE_ENABLE if (wl_egl_surface->surface_sync) @@ -3218,7 +3193,7 @@ _thread_wl_surface_commit(tpl_wl_egl_surface_t *wl_egl_surface, "wl_egl_buffer(%p) wl_buffer(%p) tbm_surface(%p)", wl_egl_buffer, wl_egl_buffer->wl_buffer, wl_egl_buffer->tbm_surface); - + #if TIZEN_FEATURE_ENABLE if (!wl_egl_display->use_explicit_sync || !wl_egl_surface->surface_sync) @@ -3471,13 +3446,13 @@ __cb_wl_egl_buffer_free(tpl_wl_egl_buffer_t *wl_egl_buffer) tpl_gmutex_unlock(&wl_egl_surface->buffers_mutex); if (wl_egl_display) { - wl_display_flush(wl_egl_display->wl_display); - if (wl_egl_buffer->wl_buffer) { wayland_tbm_client_destroy_buffer(wl_egl_display->wl_tbm_client, (void *)wl_egl_buffer->wl_buffer); wl_egl_buffer->wl_buffer = NULL; } + + wl_display_flush(wl_egl_display->wl_display); } #if TIZEN_FEATURE_ENABLE -- 2.7.4