2 * Copyright © 2017 Keith Packard
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that copyright
7 * notice and this permission notice appear in supporting documentation, and
8 * that the name of the copyright holders not be used in advertising or
9 * publicity pertaining to distribution of the software without specific,
10 * written prior permission. The copyright holders make no representations
11 * about the suitability of this software for any purpose. It is provided "as
12 * is" without express or implied warranty.
14 * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
15 * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
16 * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR
17 * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
18 * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
19 * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
23 #ifndef WSI_COMMON_DISPLAY_H
24 #define WSI_COMMON_DISPLAY_H
26 #include "wsi_common.h"
28 #include <xf86drmMode.h>
30 #define typed_memcpy(dest, src, count) ({ \
31 STATIC_ASSERT(sizeof(*src) == sizeof(*dest)); \
32 memcpy((dest), (src), (count) * sizeof(*(src))); \
36 wsi_display_get_physical_device_display_properties(
37 VkPhysicalDevice physical_device
,
38 struct wsi_device
*wsi_device
,
39 uint32_t *property_count
,
40 VkDisplayPropertiesKHR
*properties
);
43 wsi_display_get_physical_device_display_plane_properties(
44 VkPhysicalDevice physical_device
,
45 struct wsi_device
*wsi_device
,
46 uint32_t *property_count
,
47 VkDisplayPlanePropertiesKHR
*properties
);
50 wsi_display_get_display_plane_supported_displays(
51 VkPhysicalDevice physical_device
,
52 struct wsi_device
*wsi_device
,
54 uint32_t *display_count
,
55 VkDisplayKHR
*displays
);
58 wsi_display_get_display_mode_properties(VkPhysicalDevice physical_device
,
59 struct wsi_device
*wsi_device
,
61 uint32_t *property_count
,
62 VkDisplayModePropertiesKHR
*properties
);
65 wsi_display_create_display_mode(VkPhysicalDevice physical_device
,
66 struct wsi_device
*wsi_device
,
68 const VkDisplayModeCreateInfoKHR
*create_info
,
69 const VkAllocationCallbacks
*allocator
,
70 VkDisplayModeKHR
*mode
);
73 wsi_get_display_plane_capabilities(VkPhysicalDevice physical_device
,
74 struct wsi_device
*wsi_device
,
75 VkDisplayModeKHR mode_khr
,
77 VkDisplayPlaneCapabilitiesKHR
*capabilities
);
80 wsi_create_display_surface(VkInstance instance
,
81 const VkAllocationCallbacks
*pAllocator
,
82 const VkDisplaySurfaceCreateInfoKHR
*pCreateInfo
,
83 VkSurfaceKHR
*pSurface
);
86 wsi_release_display(VkPhysicalDevice physical_device
,
87 struct wsi_device
*wsi_device
,
88 VkDisplayKHR display
);
91 #if VK_USE_PLATFORM_XLIB_XRANDR_EXT
93 wsi_acquire_xlib_display(VkPhysicalDevice physical_device
,
94 struct wsi_device
*wsi_device
,
96 VkDisplayKHR display
);
99 wsi_get_randr_output_display(VkPhysicalDevice physical_device
,
100 struct wsi_device
*wsi_device
,
103 VkDisplayKHR
*display
);
105 #endif /* VK_USE_PLATFORM_XLIB_XRANDR_EXT */