tpl_wayland_egl: Modified to remove only flushed buffers from committed_wl_buffers. 98/185498/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Tue, 31 Jul 2018 07:13:01 +0000 (16:13 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Tue, 31 Jul 2018 07:15:51 +0000 (16:15 +0900)
 - If flush_callback removes all buffers from committed_wl_buffers,
  it can cause problems on non-iconified surfaces if they are multi-surfaces.

Change-Id: I6f1e6d6faa024e15961669bcfef1c6d62dc89037
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl.c

index 3dc6f43..7bc48bb 100644 (file)
@@ -1734,9 +1734,19 @@ static void __cb_tizen_surface_shm_flusher_flush_callback(void *data,
                        tbm_surface_queue_error_e tsq_err;
                        tbm_surface_h tbm_surface =
                                __tpl_list_pop_front(wayland_egl_surface->attached_buffers, NULL);
+                       tpl_wayland_egl_buffer_t *wayland_egl_buffer =
+                               __tpl_wayland_egl_get_wayland_buffer_from_tbm_surface(tbm_surface);
+
                        TRACE_ASYNC_END((int)tbm_surface, "[COMMIT ~ RELEASE_CB] BO_NAME:%d",
                                                        tbm_bo_export(tbm_surface_internal_get_bo(
                                                                tbm_surface, 0)));
+
+                       if (wayland_egl_buffer && pthread_mutex_lock(&g_list_mutex) == 0) {
+                               __tpl_list_remove_data(committed_wl_buffers, (void *)wayland_egl_buffer->wl_proxy,
+                                                                          TPL_FIRST, NULL);
+                               pthread_mutex_unlock(&g_list_mutex);
+                       }
+
                        tbm_surface_internal_unref(tbm_surface);
                        tsq_err = tbm_surface_queue_release(wayland_egl_surface->tbm_queue, tbm_surface);
                        if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE)
@@ -1746,11 +1756,6 @@ static void __cb_tizen_surface_shm_flusher_flush_callback(void *data,
        }
        TPL_OBJECT_UNLOCK(&wayland_egl_surface->base);
 
-       if (pthread_mutex_lock(&g_list_mutex) == 0) {
-               __tpl_list_fini(committed_wl_buffers, NULL);
-               pthread_mutex_unlock(&g_list_mutex);
-       }
-
        if (lock_res == 0) pthread_mutex_unlock(&wayland_egl_display->wl_event_mutex);
 }