From 36aa64fc02c00064fcd84e32cb263c0b23f50d6d Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Thu, 11 Mar 2021 16:03:14 +0900 Subject: [PATCH] Changed to wait until ENQUEUE becomes FENCE_SIGNALED. - It is not safe to force close before being SIGNALED status because it is a fence fd delivered from driver. - Therefore, it is desirable to destroy all buffers when SIGNALED status is guaranteed. Change-Id: Ifd2632b6aeb3d519031e79cb03118b306fcd49a6 Signed-off-by: Joonbum Ko --- src/tpl_wl_egl_thread.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tpl_wl_egl_thread.c b/src/tpl_wl_egl_thread.c index fdc70d6..17cc5cf 100755 --- a/src/tpl_wl_egl_thread.c +++ b/src/tpl_wl_egl_thread.c @@ -1875,7 +1875,8 @@ _tpl_wl_egl_surface_buffer_clear(tpl_wl_egl_surface_t *wl_egl_surface) * so cancel_dequeue must be performed. */ need_to_cancel = wl_egl_buffer->status == DEQUEUED; - if (wl_egl_buffer->status == WAITING_SIGNALED) { + if (wl_egl_buffer->status >= ENQUEUED && + wl_egl_buffer->status < WAITING_VBLANK) { tpl_result_t wait_result = TPL_ERROR_NONE; tpl_gmutex_unlock(&wl_egl_display->wl_event_mutex); wait_result = tpl_cond_timed_wait(&wl_egl_buffer->cond, -- 2.7.4