Mesa (main): vulkan/wsi/wayland: Delete the wrapper entrypoints

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 13 00:36:59 UTC 2021


Module: Mesa
Branch: main
Commit: 8abeecf5052146a748c96bee2561493fa7db3825
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=8abeecf5052146a748c96bee2561493fa7db3825

Author: Jason Ekstrand <jason at jlekstrand.net>
Date:   Wed Oct  6 12:32:20 2021 -0500

vulkan/wsi/wayland: Delete the wrapper entrypoints

Acked-by: Chia-I Wu <olvaffe at gmail.com>
Acked-by: Iago Toral Quiroga <itoral at igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13234>

---

 src/vulkan/wsi/wsi_common_wayland.c | 54 +++++++++++--------------------------
 src/vulkan/wsi/wsi_common_wayland.h | 35 ------------------------
 2 files changed, 16 insertions(+), 73 deletions(-)

diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index ef952c9fd36..906ccde5846 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -40,7 +40,6 @@
 #include "vk_util.h"
 #include "wsi_common_entrypoints.h"
 #include "wsi_common_private.h"
-#include "wsi_common_wayland.h"
 #include "linux-dmabuf-unstable-v1-client-protocol.h"
 
 #include <util/compiler.h>
@@ -576,10 +575,13 @@ wsi_wl_display_unref(struct wsi_wl_display *display)
    vk_free(wsi->alloc, display);
 }
 
-VkBool32
-wsi_wl_get_presentation_support(struct wsi_device *wsi_device,
-				struct wl_display *wl_display)
+VKAPI_ATTR VkBool32 VKAPI_CALL
+wsi_GetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice,
+                                                   uint32_t queueFamilyIndex,
+                                                   struct wl_display *wl_display)
 {
+   VK_FROM_HANDLE(vk_physical_device, pdevice, physicalDevice);
+   struct wsi_device *wsi_device = pdevice->wsi_device;
    struct wsi_wayland *wsi =
       (struct wsi_wayland *)wsi_device->wsi[VK_ICD_WSI_PLATFORM_WAYLAND];
 
@@ -592,16 +594,6 @@ wsi_wl_get_presentation_support(struct wsi_device *wsi_device,
    return ret == VK_SUCCESS;
 }
 
-VKAPI_ATTR VkBool32 VKAPI_CALL
-wsi_GetPhysicalDeviceWaylandPresentationSupportKHR(VkPhysicalDevice physicalDevice,
-                                                   uint32_t queueFamilyIndex,
-                                                   struct wl_display *display)
-{
-   VK_FROM_HANDLE(vk_physical_device, device, physicalDevice);
-
-   return wsi_wl_get_presentation_support(device->wsi_device, display);
-}
-
 static VkResult
 wsi_wl_surface_get_support(VkIcdSurfaceBase *surface,
                            struct wsi_device *wsi_device,
@@ -786,14 +778,19 @@ wsi_wl_surface_get_present_rectangles(VkIcdSurfaceBase *surface,
    return vk_outarray_status(&out);
 }
 
-VkResult wsi_create_wl_surface(const VkAllocationCallbacks *pAllocator,
-			       const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,
-			       VkSurfaceKHR *pSurface)
+VKAPI_ATTR VkResult VKAPI_CALL
+wsi_CreateWaylandSurfaceKHR(VkInstance _instance,
+                            const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,
+                            const VkAllocationCallbacks *pAllocator,
+                            VkSurfaceKHR *pSurface)
 {
+   VK_FROM_HANDLE(vk_instance, instance, _instance);
    VkIcdSurfaceWayland *surface;
 
-   surface = vk_alloc(pAllocator, sizeof *surface, 8,
-                      VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
+   assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR);
+
+   surface = vk_alloc2(&instance->alloc, pAllocator, sizeof *surface, 8,
+                       VK_SYSTEM_ALLOCATION_SCOPE_OBJECT);
    if (surface == NULL)
       return VK_ERROR_OUT_OF_HOST_MEMORY;
 
@@ -806,25 +803,6 @@ VkResult wsi_create_wl_surface(const VkAllocationCallbacks *pAllocator,
    return VK_SUCCESS;
 }
 
-VKAPI_ATTR VkResult VKAPI_CALL
-wsi_CreateWaylandSurfaceKHR(VkInstance _instance,
-                            const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,
-                            const VkAllocationCallbacks *pAllocator,
-                            VkSurfaceKHR *pSurface)
-{
-   VK_FROM_HANDLE(vk_instance, instance, _instance);
-   const VkAllocationCallbacks *alloc;
-
-   assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR);
-
-   if (pAllocator)
-      alloc = pAllocator;
-   else
-      alloc = &instance->alloc;
-
-   return wsi_create_wl_surface(alloc, pCreateInfo, pSurface);
-}
-
 struct wsi_wl_image {
    struct wsi_image                             base;
    struct wl_buffer *                           buffer;
diff --git a/src/vulkan/wsi/wsi_common_wayland.h b/src/vulkan/wsi/wsi_common_wayland.h
deleted file mode 100644
index effba0ebba4..00000000000
--- a/src/vulkan/wsi/wsi_common_wayland.h
+++ /dev/null
@@ -1,35 +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_WAYLAND_H
-#define WSI_COMMON_WAYLAND_H
-
-#include "wsi_common.h"
-
-VkBool32
-wsi_wl_get_presentation_support(struct wsi_device *wsi_device,
-				struct wl_display *wl_display);
-
-VkResult wsi_create_wl_surface(const VkAllocationCallbacks *pAllocator,
-			       const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,
-			       VkSurfaceKHR *pSurface);
-#endif



More information about the mesa-commit mailing list