Path: blob/21.2-virgl/src/gallium/frontends/lavapipe/lvp_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 OTHER DEALINGS22* IN THE SOFTWARE.23*/2425#include "wsi_common_wayland.h"26#include "lvp_private.h"2728VkBool32 lvp_GetPhysicalDeviceWaylandPresentationSupportKHR(29VkPhysicalDevice physicalDevice,30uint32_t queueFamilyIndex,31struct wl_display* display)32{33LVP_FROM_HANDLE(lvp_physical_device, physical_device, physicalDevice);3435return wsi_wl_get_presentation_support(&physical_device->wsi_device, display);36}3738VkResult lvp_CreateWaylandSurfaceKHR(39VkInstance _instance,40const VkWaylandSurfaceCreateInfoKHR* pCreateInfo,41const VkAllocationCallbacks* pAllocator,42VkSurfaceKHR* pSurface)43{44LVP_FROM_HANDLE(lvp_instance, instance, _instance);45const VkAllocationCallbacks *alloc;46assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_WAYLAND_SURFACE_CREATE_INFO_KHR);4748if (pAllocator)49alloc = pAllocator;50else51alloc = &instance->vk.alloc;5253return wsi_create_wl_surface(alloc, pCreateInfo, pSurface);54}555657