Path: blob/21.2-virgl/src/freedreno/vulkan/tu_wsi_wayland.c
4565 views
/*1* Copyright © 2016 Red Hat2* based on intel anv code:3* Copyright © 2015 Intel Corporation4*5* Permission is hereby granted, free of charge, to any person obtaining a6* copy of this software and associated documentation files (the "Software"),7* to deal in the Software without restriction, including without limitation8* the rights to use, copy, modify, merge, publish, distribute, sublicense,9* and/or sell copies of the Software, and to permit persons to whom the10* Software is furnished to do so, subject to the following conditions:11*12* The above copyright notice and this permission notice (including the next13* paragraph) shall be included in all copies or substantial portions of the14* Software.15*16* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR17* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,18* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL19* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER20* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING21* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER22* DEALINGS IN THE SOFTWARE.23*/2425#include "tu_private.h"2627#include "wsi_common_wayland.h"2829VKAPI_ATTR VkBool32 VKAPI_CALL30tu_GetPhysicalDeviceWaylandPresentationSupportKHR(31VkPhysicalDevice physicalDevice,32uint32_t queueFamilyIndex,33struct wl_display *display)34{35TU_FROM_HANDLE(tu_physical_device, physical_device, physicalDevice);3637return wsi_wl_get_presentation_support(&physical_device->wsi_device,38display);39}4041VKAPI_ATTR VkResult VKAPI_CALL42tu_CreateWaylandSurfaceKHR(VkInstance _instance,43const VkWaylandSurfaceCreateInfoKHR *pCreateInfo,44const VkAllocationCallbacks *pAllocator,45VkSurfaceKHR *pSurface)46{47TU_FROM_HANDLE(tu_instance, instance, _instance);48const VkAllocationCallbacks *alloc;49assert(pCreateInfo->sType ==50VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR);5152if (pAllocator)53alloc = pAllocator;54else55alloc = &instance->vk.alloc;5657return wsi_create_wl_surface(alloc, pCreateInfo, pSurface);58}596061