[explicit_sync] Implemented initial steps and setup build dependency. 92/238992/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Wed, 8 Apr 2020 11:35:19 +0000 (20:35 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Tue, 21 Jul 2020 03:46:26 +0000 (12:46 +0900)
 - wayland-extension : zwp_linux_explicit_synchronization_v1
  This extension is classified unstable protocol.
  Therefore, it can be modified later.

Change-Id: Ibe47c87fce63e85b6f2a04aca59f4332072f2d7b
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
packaging/libtpl-egl.spec
src/tpl_wayland_egl_thread.c

index 7a8b61fb4556981cccc8a054d08628c66674a7fd..d5a8f4a2ba95dfa6bc7110f83bfc43feb299c9b3 100644 (file)
@@ -80,6 +80,7 @@ BuildRequires:        pkgconfig(wayland-tbm-client)
 BuildRequires: pkgconfig(wayland-tbm-server)
 BuildRequires: pkgconfig(tizen-surface-client)
 BuildRequires:  pkgconfig(presentation-time-client)
+BuildRequires:  pkgconfig(linux-explicit-synchronization-unstable-v1-client)
 BuildRequires: pkgconfig(glib-2.0)
 %endif
 
index 6cd5c586203dde5db5ec2310c5eb7a08d00c513a..7d96dcd2bd908adab3cbf5912b8042f797acce85 100755 (executable)
@@ -11,6 +11,7 @@
 #include <tizen-surface-client-protocol.h>
 #include <wayland-egl-backend.h>
 #include <presentation-time-client-protocol.h>
+#include <linux-explicit-synchronization-unstable-v1-client-protocol.h>
 
 #include "tpl_utils.h"
 #include "tpl_internal.h"
@@ -70,6 +71,7 @@ struct _twe_wl_disp_source {
        struct wayland_tbm_client *wl_tbm_client;
        struct tizen_surface_shm *tss; /* used for surface buffer_flush */
        struct wp_presentation *presentation;
+       struct zwp_linux_explicit_synchronization_v1 *explicit_sync;
        struct {
                int min_buffer;
                int max_buffer;
@@ -896,21 +898,22 @@ __cb_wl_resistry_global_callback(void *data, struct wl_registry *wl_registry,
                                                                                        &tizen_surface_shm_interface,
                                                                                        ((version < IMPL_TIZEN_SURFACE_SHM_VERSION) ?
                                                                                         version : IMPL_TIZEN_SURFACE_SHM_VERSION));
-       }
-
-       if (disp_source->is_vulkan_dpy
-                       && !strcmp(interface, "wayland_vulkan")) {
+       } else if (disp_source->is_vulkan_dpy
+                          && !strcmp(interface, "wayland_vulkan")) {
                disp_source->wl_vk_client =
                        wl_registry_bind(wl_registry, name,
                                                         &wayland_vulkan_interface,
                                                         version);
-       }
-
-       if (!strcmp(interface, wp_presentation_interface.name)) {
-               disp_source->presentation =
-                       wl_registry_bind(wl_registry,
-                                        name, &wp_presentation_interface, 1);
+       } else if (!strcmp(interface, wp_presentation_interface.name)) {
+                          disp_source->presentation =
+                                       wl_registry_bind(wl_registry,
+                                                                        name, &wp_presentation_interface, 1);
                TPL_DEBUG("bind wp_presentation_interface");
+       } else if (strcmp(interface, "zwp_linux_explicit_synchronization_v1") == 0) {
+                          disp_source->explicit_sync =
+                                       wl_registry_bind(wl_registry, name,
+                                                       &zwp_linux_explicit_synchronization_v1_interface, 1);
+               TPL_DEBUG("bind zwp_linux_explicit_synchronization_v1_interface");
        }
 }
 
@@ -997,6 +1000,13 @@ _twe_display_wayland_init(twe_wl_disp_source *disp_source)
                TPL_LOG_T(BACKEND, "wp_presentation(%p) init.", disp_source->presentation);
        }
 
+       if (disp_source->explicit_sync) {
+               wl_proxy_set_queue((struct wl_proxy *)disp_source->explicit_sync,
+                                                  disp_source->ev_queue);
+               TPL_LOG_T(BACKEND, "zwp_linux_explicit_synchronization_v1(%p) init.",
+                                 disp_source->explicit_sync);
+       }
+
 fini:
        if (display_wrapper)
                wl_proxy_wrapper_destroy(display_wrapper);
@@ -1026,6 +1036,13 @@ _twe_display_wayland_fini(twe_wl_disp_source *disp_source)
                wp_presentation_destroy(disp_source->presentation);
                disp_source->presentation = NULL;
        }
+
+       if (disp_source->explicit_sync) {
+               TPL_LOG_T(BACKEND, "zwp_linux_explicit_synchronization_v1(%p) fini.",
+                                 disp_source->explicit_sync);
+               zwp_linux_explicit_synchronization_v1_destroy(disp_source->explicit_sync);
+               disp_source->explicit_sync = NULL;
+       }
 }
 
 static void