From: Dave Airlie Date: Fri, 14 Oct 2016 05:36:17 +0000 (+0100) Subject: anv/wsi: remove all anv references from WSI common code X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ec0bc14a700c2503d834ac0763f4cfbe312998fa;p=mesa.git anv/wsi: remove all anv references from WSI common code the WSI code should be now be clean for sharing. Reviewed-by: Jason Ekstrand --- diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 3a60199b40b..0e258276c60 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -473,7 +473,7 @@ struct anv_physical_device { uint32_t eu_total; uint32_t subslice_total; - struct anv_wsi_device wsi_device; + struct wsi_device wsi_device; }; struct anv_instance { diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c index bdf14257a9f..064581d5d38 100644 --- a/src/intel/vulkan/anv_wsi.c +++ b/src/intel/vulkan/anv_wsi.c @@ -25,7 +25,7 @@ #include "wsi_common.h" #include "vk_format_info.h" -static const struct anv_wsi_callbacks anv_wsi_cbs = { +static const struct wsi_callbacks wsi_cbs = { .get_phys_device_format_properties = anv_GetPhysicalDeviceFormatProperties, }; @@ -37,18 +37,18 @@ anv_init_wsi(struct anv_physical_device *physical_device) memset(physical_device->wsi_device.wsi, 0, sizeof(physical_device->wsi_device.wsi)); #ifdef VK_USE_PLATFORM_XCB_KHR - result = anv_x11_init_wsi(&physical_device->wsi_device, &physical_device->instance->alloc); + result = wsi_x11_init_wsi(&physical_device->wsi_device, &physical_device->instance->alloc); if (result != VK_SUCCESS) return result; #endif #ifdef VK_USE_PLATFORM_WAYLAND_KHR - result = anv_wl_init_wsi(&physical_device->wsi_device, &physical_device->instance->alloc, + result = wsi_wl_init_wsi(&physical_device->wsi_device, &physical_device->instance->alloc, anv_physical_device_to_handle(physical_device), - &anv_wsi_cbs); + &wsi_cbs); if (result != VK_SUCCESS) { #ifdef VK_USE_PLATFORM_XCB_KHR - anv_x11_finish_wsi(&physical_device->wsi_device, &physical_device->instance->alloc); + wsi_x11_finish_wsi(&physical_device->wsi_device, &physical_device->instance->alloc); #endif return result; } @@ -61,10 +61,10 @@ void anv_finish_wsi(struct anv_physical_device *physical_device) { #ifdef VK_USE_PLATFORM_WAYLAND_KHR - anv_wl_finish_wsi(&physical_device->wsi_device, &physical_device->instance->alloc); + wsi_wl_finish_wsi(&physical_device->wsi_device, &physical_device->instance->alloc); #endif #ifdef VK_USE_PLATFORM_XCB_KHR - anv_x11_finish_wsi(&physical_device->wsi_device, &physical_device->instance->alloc); + wsi_x11_finish_wsi(&physical_device->wsi_device, &physical_device->instance->alloc); #endif } @@ -87,7 +87,7 @@ VkResult anv_GetPhysicalDeviceSurfaceSupportKHR( { ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface); - struct anv_wsi_interface *iface = device->wsi_device.wsi[surface->platform]; + struct wsi_interface *iface = device->wsi_device.wsi[surface->platform]; return iface->get_support(surface, &device->wsi_device, &device->instance->alloc, @@ -101,7 +101,7 @@ VkResult anv_GetPhysicalDeviceSurfaceCapabilitiesKHR( { ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface); - struct anv_wsi_interface *iface = device->wsi_device.wsi[surface->platform]; + struct wsi_interface *iface = device->wsi_device.wsi[surface->platform]; return iface->get_capabilities(surface, pSurfaceCapabilities); } @@ -114,7 +114,7 @@ VkResult anv_GetPhysicalDeviceSurfaceFormatsKHR( { ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface); - struct anv_wsi_interface *iface = device->wsi_device.wsi[surface->platform]; + struct wsi_interface *iface = device->wsi_device.wsi[surface->platform]; return iface->get_formats(surface, &device->wsi_device, pSurfaceFormatCount, pSurfaceFormats); @@ -128,7 +128,7 @@ VkResult anv_GetPhysicalDeviceSurfacePresentModesKHR( { ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, _surface); - struct anv_wsi_interface *iface = device->wsi_device.wsi[surface->platform]; + struct wsi_interface *iface = device->wsi_device.wsi[surface->platform]; return iface->get_present_modes(surface, pPresentModeCount, pPresentModes); @@ -245,7 +245,7 @@ x11_anv_wsi_image_free(VkDevice device, anv_FreeMemory(device, memory_h, pAllocator); } -static const struct anv_wsi_image_fns anv_wsi_image_fns = { +static const struct wsi_image_fns anv_wsi_image_fns = { .create_wsi_image = x11_anv_wsi_image_create, .free_wsi_image = x11_anv_wsi_image_free, }; @@ -258,9 +258,9 @@ VkResult anv_CreateSwapchainKHR( { ANV_FROM_HANDLE(anv_device, device, _device); ANV_FROM_HANDLE(_VkIcdSurfaceBase, surface, pCreateInfo->surface); - struct anv_wsi_interface *iface = + struct wsi_interface *iface = device->instance->physicalDevice.wsi_device.wsi[surface->platform]; - struct anv_swapchain *swapchain; + struct wsi_swapchain *swapchain; const VkAllocationCallbacks *alloc; if (pAllocator) @@ -280,7 +280,7 @@ VkResult anv_CreateSwapchainKHR( for (unsigned i = 0; i < ARRAY_SIZE(swapchain->fences); i++) swapchain->fences[i] = VK_NULL_HANDLE; - *pSwapchain = anv_swapchain_to_handle(swapchain); + *pSwapchain = wsi_swapchain_to_handle(swapchain); return VK_SUCCESS; } @@ -291,7 +291,7 @@ void anv_DestroySwapchainKHR( const VkAllocationCallbacks* pAllocator) { ANV_FROM_HANDLE(anv_device, device, _device); - ANV_FROM_HANDLE(anv_swapchain, swapchain, _swapchain); + ANV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain); const VkAllocationCallbacks *alloc; if (pAllocator) @@ -312,7 +312,7 @@ VkResult anv_GetSwapchainImagesKHR( uint32_t* pSwapchainImageCount, VkImage* pSwapchainImages) { - ANV_FROM_HANDLE(anv_swapchain, swapchain, _swapchain); + ANV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain); return swapchain->get_images(swapchain, pSwapchainImageCount, pSwapchainImages); @@ -326,7 +326,7 @@ VkResult anv_AcquireNextImageKHR( VkFence fence, uint32_t* pImageIndex) { - ANV_FROM_HANDLE(anv_swapchain, swapchain, _swapchain); + ANV_FROM_HANDLE(wsi_swapchain, swapchain, _swapchain); return swapchain->acquire_next_image(swapchain, timeout, semaphore, pImageIndex); @@ -340,7 +340,7 @@ VkResult anv_QueuePresentKHR( VkResult result; for (uint32_t i = 0; i < pPresentInfo->swapchainCount; i++) { - ANV_FROM_HANDLE(anv_swapchain, swapchain, pPresentInfo->pSwapchains[i]); + ANV_FROM_HANDLE(wsi_swapchain, swapchain, pPresentInfo->pSwapchains[i]); assert(anv_device_from_handle(swapchain->device) == queue->device); diff --git a/src/intel/vulkan/anv_wsi_wayland.c b/src/intel/vulkan/anv_wsi_wayland.c index 293838a6af4..5d4967145b7 100644 --- a/src/intel/vulkan/anv_wsi_wayland.c +++ b/src/intel/vulkan/anv_wsi_wayland.c @@ -27,8 +27,8 @@ #include "vk_format_info.h" #include -#include "anv_private.h" #include "wsi_common_wayland.h" +#include "anv_private.h" VkBool32 anv_GetPhysicalDeviceWaylandPresentationSupportKHR( VkPhysicalDevice physicalDevice, @@ -55,5 +55,5 @@ VkResult anv_CreateWaylandSurfaceKHR( else alloc = &instance->alloc; - return anv_create_wl_surface(alloc, pCreateInfo, pSurface); + return wsi_create_wl_surface(alloc, pCreateInfo, pSurface); } diff --git a/src/intel/vulkan/anv_wsi_x11.c b/src/intel/vulkan/anv_wsi_x11.c index 31369c05902..60bc568ab0c 100644 --- a/src/intel/vulkan/anv_wsi_x11.c +++ b/src/intel/vulkan/anv_wsi_x11.c @@ -27,11 +27,8 @@ #include #include -#include "anv_private.h" #include "wsi_common_x11.h" - -#include "vk_format_info.h" -#include "util/hash_table.h" +#include "anv_private.h" VkBool32 anv_GetPhysicalDeviceXcbPresentationSupportKHR( VkPhysicalDevice physicalDevice, @@ -41,7 +38,7 @@ VkBool32 anv_GetPhysicalDeviceXcbPresentationSupportKHR( { ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); - return anv_get_physical_device_xcb_presentation_support( + return wsi_get_physical_device_xcb_presentation_support( &device->wsi_device, &device->instance->alloc, queueFamilyIndex, connection, visual_id); @@ -55,7 +52,7 @@ VkBool32 anv_GetPhysicalDeviceXlibPresentationSupportKHR( { ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); - return anv_get_physical_device_xcb_presentation_support( + return wsi_get_physical_device_xcb_presentation_support( &device->wsi_device, &device->instance->alloc, queueFamilyIndex, XGetXCBConnection(dpy), visualID); @@ -76,7 +73,7 @@ VkResult anv_CreateXcbSurfaceKHR( else alloc = &instance->alloc; - return anv_create_xcb_surface(alloc, pCreateInfo, pSurface); + return wsi_create_xcb_surface(alloc, pCreateInfo, pSurface); } VkResult anv_CreateXlibSurfaceKHR( @@ -95,5 +92,5 @@ VkResult anv_CreateXlibSurfaceKHR( else alloc = &instance->alloc; - return anv_create_xlib_surface(alloc, pCreateInfo, pSurface); + return wsi_create_xlib_surface(alloc, pCreateInfo, pSurface); } diff --git a/src/intel/vulkan/wsi_common.h b/src/intel/vulkan/wsi_common.h index 6cda76b2a3f..ee675119302 100644 --- a/src/intel/vulkan/wsi_common.h +++ b/src/intel/vulkan/wsi_common.h @@ -30,8 +30,8 @@ #include #include -struct anv_wsi_device; -struct anv_wsi_image_fns { +struct wsi_device; +struct wsi_image_fns { VkResult (*create_wsi_image)(VkDevice device_h, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks *pAllocator, @@ -47,34 +47,34 @@ struct anv_wsi_image_fns { VkDeviceMemory memory_h); }; -struct anv_swapchain { +struct wsi_swapchain { VkDevice device; VkAllocationCallbacks alloc; - const struct anv_wsi_image_fns *image_fns; + const struct wsi_image_fns *image_fns; VkFence fences[3]; - VkResult (*destroy)(struct anv_swapchain *swapchain, + VkResult (*destroy)(struct wsi_swapchain *swapchain, const VkAllocationCallbacks *pAllocator); - VkResult (*get_images)(struct anv_swapchain *swapchain, + VkResult (*get_images)(struct wsi_swapchain *swapchain, uint32_t *pCount, VkImage *pSwapchainImages); - VkResult (*acquire_next_image)(struct anv_swapchain *swap_chain, + VkResult (*acquire_next_image)(struct wsi_swapchain *swap_chain, uint64_t timeout, VkSemaphore semaphore, uint32_t *image_index); - VkResult (*queue_present)(struct anv_swapchain *swap_chain, + VkResult (*queue_present)(struct wsi_swapchain *swap_chain, uint32_t image_index); }; -struct anv_wsi_interface { +struct wsi_interface { VkResult (*get_support)(VkIcdSurfaceBase *surface, - struct anv_wsi_device *wsi_device, + struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc, uint32_t queueFamilyIndex, VkBool32* pSupported); VkResult (*get_capabilities)(VkIcdSurfaceBase *surface, VkSurfaceCapabilitiesKHR* pSurfaceCapabilities); VkResult (*get_formats)(VkIcdSurfaceBase *surface, - struct anv_wsi_device *wsi_device, + struct wsi_device *wsi_device, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats); VkResult (*get_present_modes)(VkIcdSurfaceBase *surface, @@ -82,20 +82,20 @@ struct anv_wsi_interface { VkPresentModeKHR* pPresentModes); VkResult (*create_swapchain)(VkIcdSurfaceBase *surface, VkDevice device, - struct anv_wsi_device *wsi_device, + struct wsi_device *wsi_device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, - const struct anv_wsi_image_fns *image_fns, - struct anv_swapchain **swapchain); + const struct wsi_image_fns *image_fns, + struct wsi_swapchain **swapchain); }; #define VK_ICD_WSI_PLATFORM_MAX 5 -struct anv_wsi_device { - struct anv_wsi_interface * wsi[VK_ICD_WSI_PLATFORM_MAX]; +struct wsi_device { + struct wsi_interface * wsi[VK_ICD_WSI_PLATFORM_MAX]; }; -struct anv_wsi_callbacks { +struct wsi_callbacks { void (*get_phys_device_format_properties)(VkPhysicalDevice physicalDevice, VkFormat format, VkFormatProperties *pFormatProperties); @@ -116,16 +116,18 @@ struct anv_wsi_callbacks { } WSI_DEFINE_NONDISP_HANDLE_CASTS(_VkIcdSurfaceBase, VkSurfaceKHR) -WSI_DEFINE_NONDISP_HANDLE_CASTS(anv_swapchain, VkSwapchainKHR) -VkResult anv_x11_init_wsi(struct anv_wsi_device *wsi_device, +WSI_DEFINE_NONDISP_HANDLE_CASTS(wsi_swapchain, VkSwapchainKHR) + +VkResult wsi_x11_init_wsi(struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc); -void anv_x11_finish_wsi(struct anv_wsi_device *wsi_device, +void wsi_x11_finish_wsi(struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc); -VkResult anv_wl_init_wsi(struct anv_wsi_device *wsi_device, +VkResult wsi_wl_init_wsi(struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc, VkPhysicalDevice physical_device, - const struct anv_wsi_callbacks *cbs); -void anv_wl_finish_wsi(struct anv_wsi_device *wsi_device, + const struct wsi_callbacks *cbs); +void wsi_wl_finish_wsi(struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc); + #endif diff --git a/src/intel/vulkan/wsi_common_wayland.c b/src/intel/vulkan/wsi_common_wayland.c index 636836778bc..fc6775acb79 100644 --- a/src/intel/vulkan/wsi_common_wayland.c +++ b/src/intel/vulkan/wsi_common_wayland.c @@ -56,7 +56,7 @@ struct wsi_wl_display { }; struct wsi_wayland { - struct anv_wsi_interface base; + struct wsi_interface base; const VkAllocationCallbacks *alloc; VkPhysicalDevice physical_device; @@ -65,7 +65,7 @@ struct wsi_wayland { /* Hash table of wl_display -> wsi_wl_display mappings */ struct hash_table * displays; - const struct anv_wsi_callbacks *cbs; + const struct wsi_callbacks *cbs; }; static void @@ -303,7 +303,7 @@ fail: } static struct wsi_wl_display * -wsi_wl_get_display(struct anv_wsi_device *wsi_device, +wsi_wl_get_display(struct wsi_device *wsi_device, struct wl_display *wl_display) { struct wsi_wayland *wsi = @@ -338,7 +338,7 @@ wsi_wl_get_display(struct anv_wsi_device *wsi_device, } VkBool32 -wsi_wl_get_presentation_support(struct anv_wsi_device *wsi_device, +wsi_wl_get_presentation_support(struct wsi_device *wsi_device, struct wl_display *wl_display) { return wsi_wl_get_display(wsi_device, wl_display) != NULL; @@ -346,7 +346,7 @@ wsi_wl_get_presentation_support(struct anv_wsi_device *wsi_device, static VkResult wsi_wl_surface_get_support(VkIcdSurfaceBase *surface, - struct anv_wsi_device *wsi_device, + struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc, uint32_t queueFamilyIndex, VkBool32* pSupported) @@ -389,7 +389,7 @@ wsi_wl_surface_get_capabilities(VkIcdSurfaceBase *surface, static VkResult wsi_wl_surface_get_formats(VkIcdSurfaceBase *icd_surface, - struct anv_wsi_device *wsi_device, + struct wsi_device *wsi_device, uint32_t* pSurfaceFormatCount, VkSurfaceFormatKHR* pSurfaceFormats) { @@ -436,7 +436,7 @@ wsi_wl_surface_get_present_modes(VkIcdSurfaceBase *surface, return VK_SUCCESS; } -VkResult anv_create_wl_surface(const VkAllocationCallbacks *pAllocator, +VkResult wsi_create_wl_surface(const VkAllocationCallbacks *pAllocator, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, VkSurfaceKHR *pSurface) { @@ -464,7 +464,7 @@ struct wsi_wl_image { }; struct wsi_wl_swapchain { - struct anv_swapchain base; + struct wsi_swapchain base; struct wsi_wl_display * display; struct wl_event_queue * queue; @@ -482,10 +482,10 @@ struct wsi_wl_swapchain { }; static VkResult -wsi_wl_swapchain_get_images(struct anv_swapchain *anv_chain, +wsi_wl_swapchain_get_images(struct wsi_swapchain *wsi_chain, uint32_t *pCount, VkImage *pSwapchainImages) { - struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)anv_chain; + struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain; if (pSwapchainImages == NULL) { *pCount = chain->image_count; @@ -502,12 +502,12 @@ wsi_wl_swapchain_get_images(struct anv_swapchain *anv_chain, } static VkResult -wsi_wl_swapchain_acquire_next_image(struct anv_swapchain *anv_chain, +wsi_wl_swapchain_acquire_next_image(struct wsi_swapchain *wsi_chain, uint64_t timeout, VkSemaphore semaphore, uint32_t *image_index) { - struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)anv_chain; + struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain; int ret = wl_display_dispatch_queue_pending(chain->display->display, chain->queue); @@ -553,10 +553,10 @@ static const struct wl_callback_listener frame_listener = { }; static VkResult -wsi_wl_swapchain_queue_present(struct anv_swapchain *anv_chain, +wsi_wl_swapchain_queue_present(struct wsi_swapchain *wsi_chain, uint32_t image_index) { - struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)anv_chain; + struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain; if (chain->present_mode == VK_PRESENT_MODE_FIFO_KHR) { while (!chain->fifo_ready) { @@ -646,10 +646,10 @@ wsi_wl_image_init(struct wsi_wl_swapchain *chain, } static VkResult -wsi_wl_swapchain_destroy(struct anv_swapchain *anv_chain, +wsi_wl_swapchain_destroy(struct wsi_swapchain *wsi_chain, const VkAllocationCallbacks *pAllocator) { - struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)anv_chain; + struct wsi_wl_swapchain *chain = (struct wsi_wl_swapchain *)wsi_chain; for (uint32_t i = 0; i < chain->image_count; i++) { if (chain->images[i].buffer) @@ -666,11 +666,11 @@ wsi_wl_swapchain_destroy(struct anv_swapchain *anv_chain, static VkResult wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, VkDevice device, - struct anv_wsi_device *wsi_device, + struct wsi_device *wsi_device, const VkSwapchainCreateInfoKHR* pCreateInfo, const VkAllocationCallbacks* pAllocator, - const struct anv_wsi_image_fns *image_fns, - struct anv_swapchain **swapchain_out) + const struct wsi_image_fns *image_fns, + struct wsi_swapchain **swapchain_out) { VkIcdSurfaceWayland *surface = (VkIcdSurfaceWayland *)icd_surface; struct wsi_wl_swapchain *chain; @@ -752,10 +752,10 @@ fail: } VkResult -anv_wl_init_wsi(struct anv_wsi_device *wsi_device, +wsi_wl_init_wsi(struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc, VkPhysicalDevice physical_device, - const struct anv_wsi_callbacks *cbs) + const struct wsi_callbacks *cbs) { struct wsi_wayland *wsi; VkResult result; @@ -811,7 +811,7 @@ fail: } void -anv_wl_finish_wsi(struct anv_wsi_device *wsi_device, +wsi_wl_finish_wsi(struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc) { struct wsi_wayland *wsi = diff --git a/src/intel/vulkan/wsi_common_wayland.h b/src/intel/vulkan/wsi_common_wayland.h index a4b814c23df..effba0ebba4 100644 --- a/src/intel/vulkan/wsi_common_wayland.h +++ b/src/intel/vulkan/wsi_common_wayland.h @@ -26,10 +26,10 @@ #include "wsi_common.h" VkBool32 -wsi_wl_get_presentation_support(struct anv_wsi_device *wsi_device, +wsi_wl_get_presentation_support(struct wsi_device *wsi_device, struct wl_display *wl_display); -VkResult anv_create_wl_surface(const VkAllocationCallbacks *pAllocator, +VkResult wsi_create_wl_surface(const VkAllocationCallbacks *pAllocator, const VkWaylandSurfaceCreateInfoKHR *pCreateInfo, VkSurfaceKHR *pSurface); #endif diff --git a/src/intel/vulkan/wsi_common_x11.c b/src/intel/vulkan/wsi_common_x11.c index b494740664e..02b6eb6b7c7 100644 --- a/src/intel/vulkan/wsi_common_x11.c +++ b/src/intel/vulkan/wsi_common_x11.c @@ -47,7 +47,7 @@ struct wsi_x11_connection { }; struct wsi_x11 { - struct anv_wsi_interface base; + struct wsi_interface base; pthread_mutex_t mutex; /* Hash table of xcb_connection -> wsi_x11_connection mappings */ @@ -96,7 +96,7 @@ wsi_x11_connection_destroy(const VkAllocationCallbacks *alloc, } static struct wsi_x11_connection * -wsi_x11_get_connection(struct anv_wsi_device *wsi_dev, +wsi_x11_get_connection(struct wsi_device *wsi_dev, const VkAllocationCallbacks *alloc, xcb_connection_t *conn) { @@ -242,8 +242,8 @@ visual_has_alpha(xcb_visualtype_t *visual, unsigned depth) return (all_mask & ~rgb_mask) != 0; } -VkBool32 anv_get_physical_device_xcb_presentation_support( - struct anv_wsi_device *wsi_device, +VkBool32 wsi_get_physical_device_xcb_presentation_support( + struct wsi_device *wsi_device, VkAllocationCallbacks *alloc, uint32_t queueFamilyIndex, xcb_connection_t* connection, @@ -287,7 +287,7 @@ x11_surface_get_window(VkIcdSurfaceBase *icd_surface) static VkResult x11_surface_get_support(VkIcdSurfaceBase *icd_surface, - struct anv_wsi_device *wsi_device, + struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc, uint32_t queueFamilyIndex, VkBool32* pSupported) @@ -382,7 +382,7 @@ x11_surface_get_capabilities(VkIcdSurfaceBase *icd_surface, static VkResult x11_surface_get_formats(VkIcdSurfaceBase *surface, - struct anv_wsi_device *wsi_device, + struct wsi_device *wsi_device, uint32_t *pSurfaceFormatCount, VkSurfaceFormatKHR *pSurfaceFormats) { @@ -415,7 +415,7 @@ x11_surface_get_present_modes(VkIcdSurfaceBase *surface, return VK_SUCCESS; } -VkResult anv_create_xcb_surface(const VkAllocationCallbacks *pAllocator, +VkResult wsi_create_xcb_surface(const VkAllocationCallbacks *pAllocator, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, VkSurfaceKHR *pSurface) { @@ -434,7 +434,7 @@ VkResult anv_create_xcb_surface(const VkAllocationCallbacks *pAllocator, return VK_SUCCESS; } -VkResult anv_create_xlib_surface(const VkAllocationCallbacks *pAllocator, +VkResult wsi_create_xlib_surface(const VkAllocationCallbacks *pAllocator, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, VkSurfaceKHR *pSurface) { @@ -463,7 +463,7 @@ struct x11_image { }; struct x11_swapchain { - struct anv_swapchain base; + struct wsi_swapchain base; xcb_connection_t * conn; xcb_window_t window; @@ -480,7 +480,7 @@ struct x11_swapchain { }; static VkResult -x11_get_images(struct anv_swapchain *anv_chain, +x11_get_images(struct wsi_swapchain *anv_chain, uint32_t* pCount, VkImage *pSwapchainImages) { struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain; @@ -536,7 +536,7 @@ x11_handle_dri3_present_event(struct x11_swapchain *chain, } static VkResult -x11_acquire_next_image(struct anv_swapchain *anv_chain, +x11_acquire_next_image(struct wsi_swapchain *anv_chain, uint64_t timeout, VkSemaphore semaphore, uint32_t *image_index) @@ -568,7 +568,7 @@ x11_acquire_next_image(struct anv_swapchain *anv_chain, } static VkResult -x11_queue_present(struct anv_swapchain *anv_chain, +x11_queue_present(struct wsi_swapchain *anv_chain, uint32_t image_index) { struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain; @@ -703,7 +703,7 @@ x11_image_finish(struct x11_swapchain *chain, } static VkResult -x11_swapchain_destroy(struct anv_swapchain *anv_chain, +x11_swapchain_destroy(struct wsi_swapchain *anv_chain, const VkAllocationCallbacks *pAllocator) { struct x11_swapchain *chain = (struct x11_swapchain *)anv_chain; @@ -720,11 +720,11 @@ x11_swapchain_destroy(struct anv_swapchain *anv_chain, static VkResult x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface, VkDevice device, - struct anv_wsi_device *wsi_device, + struct wsi_device *wsi_device, const VkSwapchainCreateInfoKHR *pCreateInfo, const VkAllocationCallbacks* pAllocator, - const struct anv_wsi_image_fns *image_fns, - struct anv_swapchain **swapchain_out) + const struct wsi_image_fns *image_fns, + struct wsi_swapchain **swapchain_out) { struct x11_swapchain *chain; xcb_void_cookie_t cookie; @@ -813,7 +813,7 @@ fail_register: } VkResult -anv_x11_init_wsi(struct anv_wsi_device *wsi_device, +wsi_x11_init_wsi(struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc) { struct wsi_x11 *wsi; @@ -868,7 +868,7 @@ fail: } void -anv_x11_finish_wsi(struct anv_wsi_device *wsi_device, +wsi_x11_finish_wsi(struct wsi_device *wsi_device, const VkAllocationCallbacks *alloc) { struct wsi_x11 *wsi = diff --git a/src/intel/vulkan/wsi_common_x11.h b/src/intel/vulkan/wsi_common_x11.h index 4d95e53ff01..7166f099fdb 100644 --- a/src/intel/vulkan/wsi_common_x11.h +++ b/src/intel/vulkan/wsi_common_x11.h @@ -25,18 +25,18 @@ #include "wsi_common.h" -VkBool32 anv_get_physical_device_xcb_presentation_support( - struct anv_wsi_device *wsi_device, +VkBool32 wsi_get_physical_device_xcb_presentation_support( + struct wsi_device *wsi_device, VkAllocationCallbacks *alloc, uint32_t queueFamilyIndex, xcb_connection_t* connection, xcb_visualid_t visual_id); -VkResult anv_create_xcb_surface(const VkAllocationCallbacks *pAllocator, +VkResult wsi_create_xcb_surface(const VkAllocationCallbacks *pAllocator, const VkXcbSurfaceCreateInfoKHR *pCreateInfo, VkSurfaceKHR *pSurface); -VkResult anv_create_xlib_surface(const VkAllocationCallbacks *pAllocator, +VkResult wsi_create_xlib_surface(const VkAllocationCallbacks *pAllocator, const VkXlibSurfaceCreateInfoKHR *pCreateInfo, VkSurfaceKHR *pSurface); #endif