From 52cbfd2f3f1afd29b4428e7c7c40aeb78d277197 Mon Sep 17 00:00:00 2001 From: Changyeon Lee Date: Mon, 22 Apr 2024 16:08:29 +0900 Subject: [PATCH] e_hwc_window_queue: fix the problem of releasing tbm_surface used by front buffer do not release tbm_surface untill client send request of deatch or destroy of buffer Change-Id: I81141fe32664df09d1c5761b509e4b860047c2bc --- src/bin/e_hwc_window_queue.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/bin/e_hwc_window_queue.c b/src/bin/e_hwc_window_queue.c index e5f9d931fb..735fca94a3 100644 --- a/src/bin/e_hwc_window_queue.c +++ b/src/bin/e_hwc_window_queue.c @@ -1021,7 +1021,18 @@ _e_hwc_window_queue_copy_thread_data_destroy(E_Hwc_Window_Queue_Copy_Thread_Data queue_buffer->copying = EINA_FALSE; if ((!queue_buffer->acquired) && (queue_buffer->dequeued)) - e_hwc_window_queue_buffer_release(copy_thread_data->queue, queue_buffer); + { + if ((copy_thread_data->queue->state == E_HWC_WINDOW_QUEUE_STATE_UNSET_WAITING) && + (queue_buffer->usable) && (queue_buffer->exported)) + { + EHWQINF("Wait detach ts:%p tq:%p", NULL, NULL, copy_thread_data->queue, + queue_buffer->tsurface, copy_thread_data->queue->tqueue); + } + else + { + e_hwc_window_queue_buffer_release(copy_thread_data->queue, queue_buffer); + } + } } e_object_unref(E_OBJECT(copy_thread_data->queue)); @@ -2389,7 +2400,21 @@ e_hwc_window_queue_buffer_reference(E_Hwc_Window_Queue_Buffer_Ref *ref, E_Hwc_Wi if (ref->buffer->busy == 0) { if (ref->buffer->queue) - e_hwc_window_queue_buffer_release(ref->buffer->queue, ref->buffer); + { + if ((ref->buffer->queue->state == E_HWC_WINDOW_QUEUE_STATE_UNSET_WAITING) && + (ref->buffer->usable) && (ref->buffer->exported)) + { + ref->buffer->acquired = EINA_FALSE; + ref->buffer->dequeued = EINA_TRUE; + + EHWQINF("Wait detach ts:%p tq:%p", NULL, NULL, ref->buffer->queue, + ref->buffer->tsurface, ref->buffer->queue->tqueue); + } + else + { + e_hwc_window_queue_buffer_release(ref->buffer->queue, ref->buffer); + } + } } if (ref->destroy_listener.notify) -- 2.34.1