vulkan/wsi/x11: Delete the wrapper entrypoints

Acked-by: Chia-I Wu <olvaffe@gmail.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13234>
This commit is contained in:
Jason Ekstrand 2021-10-06 12:29:10 -05:00 committed by Marge Bot
parent 1680cd907d
commit 8ade418144
2 changed files with 27 additions and 111 deletions

View file

@ -49,7 +49,6 @@
#include "vk_enum_to_str.h"
#include "wsi_common_entrypoints.h"
#include "wsi_common_private.h"
#include "wsi_common_x11.h"
#include "wsi_common_queue.h"
#ifdef HAVE_SYS_SHM_H
@ -471,12 +470,14 @@ visual_has_alpha(xcb_visualtype_t *visual, unsigned depth)
return (all_mask & ~rgb_mask) != 0;
}
VkBool32 wsi_get_physical_device_xcb_presentation_support(
struct wsi_device *wsi_device,
uint32_t queueFamilyIndex,
xcb_connection_t* connection,
xcb_visualid_t visual_id)
VKAPI_ATTR VkBool32 VKAPI_CALL
wsi_GetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
xcb_connection_t *connection,
xcb_visualid_t visual_id)
{
VK_FROM_HANDLE(vk_physical_device, pdevice, physicalDevice);
struct wsi_device *wsi_device = pdevice->wsi_device;
struct wsi_x11_connection *wsi_conn =
wsi_x11_get_connection(wsi_device, connection);
@ -498,32 +499,16 @@ VkBool32 wsi_get_physical_device_xcb_presentation_support(
return true;
}
VKAPI_ATTR VkBool32 VKAPI_CALL
wsi_GetPhysicalDeviceXcbPresentationSupportKHR(VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
xcb_connection_t *connection,
xcb_visualid_t visual_id)
{
VK_FROM_HANDLE(vk_physical_device, device, physicalDevice);
return wsi_get_physical_device_xcb_presentation_support(device->wsi_device,
queueFamilyIndex,
connection,
visual_id);
}
VKAPI_ATTR VkBool32 VKAPI_CALL
wsi_GetPhysicalDeviceXlibPresentationSupportKHR(VkPhysicalDevice physicalDevice,
uint32_t queueFamilyIndex,
Display *dpy,
VisualID visualID)
{
VK_FROM_HANDLE(vk_physical_device, device, physicalDevice);
return wsi_get_physical_device_xcb_presentation_support(device->wsi_device,
queueFamilyIndex,
XGetXCBConnection(dpy),
visualID);
return wsi_GetPhysicalDeviceXcbPresentationSupportKHR(physicalDevice,
queueFamilyIndex,
XGetXCBConnection(dpy),
visualID);
}
static xcb_connection_t*
@ -806,25 +791,6 @@ x11_surface_get_present_rectangles(VkIcdSurfaceBase *icd_surface,
return vk_outarray_status(&out);
}
VkResult wsi_create_xcb_surface(const VkAllocationCallbacks *pAllocator,
const VkXcbSurfaceCreateInfoKHR *pCreateInfo,
VkSurfaceKHR *pSurface)
{
VkIcdSurfaceXcb *surface;
surface = vk_alloc(pAllocator, sizeof *surface, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (surface == NULL)
return VK_ERROR_OUT_OF_HOST_MEMORY;
surface->base.platform = VK_ICD_WSI_PLATFORM_XCB;
surface->connection = pCreateInfo->connection;
surface->window = pCreateInfo->window;
*pSurface = VkIcdSurfaceBase_to_handle(&surface->base);
return VK_SUCCESS;
}
VKAPI_ATTR VkResult VKAPI_CALL
wsi_CreateXcbSurfaceKHR(VkInstance _instance,
const VkXcbSurfaceCreateInfoKHR *pCreateInfo,
@ -832,31 +798,17 @@ wsi_CreateXcbSurfaceKHR(VkInstance _instance,
VkSurfaceKHR *pSurface)
{
VK_FROM_HANDLE(vk_instance, instance, _instance);
const VkAllocationCallbacks *alloc;
VkIcdSurfaceXcb *surface;
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR);
if (pAllocator)
alloc = pAllocator;
else
alloc = &instance->alloc;
return wsi_create_xcb_surface(alloc, pCreateInfo, pSurface);
}
VkResult wsi_create_xlib_surface(const VkAllocationCallbacks *pAllocator,
const VkXlibSurfaceCreateInfoKHR *pCreateInfo,
VkSurfaceKHR *pSurface)
{
VkIcdSurfaceXlib *surface;
surface = vk_alloc(pAllocator, sizeof *surface, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
surface = vk_alloc2(&instance->alloc, pAllocator, sizeof *surface, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (surface == NULL)
return VK_ERROR_OUT_OF_HOST_MEMORY;
surface->base.platform = VK_ICD_WSI_PLATFORM_XLIB;
surface->dpy = pCreateInfo->dpy;
surface->base.platform = VK_ICD_WSI_PLATFORM_XCB;
surface->connection = pCreateInfo->connection;
surface->window = pCreateInfo->window;
*pSurface = VkIcdSurfaceBase_to_handle(&surface->base);
@ -870,16 +822,21 @@ wsi_CreateXlibSurfaceKHR(VkInstance _instance,
VkSurfaceKHR *pSurface)
{
VK_FROM_HANDLE(vk_instance, instance, _instance);
const VkAllocationCallbacks *alloc;
VkIcdSurfaceXlib *surface;
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR);
if (pAllocator)
alloc = pAllocator;
else
alloc = &instance->alloc;
surface = vk_alloc2(&instance->alloc, pAllocator, sizeof *surface, 8,
VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
if (surface == NULL)
return VK_ERROR_OUT_OF_HOST_MEMORY;
return wsi_create_xlib_surface(alloc, pCreateInfo, pSurface);
surface->base.platform = VK_ICD_WSI_PLATFORM_XLIB;
surface->dpy = pCreateInfo->dpy;
surface->window = pCreateInfo->window;
*pSurface = VkIcdSurfaceBase_to_handle(&surface->base);
return VK_SUCCESS;
}
struct x11_image {

View file

@ -1,41 +0,0 @@
/*
* Copyright © 2015 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef WSI_COMMON_X11_H
#define WSI_COMMON_X11_H
#include "wsi_common.h"
VkBool32 wsi_get_physical_device_xcb_presentation_support(
struct wsi_device *wsi_device,
uint32_t queueFamilyIndex,
xcb_connection_t* connection,
xcb_visualid_t visual_id);
VkResult wsi_create_xcb_surface(const VkAllocationCallbacks *pAllocator,
const VkXcbSurfaceCreateInfoKHR *pCreateInfo,
VkSurfaceKHR *pSurface);
VkResult wsi_create_xlib_surface(const VkAllocationCallbacks *pAllocator,
const VkXlibSurfaceCreateInfoKHR *pCreateInfo,
VkSurfaceKHR *pSurface);
#endif