Inline wsi_create_magma_surface() into its call site
This will make a later change clearer.
MA-214
Change-Id: I881ab383781cacee0a07e97dc4fa4d2a0b072800
diff --git a/src/intel/vulkan/anv_wsi_magma.cc b/src/intel/vulkan/anv_wsi_magma.cc
index 2bd5a9b..1fb85f0ab 100644
--- a/src/intel/vulkan/anv_wsi_magma.cc
+++ b/src/intel/vulkan/anv_wsi_magma.cc
@@ -26,8 +26,19 @@
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_MAGMA_SURFACE_CREATE_INFO_KHR);
- return wsi_create_magma_surface(pAllocator ? pAllocator : &instance->alloc, pCreateInfo,
- pSurface);
+ if (!pAllocator)
+ pAllocator = &instance->alloc;
+
+ auto surface = reinterpret_cast<VkIcdSurfaceMagma*>(
+ vk_alloc(pAllocator, sizeof(VkIcdSurfaceMagma), 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
+ if (!surface)
+ return VK_ERROR_OUT_OF_HOST_MEMORY;
+
+ surface->base.platform = VK_ICD_WSI_PLATFORM_MAGMA;
+
+ *pSurface = _VkIcdSurfaceBase_to_handle(&surface->base);
+
+ return VK_SUCCESS;
}
void* anv_wsi_magma_get_render_connection(VkDevice device)
diff --git a/src/vulkan/wsi/wsi_common_magma.cc b/src/vulkan/wsi/wsi_common_magma.cc
index 2010b24..780c704 100644
--- a/src/vulkan/wsi/wsi_common_magma.cc
+++ b/src/vulkan/wsi/wsi_common_magma.cc
@@ -473,21 +473,3 @@
{
return VK_TRUE;
}
-
-VkResult wsi_create_magma_surface(const VkAllocationCallbacks* pAllocator,
- const VkMagmaSurfaceCreateInfoKHR* pCreateInfo,
- VkSurfaceKHR* pSurface)
-{
- assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_MAGMA_SURFACE_CREATE_INFO_KHR);
-
- auto surface = reinterpret_cast<VkIcdSurfaceMagma*>(
- vk_alloc(pAllocator, sizeof(VkIcdSurfaceMagma), 8, VK_SYSTEM_ALLOCATION_SCOPE_OBJECT));
- if (!surface)
- return VK_ERROR_OUT_OF_HOST_MEMORY;
-
- surface->base.platform = VK_ICD_WSI_PLATFORM_MAGMA;
-
- *pSurface = _VkIcdSurfaceBase_to_handle(&surface->base);
-
- return VK_SUCCESS;
-}
diff --git a/src/vulkan/wsi/wsi_common_magma.h b/src/vulkan/wsi/wsi_common_magma.h
index 6daf496..a628c4d 100644
--- a/src/vulkan/wsi/wsi_common_magma.h
+++ b/src/vulkan/wsi/wsi_common_magma.h
@@ -13,9 +13,6 @@
VkAllocationCallbacks* alloc,
uint32_t queueFamilyIndex);
-VkResult wsi_create_magma_surface(const VkAllocationCallbacks* pAllocator,
- const VkMagmaSurfaceCreateInfoKHR* pCreateInfo,
- VkSurfaceKHR* pSurface);
}
#endif