Path: blob/21.2-virgl/src/vulkan/wsi/wsi_common_display.h
7326 views
/*1* Copyright © 2017 Keith Packard2*3* Permission to use, copy, modify, distribute, and sell this software and its4* documentation for any purpose is hereby granted without fee, provided that5* the above copyright notice appear in all copies and that both that copyright6* notice and this permission notice appear in supporting documentation, and7* that the name of the copyright holders not be used in advertising or8* publicity pertaining to distribution of the software without specific,9* written prior permission. The copyright holders make no representations10* about the suitability of this software for any purpose. It is provided "as11* is" without express or implied warranty.12*13* THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,14* INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO15* EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR16* CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,17* DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER18* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE19* OF THIS SOFTWARE.20*/2122#ifndef WSI_COMMON_DISPLAY_H23#define WSI_COMMON_DISPLAY_H2425#include "wsi_common.h"26#include <xf86drm.h>27#include <xf86drmMode.h>2829VkResult30wsi_display_get_physical_device_display_properties(31VkPhysicalDevice physical_device,32struct wsi_device *wsi_device,33uint32_t *property_count,34VkDisplayPropertiesKHR *properties);3536VkResult37wsi_display_get_physical_device_display_properties2(38VkPhysicalDevice physical_device,39struct wsi_device *wsi_device,40uint32_t *pPropertyCount,41VkDisplayProperties2KHR *pProperties);4243VkResult44wsi_display_get_physical_device_display_plane_properties(45VkPhysicalDevice physical_device,46struct wsi_device *wsi_device,47uint32_t *property_count,48VkDisplayPlanePropertiesKHR *properties);4950VkResult51wsi_display_get_physical_device_display_plane_properties2(52VkPhysicalDevice physical_device,53struct wsi_device *wsi_device,54uint32_t *property_count,55VkDisplayPlaneProperties2KHR *properties);5657VkResult58wsi_display_get_display_plane_supported_displays(59VkPhysicalDevice physical_device,60struct wsi_device *wsi_device,61uint32_t plane_index,62uint32_t *display_count,63VkDisplayKHR *displays);6465VkResult66wsi_display_get_display_mode_properties(VkPhysicalDevice physical_device,67struct wsi_device *wsi_device,68VkDisplayKHR display,69uint32_t *property_count,70VkDisplayModePropertiesKHR *properties);7172VkResult73wsi_display_get_display_mode_properties2(VkPhysicalDevice physical_device,74struct wsi_device *wsi_device,75VkDisplayKHR display,76uint32_t *property_count,77VkDisplayModeProperties2KHR *properties);7879VkResult80wsi_display_create_display_mode(VkPhysicalDevice physical_device,81struct wsi_device *wsi_device,82VkDisplayKHR display,83const VkDisplayModeCreateInfoKHR *create_info,84const VkAllocationCallbacks *allocator,85VkDisplayModeKHR *mode);8687VkResult88wsi_get_display_plane_capabilities(VkPhysicalDevice physical_device,89struct wsi_device *wsi_device,90VkDisplayModeKHR mode_khr,91uint32_t plane_index,92VkDisplayPlaneCapabilitiesKHR *capabilities);9394VkResult95wsi_get_display_plane_capabilities2(VkPhysicalDevice physical_device,96struct wsi_device *wsi_device,97const VkDisplayPlaneInfo2KHR *pDisplayPlaneInfo,98VkDisplayPlaneCapabilities2KHR *capabilities);99100VkResult101wsi_create_display_surface(VkInstance instance,102const VkAllocationCallbacks *pAllocator,103const VkDisplaySurfaceCreateInfoKHR *pCreateInfo,104VkSurfaceKHR *pSurface);105106VkResult107wsi_release_display(VkPhysicalDevice physical_device,108struct wsi_device *wsi_device,109VkDisplayKHR display);110111112#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT113VkResult114wsi_acquire_xlib_display(VkPhysicalDevice physical_device,115struct wsi_device *wsi_device,116Display *dpy,117VkDisplayKHR display);118119VkResult120wsi_get_randr_output_display(VkPhysicalDevice physical_device,121struct wsi_device *wsi_device,122Display *dpy,123RROutput output,124VkDisplayKHR *display);125126#endif /* VK_USE_PLATFORM_XLIB_XRANDR_EXT */127128/* VK_EXT_display_control */129VkResult130wsi_display_power_control(VkDevice device,131struct wsi_device *wsi_device,132VkDisplayKHR display,133const VkDisplayPowerInfoEXT *display_power_info);134135VkResult136wsi_register_device_event(VkDevice device,137struct wsi_device *wsi_device,138const VkDeviceEventInfoEXT *device_event_info,139const VkAllocationCallbacks *allocator,140struct wsi_fence **fence,141int sync_fd);142143VkResult144wsi_register_display_event(VkDevice device,145struct wsi_device *wsi_device,146VkDisplayKHR display,147const VkDisplayEventInfoEXT *display_event_info,148const VkAllocationCallbacks *allocator,149struct wsi_fence **fence,150int sync_fd);151152VkResult153wsi_get_swapchain_counter(VkDevice device,154struct wsi_device *wsi_device,155VkSwapchainKHR swapchain,156VkSurfaceCounterFlagBitsEXT flag_bits,157uint64_t *value);158159/* VK_EXT_acquire_drm_display */160VkResult161wsi_acquire_drm_display(VkPhysicalDevice pDevice,162struct wsi_device *wsi_device,163int drmFd,164VkDisplayKHR display);165166VkResult167wsi_get_drm_display(VkPhysicalDevice pDevice,168struct wsi_device *wsi_device,169int drmFd,170int connectorId,171VkDisplayKHR *display);172173#endif174175176