From d5aaa60cd2890e7fcf389910a761ffb400dfeb69 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Tue, 26 Sep 2017 16:00:31 +0900 Subject: [PATCH] tpl_wayland_egl_thread: Added surface capabilities to twe_display for vk backend. Change-Id: I68cc93c4c0c473d091b8d9f4023d7edfcd2b312f Signed-off-by: joonbum.ko --- src/tpl_wayland_egl_thread.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/tpl_wayland_egl_thread.c b/src/tpl_wayland_egl_thread.c index 9894301..9982113 100644 --- a/src/tpl_wayland_egl_thread.c +++ b/src/tpl_wayland_egl_thread.c @@ -20,6 +20,7 @@ static int buffer_info_key; #define KEY_BUFFER_INFO (unsigned long)(&buffer_info_key) #define CLIENT_QUEUE_SIZE 3 +#define VK_CLIENT_QUEUE_SIZE 3 typedef struct _twe_wl_disp_source twe_wl_disp_source; typedef struct _twe_wl_surf_source twe_wl_surf_source; @@ -59,6 +60,13 @@ struct _twe_wl_disp_source { struct wl_event_queue *ev_queue; struct wayland_tbm_client *wl_tbm_client; struct tizen_surface_shm *tss; /* used for surface buffer_flush */ + struct { + int min_buffer; + int max_buffer; + int present_modes; + } surface_capabilities; + struct wayland_vulkan *wl_vk_client; + tpl_bool_t is_vulkan_dpy; tpl_bool_t prepared; twe_del_source *disp_del_source; twe_thread *thread; @@ -810,6 +818,21 @@ twe_display_add(twe_thread* thread, source->gfd.revents = 0; __tpl_object_init(&source->obj, TPL_OBJECT_DISPLAY, NULL); + if (backend == TPL_BACKEND_WAYLAND_VULKAN_WSI) { + source->is_vulkan_dpy = TPL_TRUE; + source->surface_capabilities.min_buffer = 2; + source->surface_capabilities.max_buffer = VK_CLIENT_QUEUE_SIZE; + source->surface_capabilities.present_modes = + TPL_DISPLAY_PRESENT_MODE_MAILBOX; + } else { /* wayland_egl backend */ + /* These are not used. It just be initialized. */ + source->is_vulkan_dpy = TPL_FALSE; + source->surface_capabilities.min_buffer = 2; + source->surface_capabilities.max_buffer = CLIENT_QUEUE_SIZE; + source->surface_capabilities.present_modes = + TPL_DISPLAY_PRESENT_MODE_FIFO; + } + _twe_display_shm_init(source); source->disp_del_source = _twe_del_source_init(ctx, source); -- 2.7.4