[Mesa-dev] [PATCH 08/22] anv/wsi: remove device from get_support interface

Dave Airlie airlied at gmail.com
Mon Oct 17 04:24:31 UTC 2016


From: Dave Airlie <airlied at redhat.com>

replace with wsi_device and allocator.
---
 src/intel/vulkan/anv_wsi.c         | 4 +++-
 src/intel/vulkan/anv_wsi.h         | 3 ++-
 src/intel/vulkan/anv_wsi_wayland.c | 3 ++-
 src/intel/vulkan/anv_wsi_x11.c     | 5 +++--
 4 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index 767fa79..a77cfe9 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -81,7 +81,9 @@ VkResult anv_GetPhysicalDeviceSurfaceSupportKHR(
    ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface);
    struct anv_wsi_interface *iface = device->wsi_device.wsi[surface->platform];
 
-   return iface->get_support(surface, device, queueFamilyIndex, pSupported);
+   return iface->get_support(surface, &device->wsi_device,
+                             &device->instance->alloc,
+                             queueFamilyIndex, pSupported);
 }
 
 VkResult anv_GetPhysicalDeviceSurfaceCapabilitiesKHR(
diff --git a/src/intel/vulkan/anv_wsi.h b/src/intel/vulkan/anv_wsi.h
index e1c8d02..7bd938b 100644
--- a/src/intel/vulkan/anv_wsi.h
+++ b/src/intel/vulkan/anv_wsi.h
@@ -30,7 +30,8 @@ struct anv_swapchain;
 
 struct anv_wsi_interface {
    VkResult (*get_support)(VkIcdSurfaceBase *surface,
-                           struct anv_physical_device *device,
+                           struct anv_wsi_device *wsi_device,
+                           const VkAllocationCallbacks *alloc,
                            uint32_t queueFamilyIndex,
                            VkBool32* pSupported);
    VkResult (*get_capabilities)(VkIcdSurfaceBase *surface,
diff --git a/src/intel/vulkan/anv_wsi_wayland.c b/src/intel/vulkan/anv_wsi_wayland.c
index 2c9eecf..d0b7606 100644
--- a/src/intel/vulkan/anv_wsi_wayland.c
+++ b/src/intel/vulkan/anv_wsi_wayland.c
@@ -332,7 +332,8 @@ VkBool32 anv_GetPhysicalDeviceWaylandPresentationSupportKHR(
 
 static VkResult
 wsi_wl_surface_get_support(VkIcdSurfaceBase *surface,
-                           struct anv_physical_device *device,
+                           struct anv_wsi_device *wsi_device,
+                           const VkAllocationCallbacks *alloc,
                            uint32_t queueFamilyIndex,
                            VkBool32* pSupported)
 {
diff --git a/src/intel/vulkan/anv_wsi_x11.c b/src/intel/vulkan/anv_wsi_x11.c
index 6eb06c3..f438e5b 100644
--- a/src/intel/vulkan/anv_wsi_x11.c
+++ b/src/intel/vulkan/anv_wsi_x11.c
@@ -306,7 +306,8 @@ x11_surface_get_window(VkIcdSurfaceBase *icd_surface)
 
 static VkResult
 x11_surface_get_support(VkIcdSurfaceBase *icd_surface,
-                        struct anv_physical_device *device,
+                        struct anv_wsi_device *wsi_device,
+                        const VkAllocationCallbacks *alloc,
                         uint32_t queueFamilyIndex,
                         VkBool32* pSupported)
 {
@@ -314,7 +315,7 @@ x11_surface_get_support(VkIcdSurfaceBase *icd_surface,
    xcb_window_t window = x11_surface_get_window(icd_surface);
 
    struct wsi_x11_connection *wsi_conn =
-      wsi_x11_get_connection(&device->wsi_device, &device->instance->alloc, conn);
+      wsi_x11_get_connection(wsi_device, alloc, conn);
    if (!wsi_conn)
       return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
 
-- 
2.5.5



More information about the mesa-dev mailing list