From: Joonbum Ko Date: Wed, 8 Apr 2020 11:35:19 +0000 (+0900) Subject: [explicit_sync] Implemented initial steps and setup build dependency. X-Git-Tag: submit/tizen/20200810.080631~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=dc1160f0c103e8de67dbaf6413b382273d277b60;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git [explicit_sync] Implemented initial steps and setup build dependency. - 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 --- diff --git a/packaging/libtpl-egl.spec b/packaging/libtpl-egl.spec index 7a8b61f..d5a8f4a 100644 --- a/packaging/libtpl-egl.spec +++ b/packaging/libtpl-egl.spec @@ -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 diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 6cd5c58..7d96dcd 100755 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -11,6 +11,7 @@ #include #include #include +#include #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