vulkan: EXT_acquire_xlib_display requires libXrandr headers to build
authorKeith Packard <keithp@keithp.com>
Tue, 19 Jun 2018 22:58:30 +0000 (15:58 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 20 Jun 2018 17:42:05 +0000 (10:42 -0700)
When VK_USE_PLATFORM_XLIB_XRANDR_EXT is defined, vulkan.h includes
X11/extensions/Xrandr.h for the RROutput typedef which is used in
the vkGetRandROutputDisplayEXT interface.

Make sure we have the required header by checking during the build,
and also set CFLAGS to point at the right directory.

We don't need to link against the library as we don't use any
functions from there, so don't add the _LIBS value in the autotools
build.

Signed-off-by: Keith Packard <keithp@keithp.com>
Fixes: dbac8e25f851ed44c51f "radv: Add EXT_acquire_xlib_display to radv driver [v2]"
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
configure.ac
meson.build
src/amd/vulkan/Makefile.am
src/amd/vulkan/meson.build
src/intel/Makefile.vulkan.am
src/intel/vulkan/meson.build
src/vulkan/Makefile.am
src/vulkan/wsi/meson.build

index 2e7983de000b6ba49f9a35bd716949d19b0fabbc..7af5d9a0e44d86dc339afda23359d635452ce8c9 100644 (file)
@@ -1881,6 +1881,8 @@ fi
 if test x"$have_xlease" = xyes; then
     randr_modules="x11-xcb xcb-randr"
     PKG_CHECK_MODULES([XCB_RANDR], [$randr_modules])
+    xlib_randr_modules="xrandr"
+    PKG_CHECK_MODULES([XLIB_RANDR], [$xlib_randr_modules])
 fi
 
 AM_CONDITIONAL(HAVE_PLATFORM_X11, echo "$platforms" | grep -q 'x11')
index e834adbb249637cc68ec422877a6f9f7eeeef2b4..76aa10f81a527f5986754e7b89c7f0954334bd7f 100644 (file)
@@ -1308,6 +1308,7 @@ dep_xcb_sync = null_dep
 dep_xcb_xfixes = null_dep
 dep_xshmfence = null_dep
 dep_xcb_xrandr = null_dep
+dep_xlib_xrandr = null_dep
 if with_platform_x11
   if with_glx == 'xlib' or with_glx == 'gallium-xlib'
     dep_x11 = dependency('x11')
@@ -1356,6 +1357,7 @@ if with_platform_x11
   endif
   if with_xlib_lease
     dep_xcb_xrandr = dependency('xcb-randr', version : '>= 1.12')
+    dep_xlib_xrandr = dependency('xrandr', version : '>= 1.3')
   endif
 endif
 
index 8279fe4a81f1d210f208df857089daaa462bc8b2..f9d3622f744eb662119e43eea8deddd09e03d0c9 100644 (file)
@@ -90,7 +90,8 @@ endif
 if HAVE_XLIB_LEASE
 AM_CPPFLAGS += \
        -DVK_USE_PLATFORM_XLIB_XRANDR_EXT \
-       $(XCB_RANDR_CFLAGS)
+       $(XCB_RANDR_CFLAGS) \
+       $(XLIB_RANDR_CFLAGS)
 
 VULKAN_LIB_DEPS += $(XCB_RANDR_LIBS)
 endif
index bcdf83e06097aad6ff1f489393485bc2ccd2c1f1..22857926fa1dee4ae05edaa2fc75ef0bf7da80c2 100644 (file)
@@ -121,7 +121,7 @@ if with_platform_drm
 endif
 
 if with_xlib_lease
-  radv_deps += dep_xcb_xrandr
+  radv_deps += [dep_xcb_xrandr, dep_xlib_xrandr]
   radv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
 endif
 
index ae6256958146f32d8077c56bc19c9f8cab466a07..4a80c3ae4127ff9f41f8c916e448918035cb4e90 100644 (file)
@@ -202,7 +202,8 @@ endif
 if HAVE_XLIB_LEASE
 VULKAN_CPPFLAGS += \
        -DVK_USE_PLATFORM_XLIB_XRANDR_EXT \
-       $(XCB_RANDR_CFLAGS)
+       $(XCB_RANDR_CFLAGS) \
+       $(XLIB_RANDR_CFLAGS)
 VULKAN_LIB_DEPS += $(XCB_RANDR_LIBS)
 endif
 
index 4b0652f757baae491939908dd7b0b6622e4b2999..e427c7471f4766ca866a75852a1240f26474006f 100644 (file)
@@ -170,7 +170,7 @@ if with_platform_drm
 endif
 
 if with_xlib_lease
-  anv_deps += dep_xcb_xrandr
+  anv_deps += [dep_xcb_xrandr, dep_xlib_xrandr]
   anv_flags += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
 endif
 
index 9deb6e18ff00d7a8cf0ee44b371e49c25b748b6f..ce1a79d0c480fcf65034b83a7a4dc48145a7ecba 100644 (file)
@@ -63,6 +63,8 @@ endif
 
 if HAVE_XLIB_LEASE
 AM_CPPFLAGS += \
+       $(XCB_RANDR_CFLAGS) \
+       $(XLIB_RANDR_CFLAGS) \
        -DVK_USE_PLATFORM_XLIB_XRANDR_EXT
 endif
 
index 3501a864e18be7e0dd431772d4ccb22b57d2087d..d073b23dc2586a3fcc985ed3e1c963dbc595e2c6 100644 (file)
@@ -68,7 +68,7 @@ if with_platform_drm
 endif
 
 if with_xlib_lease
-  vulkan_wsi_deps += dep_xcb_xrandr
+  vulkan_wsi_deps += [dep_xcb_xrandr, dep_xlib_xrandr]
   vulkan_wsi_args += '-DVK_USE_PLATFORM_XLIB_XRANDR_EXT'
 endif