e_hwc_window_queue: set copy buffer to comp object even if client destroys front... 09/301009/1
authorChangyeon Lee <cyeon.lee@samsung.com>
Mon, 6 Nov 2023 10:58:16 +0000 (19:58 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Tue, 7 Nov 2023 04:46:49 +0000 (13:46 +0900)
this patch fixes problem that reserved memory is used by front buffer and client rendering
at the same time in case of client destroys front buffer before e_hwc_window sent
wl_tbm_queue_send_deactive.

Change-Id: Ic884dda2c4bb2d68749aa05e828d897c9b8b5439

src/bin/e_hwc_window_queue.c

index 53dbe0392bb2c6c954834fa5e0e711b431fa0541..a76150f5c51af3c3fdcc9a0eade39ca77bea8307 100644 (file)
@@ -1328,6 +1328,7 @@ _e_hwc_window_queue_copy_thread_run_end_cb(void *data, Ecore_Thread *thread)
            copy_thread_data->src_tsurface);
 
    if (!(ec = copy_thread_data->hwc_window->ec)) goto end;
+   if (!e_client_cdata_get(ec)) goto end;
 
    if ((!evas_object_visible_get(ec->frame)) &&
        (ec->exp_iconify.buffer_flush) &&
@@ -1335,9 +1336,11 @@ _e_hwc_window_queue_copy_thread_run_end_cb(void *data, Ecore_Thread *thread)
      goto end;
 
    comp_buffer = _comp_wl_buffer_get(ec);
-   if (!comp_buffer) goto end;
-   if (!comp_buffer->tbm_surface) goto end;
-   if (comp_buffer->tbm_surface != copy_thread_data->src_tsurface) goto end;
+   if (comp_buffer)
+     {
+        if (!comp_buffer->tbm_surface) goto end;
+        if (comp_buffer->tbm_surface != copy_thread_data->src_tsurface) goto end;
+     }
 
    copy_comp_buffer = e_comp_wl_tbm_buffer_get(copy_thread_data->dst_tsurface);
    EINA_SAFETY_ON_NULL_GOTO(copy_comp_buffer, end);
@@ -1350,6 +1353,9 @@ _e_hwc_window_queue_copy_thread_run_end_cb(void *data, Ecore_Thread *thread)
    e_comp_object_dirty(ec->frame);
    e_comp_object_render(ec->frame);
 
+   if (!comp_buffer)
+     e_comp_wl_surface_attach(ec, NULL);
+
 end:
    _e_hwc_window_queue_copy_thread_data_destroy(copy_thread_data);