tpl_wayland_egl: Modified to set the acquired buffer to frontbuffer. 10/192710/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Thu, 8 Nov 2018 05:39:38 +0000 (14:39 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Thu, 8 Nov 2018 05:57:51 +0000 (14:57 +0900)
 - Before this patch, tpl used dequeued buffer as frontbuffer.
  But using dequeued buffer as frontbuffer can cause
   sequential error of tbm_surface_queue with GUARANTEE_CYCLE_MODE
   when the frontbuffer mode is terminated by an external factor.

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

index 1dbdf49..5b2431f 100644 (file)
@@ -954,26 +954,25 @@ __tpl_wayland_egl_surface_enqueue_buffer(tpl_surface_t *surface,
         * client want to enqueue are the same.
         */
        if (surface->is_frontbuffer_mode && surface->frontbuffer == tbm_surface) {
-               TPL_LOG_B("WL_EGL",
-                                 "[ENQ_SKIP][F] Client already uses frontbuffer(%p)",
-                                 surface->frontbuffer);
-
                /* The first buffer to be activated in frontbuffer mode muse be
                 * committed. Subsequence frames do not need to be committed because
                 * the buffer is already displayed.
                 */
                if (wayland_egl_buffer->is_new) {
-                       __tpl_wayland_egl_surface_commit(surface, tbm_surface,
-                                                                                        num_rects, rects);
-                       wayland_egl_buffer->is_new = TPL_FALSE;
+                       TPL_DEBUG("[FRONTBUFFER RENDERING MODE] tbm_surface(%p) bo(%d)",
+                                         tbm_surface, tbm_bo_export(wayland_egl_buffer->bo));
                } else {
+                       TPL_LOG_B("WL_EGL",
+                                 "[ENQ_SKIP][F] Client already uses frontbuffer(%p)",
+                                 surface->frontbuffer);
                        TRACE_ASYNC_END((int)wayland_egl_buffer, "[DEQ]~[ENQ] BO_NAME:%d",
                                                        tbm_bo_export(wayland_egl_buffer->bo));
+                       return TPL_ERROR_NONE;
                }
-
-               return TPL_ERROR_NONE;
        }
 
+       wayland_egl_buffer->is_new = TPL_FALSE;
+
        if (wayland_egl_surface->vblank_done == TPL_FALSE)
                __tpl_wayland_egl_surface_wait_vblank(surface);
 
index ef1675c..aaa73d0 100644 (file)
@@ -1348,7 +1348,6 @@ _twe_surface_set_wl_buffer_info(twe_wl_surf_source *surf_source,
                        buf_info->num_rects = 0;
                }
 
-               buf_info->need_to_commit = TPL_TRUE;
                buf_info->draw_done = TPL_FALSE;
                buf_info->sync_fd = -1;
 
index 07ba6cc..f8fd4f1 100644 (file)
@@ -546,15 +546,12 @@ __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 (twe_surface_check_commit_needed(wayland_egl_surface->twe_surface,
-                                                                                       surface->frontbuffer)) {
-                       twe_surface_commit_without_enqueue(wayland_egl_surface->twe_surface,
-                                                                                          surface->frontbuffer);
+               if (!twe_surface_check_commit_needed(wayland_egl_surface->twe_surface,
+                                                                                        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;
                }
-
-               TRACE_ASYNC_END((int)tbm_surface, "[DEQ]~[ENQ] BO_NAME:%d", bo_name);
-               TPL_OBJECT_UNLOCK(wayland_egl_surface);
-               return TPL_ERROR_NONE;
        }
 
        if (sync_fence != -1) {