Added boolean use_explicit_sync to disp_source.
authorJoonbum Ko <joonbum.ko@samsung.com>
Mon, 1 Jun 2020 06:56:32 +0000 (15:56 +0900)
committerSooChan Lim <sc1.lim@samsung.com>
Mon, 10 Aug 2020 08:14:59 +0000 (17:14 +0900)
Change-Id: I723669463d542aebbc7ceb365dc4d0dedfd7fe29
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index d9645dd9b8db461ff56d712f5b61559aa83ba79b..884ad7720b1a5fe4852c3e7797e1f79f0267651b 100755 (executable)
@@ -72,6 +72,7 @@ struct _twe_wl_disp_source {
        struct tizen_surface_shm *tss; /* used for surface buffer_flush */
        struct wp_presentation *presentation;
        struct zwp_linux_explicit_synchronization_v1 *explicit_sync;
+       tpl_bool_t use_explicit_sync;
        struct {
                int min_buffer;
                int max_buffer;
@@ -911,14 +912,15 @@ __cb_wl_resistry_global_callback(void *data, struct wl_registry *wl_registry,
                                                         &wayland_vulkan_interface,
                                                         version);
        } else if (!strcmp(interface, wp_presentation_interface.name)) {
-                          disp_source->presentation =
+               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 =
+               disp_source->explicit_sync =
                                        wl_registry_bind(wl_registry, name,
                                                        &zwp_linux_explicit_synchronization_v1_interface, 1);
+               disp_source->use_explicit_sync = TPL_TRUE;
                TPL_DEBUG("bind zwp_linux_explicit_synchronization_v1_interface");
        }
 }
@@ -1135,6 +1137,10 @@ twe_display_add(twe_thread* thread,
                source->is_vulkan_dpy = TPL_FALSE;
        }
 
+       /* It will be changed to TPL_TRUE when zwp_linux_explicit_synchronization_v1
+        * succeeds to bind. */
+       source->use_explicit_sync = TPL_FALSE;
+
        source->surface_capabilities.min_buffer = 2;
        source->surface_capabilities.max_buffer = VK_CLIENT_QUEUE_SIZE;
        source->surface_capabilities.present_modes =
@@ -3029,7 +3035,7 @@ twe_surface_add(twe_thread* thread,
 
        _twe_surface_buffer_flusher_init(source);
 
-       if (disp_source->explicit_sync) {
+       if (disp_source->explicit_sync && disp_source->use_explicit_sync) {
                source->surface_sync =
                        zwp_linux_explicit_synchronization_v1_get_synchronization(
                                        disp_source->explicit_sync, source->surf);