From 65b95e1c91b66b9d5cc95612a7390680d75d5712 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Wed, 17 Jan 2024 14:04:55 +0900 Subject: [PATCH] wl_egl: check is_activated after calling can_dequeue - to resolve regression issue related to support frontbuffer rendering mode. - The issue was caused by the commit below wl_egl: remove checking activated when dequeue buffer c362b0b2860d1ebab098956e2567aeef8313952c - Actual buffer will be attached when calling tbm_surface_queue_can_dequeue(). So calling wayland_tbm_client_queue_check_activate() at dequeue_buffer is not appropriate. Change-Id: I091d812f9354bd98e5b19a6eb35df83d92c45473 Signed-off-by: Joonbum Ko --- src/tpl_wl_egl_thread.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/tpl_wl_egl_thread.c b/src/tpl_wl_egl_thread.c index b715f03..f77d7ad 100755 --- a/src/tpl_wl_egl_thread.c +++ b/src/tpl_wl_egl_thread.c @@ -1537,7 +1537,6 @@ __cb_tbm_queue_reset_callback(tbm_surface_queue_h tbm_queue, tpl_wl_egl_surface_t *wl_egl_surface = NULL; tpl_wl_egl_display_t *wl_egl_display = NULL; tpl_surface_t *surface = NULL; - tpl_bool_t is_activated = TPL_FALSE; int width, height; wl_egl_surface = (tpl_wl_egl_surface_t *)data; @@ -1560,23 +1559,6 @@ __cb_tbm_queue_reset_callback(tbm_surface_queue_h tbm_queue, surface->width, surface->height, width, height); } - /* When queue_reset_callback is called, if is_activated is different from - * its previous state change the reset flag to TPL_TRUE to get a new buffer - * with the changed state(ACTIVATED/DEACTIVATED) at the next frame. */ - is_activated = wayland_tbm_client_queue_check_activate(wl_egl_display->wl_tbm_client, - wl_egl_surface->tbm_queue); - if (wl_egl_surface->is_activated != is_activated) { - if (is_activated) { - TPL_INFO("[ACTIVATED]", - "wl_egl_surface(%p) wl_surface(%p) tbm_queue(%p)", - wl_egl_surface, wl_egl_surface->wl_surface, tbm_queue); - } else { - TPL_INFO("[DEACTIVATED]", - " wl_egl_surface(%p) wl_surface(%p) tbm_queue(%p)", - wl_egl_surface, wl_egl_surface->wl_surface, tbm_queue); - } - } - wl_egl_surface->reset = TPL_TRUE; if (surface->reset_cb) @@ -2630,6 +2612,24 @@ __tpl_wl_egl_surface_dequeue_buffer(tpl_surface_t *surface, uint64_t timeout_ns, wl_egl_surface->width = surface->width; wl_egl_surface->height = surface->height; + if (wl_egl_surface->reset) { + tpl_bool_t is_activated = wayland_tbm_client_queue_check_activate( + wl_egl_display->wl_tbm_client, + wl_egl_surface->tbm_queue); + if (wl_egl_surface->is_activated != is_activated) { + if (is_activated) { + TPL_INFO("[ACTIVATED]", + "wl_egl_surface(%p) wl_surface(%p) tbm_queue(%p)", + wl_egl_surface, wl_egl_surface->wl_surface, wl_egl_surface->tbm_queue); + } else { + TPL_INFO("[DEACTIVATED]", + " wl_egl_surface(%p) wl_surface(%p) tbm_queue(%p)", + wl_egl_surface, wl_egl_surface->wl_surface, wl_egl_surface->tbm_queue); + } + } + + wl_egl_surface->is_activated = is_activated; + } /* If surface->frontbuffer is not null, the frontbuffer rendering mode will be * maintained if the surface state meets the conditions below. -- 2.34.1