e_explicit_sync: use _e_explicit_sync_fd_move/clear function at the case of pending_a... 87/294987/1
authorSooChan Lim <sc1.lim@samsung.com>
Tue, 13 Jun 2023 11:50:05 +0000 (20:50 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 29 Jun 2023 08:31:02 +0000 (17:31 +0900)
Moving/Clearing fd to pending_acquire_fence_fd does not require to set the aquire_fence_fd to the e_client.
Only setting pending_acquire_fence_fd to aquire_fence_fd requires to set the fd to the e_client.

Change-Id: Ib27b4c9e0054e3bf48c594ab1b29184470198c38

src/bin/e_explicit_sync.c

index 8c3d6969f135f289a59ff7a7afb8a18c2fe31cca..2dcc59f577bdc84f7d6314e45207191e66e7df56 100644 (file)
@@ -52,6 +52,15 @@ _e_explicit_sync_fd_clear(int* fd)
    _e_explicit_sync_fd_set(fd, -1);
 }
 
+static void
+_e_explicit_sync_fd_move(int *dst, int *src)
+{
+   if (dst == src) return;
+
+   _e_explicit_sync_fd_set(dst, *src);
+   *src = -1;
+}
+
 static void
 _e_explicit_sync_ec_acquire_fd_move(E_Client *ec, int *dst, int *src)
 {
@@ -109,9 +118,7 @@ _e_explicit_sync_surface_cb_set_acquire_fence(struct wl_client *client,
         goto fail;
      }
 
-   _e_explicit_sync_ec_acquire_fd_move(explicit_sync_surface->ec,
-                                       &explicit_sync_surface->pending_acquire_fence_fd,
-                                       &fd);
+   _e_explicit_sync_fd_move(&explicit_sync_surface->pending_acquire_fence_fd, &fd);
 
    EX_SYNC_TRACE("Explicit_Sync Surface:%p Set Acquire fence fd:%d",
                  explicit_sync_surface->ec, explicit_sync_surface, fd);
@@ -322,7 +329,7 @@ _e_explicit_sync_surface_cb_resource_destroy(struct wl_resource *resource)
    EX_SYNC_TRACE("Explicit_Sync Surface:%p Destroy", explicit_sync_surface->ec, explicit_sync_surface);
 
    if (explicit_sync_surface->pending_acquire_fence_fd != -1)
-     _e_explicit_sync_ec_acquire_fd_clear(explicit_sync_surface->ec, &explicit_sync_surface->pending_acquire_fence_fd);
+     _e_explicit_sync_fd_clear(&explicit_sync_surface->pending_acquire_fence_fd);
 
    if (explicit_sync_surface->acquire_fence_fd != -1)
      _e_explicit_sync_ec_acquire_fd_clear(explicit_sync_surface->ec, &explicit_sync_surface->acquire_fence_fd);