Set presentation/commit_sync_fd of wl_egl_buffer 83/254783/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Thu, 4 Feb 2021 09:23:24 +0000 (18:23 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Tue, 9 Mar 2021 08:51:44 +0000 (17:51 +0900)
Change-Id: Ib0140c1b31beabffa939cae10cc04bebccb00d5c
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_wl_egl.c

index cea25e9..878b41f 100644 (file)
@@ -2431,6 +2431,22 @@ __tpl_wl_egl_surface_enqueue_buffer(tpl_surface_t *surface,
        wl_egl_buffer->acquire_fence_fd = acquire_fence;
        wl_egl_buffer->status = ENQUEUED;
 
+       tpl_gmutex_lock(&wl_egl_surface->presentation_sync.mutex);
+       if (wl_egl_surface->presentation_sync.fd != -1) {
+               wl_egl_buffer->presentation_sync_fd  = wl_egl_surface->presentation_sync.fd;
+               wl_egl_surface->presentation_sync.fd = -1;
+       }
+       tpl_gmutex_unlock(&wl_egl_surface->presentation_sync.mutex);
+
+       tpl_gmutex_lock(&wl_egl_surface->commit_sync.mutex);
+       if (wl_egl_surface->commit_sync.fd != -1) {
+               wl_egl_buffer->commit_sync_fd  = wl_egl_surface->commit_sync.fd;
+               wl_egl_surface->commit_sync.fd = -1;
+               TRACE_ASYNC_BEGIN(wl_egl_buffer->commit_sync_fd, "[COMMIT_SYNC] bo(%d)",
+                                                 _get_tbm_surface_bo_name(tbm_surface));
+       }
+       tpl_gmutex_unlock(&wl_egl_surface->commit_sync.mutex);
+
        tpl_gmutex_unlock(&wl_egl_buffer->mutex);
 
        tsq_err = tbm_surface_queue_enqueue(wl_egl_surface->tbm_queue,
@@ -2815,7 +2831,8 @@ __cb_presentation_feedback_presented(void *data,
                TRACE_ASYNC_END(wl_egl_buffer->presentation_sync_fd,
                                                "[PRESENTATION_SYNC] bo(%d)",
                                                _get_tbm_surface_bo_name(tbm_surface));
-
+               TPL_DEBUG("[PRESENTATION_SYNC_FD_CLOSE] wl_egl_buffer(%p) presentation_sync_fd(%d)",
+                                 wl_egl_buffer, wl_egl_buffer->presentation_sync_fd);
                close(wl_egl_buffer->presentation_sync_fd);
                wl_egl_buffer->presentation_sync_fd = -1;
        }