tpl_wayland_egl_thread: Added surface capabilities to twe_display for vk backend. 62/161962/1
authorjoonbum.ko <joonbum.ko@samsung.com>
Tue, 26 Sep 2017 07:00:31 +0000 (16:00 +0900)
committerjoonbum.ko <joonbum.ko@samsung.com>
Mon, 27 Nov 2017 02:24:32 +0000 (11:24 +0900)
Change-Id: I68cc93c4c0c473d091b8d9f4023d7edfcd2b312f
Signed-off-by: joonbum.ko <joonbum.ko@samsung.com>
src/tpl_wayland_egl_thread.c

index 9894301..9982113 100644 (file)
@@ -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);