@@ -194,6 +194,13 @@ VULKAN_CPPFLAGS += \
VULKAN_SOURCES += $(VULKAN_WSI_DISPLAY_FILES)
endif
+if HAVE_XLIB_LEASE
+VULKAN_CPPFLAGS += \
+ -DVK_USE_PLATFORM_XLIB_XRANDR_EXT \
+ $(XCB_RANDR_CFLAGS)
+VULKAN_LIB_DEPS += $(XCB_RANDR_LIBS)
+endif
+
noinst_LTLIBRARIES += vulkan/libvulkan_common.la
vulkan_libvulkan_common_la_SOURCES = $(VULKAN_SOURCES)
vulkan_libvulkan_common_la_CFLAGS = $(VULKAN_CFLAGS)
@@ -85,6 +85,7 @@ EXTENSIONS = [
Extension('VK_KHR_xlib_surface', 6, 'VK_USE_PLATFORM_XLIB_KHR'),
Extension('VK_KHR_display', 23, 'VK_USE_PLATFORM_DISPLAY_KHR'),
Extension('VK_EXT_direct_mode_display', 1, 'VK_USE_PLATFORM_DISPLAY_KHR'),
+ Extension('VK_EXT_acquire_xlib_display', 1, 'VK_USE_PLATFORM_XLIB_XRANDR_EXT'),
Extension('VK_KHX_multiview', 1, True),
Extension('VK_EXT_debug_report', 8, True),
Extension('VK_EXT_external_memory_dma_buf', 1, True),
@@ -113,12 +113,12 @@ _TEMPLATE_C = Template(COPYRIGHT + """
#include "vk_util.h"
/* Convert the VK_USE_PLATFORM_* defines to booleans */
-%for platform in ['ANDROID', 'WAYLAND', 'XCB', 'XLIB', 'DISPLAY']:
-#ifdef VK_USE_PLATFORM_${platform}_KHR
-# undef VK_USE_PLATFORM_${platform}_KHR
-# define VK_USE_PLATFORM_${platform}_KHR true
+%for platform in ['ANDROID_KHR', 'WAYLAND_KHR', 'XCB_KHR', 'XLIB_KHR', 'DISPLAY_KHR', 'XLIB_XRANDR_EXT']:
+#ifdef VK_USE_PLATFORM_${platform}
+# undef VK_USE_PLATFORM_${platform}
+# define VK_USE_PLATFORM_${platform} true
#else
-# define VK_USE_PLATFORM_${platform}_KHR false
+# define VK_USE_PLATFORM_${platform} false
#endif
%endfor
@@ -138,3 +138,33 @@ anv_ReleaseDisplayEXT(VkPhysicalDevice physical_device,
&pdevice->wsi_device,
display);
}
+
+#ifdef VK_USE_PLATFORM_XLIB_XRANDR_EXT
+VkResult
+anv_AcquireXlibDisplayEXT(VkPhysicalDevice physical_device,
+ Display *dpy,
+ VkDisplayKHR display)
+{
+ ANV_FROM_HANDLE(anv_physical_device, pdevice, physical_device);
+
+ return wsi_acquire_xlib_display(physical_device,
+ &pdevice->wsi_device,
+ dpy,
+ display);
+}
+
+VkResult
+anv_GetRandROutputDisplayEXT(VkPhysicalDevice physical_device,
+ Display *dpy,
+ RROutput output,
+ VkDisplayKHR *display)
+{
+ ANV_FROM_HANDLE(anv_physical_device, pdevice, physical_device);
+
+ return wsi_get_randr_output_display(physical_device,
+ &pdevice->wsi_device,
+ dpy,
+ output,
+ display);
+}
+#endif /* VK_USE_PLATFORM_XLIB_XRANDR_EXT */
@@ -178,6 +178,13 @@ if with_platform_display
libanv_files += files('anv_wsi_display.c')
endif
+if with_xlib_lease
+ anv_deps += dep_xcb_xrandr
+ anv_flags += [
+ '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT',
+ ]
+endif
+
libanv_common = static_library(
'anv_common',
[libanv_files, anv_entrypoints, anv_extensions_c, anv_extensions_h],
This extension adds the ability to borrow an X RandR output for temporary use directly by a Vulkan application to the anv driver. Signed-off-by: Keith Packard <keithp@keithp.com> --- src/intel/Makefile.vulkan.am | 7 +++++++ src/intel/vulkan/anv_extensions.py | 1 + src/intel/vulkan/anv_extensions_gen.py | 10 +++++----- src/intel/vulkan/anv_wsi_display.c | 30 ++++++++++++++++++++++++++++++ src/intel/vulkan/meson.build | 7 +++++++ 5 files changed, 50 insertions(+), 5 deletions(-)