From: deasung.kim Date: Wed, 14 Dec 2016 09:32:29 +0000 (+0900) Subject: tbm_queue_surface : implement vkCreateTBMQueueSurfaceKHR X-Git-Tag: submit/submit/tizen/20170906.070327/20170906.070422~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e826eae38e178a0f851f91b1cb48096172f7a6b3;p=platform%2Fcore%2Fuifw%2Fvulkan-wsi-tizen.git tbm_queue_surface : implement vkCreateTBMQueueSurfaceKHR added vk_tbm_queue_surface structure Change-Id: I3b2da3bf4d90d93c0247dc7332872b8a21747cd4 --- diff --git a/src/wsi/entry-points.c b/src/wsi/entry-points.c index 143f2d3..b6ecacd 100644 --- a/src/wsi/entry-points.c +++ b/src/wsi/entry-points.c @@ -64,6 +64,7 @@ static const vk_entry_t entry_points[] = { VK_ENTRY_POINT(GetPhysicalDeviceWaylandPresentationSupportKHR,INSTANCE), VK_ENTRY_POINT(GetInstanceProcAddr, INSTANCE), VK_ENTRY_POINT(GetDeviceProcAddr, DEVICE), + VK_ENTRY_POINT(CreateTBMQueueSurfaceKHR, INSTANCE), }; static const vk_entry_t * diff --git a/src/wsi/surface.c b/src/wsi/surface.c index 5a91849..f9492a7 100644 --- a/src/wsi/surface.c +++ b/src/wsi/surface.c @@ -395,3 +395,26 @@ vk_GetPhysicalDeviceSurfacePresentModesKHR(VkPhysicalDevice pdev, return VK_ERROR_EXTENSION_NOT_PRESENT; } } + +VKAPI_ATTR VkResult VKAPI_CALL +vk_CreateTBMQueueSurfaceKHR(VkInstance instance, + const tbm_bufmgr bufmgr, + const tbm_surface_queue_h queue, + const VkAllocationCallbacks *allocator, + VkSurfaceKHR *surface) +{ + vk_tbm_queue_surface_t *sfc = NULL; + + allocator = vk_get_allocator(instance, allocator); + + sfc = vk_alloc(allocator, sizeof(vk_tbm_queue_surface_t), VK_SYSTEM_ALLOCATION_SCOPE_OBJECT); + VK_CHECK(sfc, return VK_ERROR_OUT_OF_HOST_MEMORY, "vk_alloc() failed.\n"); + + sfc->base.platform = VK_ICD_WSI_PLATFORM_TBM_QUEUE; + sfc->bufmgr = bufmgr; + sfc->tbm_queue = queue; + + *surface = (VkSurfaceKHR)(uintptr_t)sfc; + + return VK_SUCCESS; +} diff --git a/src/wsi/wsi.h b/src/wsi/wsi.h index a6eebbc..1980e3c 100644 --- a/src/wsi/wsi.h +++ b/src/wsi/wsi.h @@ -48,6 +48,7 @@ typedef struct vk_display vk_display_t; typedef struct vk_display_plane vk_display_plane_t; typedef struct vk_display_mode vk_display_mode_t; typedef struct vk_icd vk_icd_t; +typedef struct vk_tbm_queue_surface vk_tbm_queue_surface_t; struct vk_icd { void *lib; @@ -147,6 +148,12 @@ struct vk_swapchain { void *backend_data; }; +struct vk_tbm_queue_surface { + VkIcdSurfaceBase base; + tbm_bufmgr bufmgr; + tbm_surface_queue_h tbm_queue; +}; + VkBool32 vk_physical_device_init_display(vk_physical_device_t *pdev); @@ -273,4 +280,8 @@ VKAPI_ATTR VkResult VKAPI_CALL vk_EnumerateDeviceExtensionProperties(VkPhysicalDevice pdev, const char *layer_name, uint32_t *count, VkExtensionProperties *extensions); +VKAPI_ATTR VkResult VKAPI_CALL +vk_CreateTBMQueueSurfaceKHR(VkInstance instance, + const tbm_bufmgr bufmgr, const tbm_surface_queue_h queue, + const VkAllocationCallbacks *pAllocator, VkSurfaceKHR *surface); #endif /* WSI_H */