Remove wl_egl_buffer from vblank list when it freed. 33/268433/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Wed, 22 Dec 2021 08:16:12 +0000 (17:16 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Thu, 23 Dec 2021 01:38:58 +0000 (10:38 +0900)
 - If the wl_egl_buffer is forcibly free from the buffer_clear(),
  the invalid wl_egl_buffer remains in vblank->waiting_buffers.
 - This invalid pointer should be removed from the list
  when wl_egl_buffer free.

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

index 81f8253..257de88 100755 (executable)
@@ -3485,6 +3485,13 @@ __cb_wl_egl_buffer_free(tpl_wl_egl_buffer_t *wl_egl_buffer)
        }
        tpl_gmutex_unlock(&wl_egl_surface->buffers_mutex);
 
+       tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
+       __tpl_list_remove_data(wl_egl_surface->vblank->waiting_buffers,
+                                                  (void *)wl_egl_buffer,
+                                                  TPL_FIRST,
+                                                  NULL);
+       tpl_gmutex_unlock(&wl_egl_surface->surf_mutex);
+
        if (wl_egl_display) {
                if (wl_egl_buffer->wl_buffer) {
                        wayland_tbm_client_destroy_buffer(wl_egl_display->wl_tbm_client,