From 37144dc23b3056ad32ee27eb807ab3d19a7d356e Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Tue, 2 Jan 2018 15:10:38 +0900 Subject: [PATCH] tpl_wayland_egl_thread: Fixed wrong codes in committed_buffers list. Change-Id: Ice96bd544bb38800a6678c1c44bf79875fb26c5d Signed-off-by: joonbum.ko --- src/tpl_wayland_egl_thread.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 96dbb8c..ef91619 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -1224,8 +1224,6 @@ static void __cb_tss_flusher_flush_callback(void *data, */ if (surf_source->committed_buffers) { 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 = @@ -2257,10 +2255,19 @@ _twe_thread_wl_surf_source_destroy(void *source) surf_source->in_use_buffers = NULL; } - if (surf_source->committed_buffers) { - __tpl_list_free(surf_source->committed_buffers, - (tpl_free_func_t)__cb_buffer_remove_from_list); - surf_source->committed_buffers = NULL; + 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); } if (surf_source->vblank_waiting_buffers) { -- 2.7.4