Path: blob/21.2-virgl/src/broadcom/vulkan/v3dv_wsi_wayland.c
4560 views
/*1* Copyright © 2020 Ella Stanforth2* 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 OTHER DEALINGS22* IN THE SOFTWARE.23*/2425#include "wsi_common_wayland.h"26#include "v3dv_private.h"2728VKAPI_ATTR VkBool32 VKAPI_CALL29v3dv_GetPhysicalDeviceWaylandPresentationSupportKHR(30VkPhysicalDevice physicalDevice,31uint32_t queueFamilyIndex,32struct wl_display* display)33{34V3DV_FROM_HANDLE(v3dv_physical_device, physical_device, physicalDevice);3536return wsi_wl_get_presentation_support(&physical_device->wsi_device, display);37}3839VKAPI_ATTR VkResult VKAPI_CALL40v3dv_CreateWaylandSurfaceKHR(41VkInstance _instance,42const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,43const VkAllocationCallbacks* pAllocator,44VkSurfaceKHR* pSurface)45{46V3DV_FROM_HANDLE(v3dv_instance, instance, _instance);47const VkAllocationCallbacks *alloc;48assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR);4950if (pAllocator)51alloc = pAllocator;52else53alloc = &instance->vk.alloc;5455return wsi_create_wl_surface(alloc, pCreateInfo, pSurface);56}575859