tpl_wl_egl_thread: Fixed a bug that attempted an incorrect enqueue for the frontbuffer. 86/201586/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Mon, 18 Mar 2019 04:10:42 +0000 (13:10 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Mon, 18 Mar 2019 04:10:42 +0000 (13:10 +0900)
Change-Id: Ieb6149bfb0c2683ac663e30e6308266578fe71c9
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c
src/tpl_wl_egl_thread.c

index 7ae4966cf9fb1fdd1c8f8db191daf02aef13fbb0..ce438fff65bd26e72e5077da768cfab0ebb9e26e 100644 (file)
@@ -1354,6 +1354,7 @@ _twe_surface_set_wl_buffer_info(twe_wl_surf_source *surf_source,
                }
 
                buf_info->draw_done = TPL_FALSE;
+               buf_info->need_to_commit = TPL_TRUE;
                buf_info->sync_fd = -1;
 
                if (surf_source->in_use_buffers) {
index 685d8bb0b1baa74128721de79dfcd9a0b10474fa..2452d883c87673d5ab720cac8cd0ceb5a177a850 100644 (file)
@@ -535,6 +535,17 @@ __tpl_wl_egl_surface_enqueue_buffer(tpl_surface_t *surface,
                }
        }
 
+       if (!wayland_egl_surface->need_to_enqueue ||
+               !twe_surface_check_commit_needed(wayland_egl_surface->twe_surface,
+                                                                                tbm_surface)) {
+               TPL_LOG_T("WL_EGL",
+                                 "[ENQ_SKIP][Frontbuffer:%s] tbm_surface(%p) need not to enqueue",
+                                 ((surface->frontbuffer == tbm_surface) ? "ON" : "OFF"), tbm_surface);
+               TRACE_ASYNC_END((int)tbm_surface, "[DEQ]~[ENQ] BO_NAME:%d", bo_name);
+               TPL_OBJECT_UNLOCK(wayland_egl_surface);
+               return TPL_ERROR_NONE;
+       }
+
        /* In frontbuffer mode, will skip tbm_surface_queue_enqueue, acquire, and
         * commit if surface->frontbuffer that is already set and the tbm_surface
         * client want to enqueue are the same.
@@ -544,19 +555,6 @@ __tpl_wl_egl_surface_enqueue_buffer(tpl_surface_t *surface,
                 * committed. Subsequence frames do not need to be committed because
                 * the buffer is already displayed.
                 */
-
-               if (!wayland_egl_surface->need_to_enqueue ||
-                       (surface->frontbuffer == tbm_surface &&
-                               !twe_surface_check_commit_needed(wayland_egl_surface->twe_surface,
-                                                                                                surface->frontbuffer))) {
-                       TPL_LOG_T("WL_EGL",
-                                         "[ENQ_SKIP][F] Client already uses frontbuffer(%p)",
-                                         surface->frontbuffer);
-                       TRACE_ASYNC_END((int)tbm_surface, "[DEQ]~[ENQ] BO_NAME:%d", bo_name);
-                       TPL_OBJECT_UNLOCK(wayland_egl_surface);
-                       return TPL_ERROR_NONE;
-               }
-
                if (surface->frontbuffer == tbm_surface)
                        wayland_egl_surface->need_to_enqueue = TPL_FALSE;
        }