From 0a44a680ff702bb4488c345db84a35c190be345e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 19 Feb 2017 15:27:47 +1000 Subject: vulkan/wsi/x11: add support to detect if we can support rendering (v3) This adds support to radv_GetPhysicalDeviceXlibPresentationSupportKHR and radv_GetPhysicalDeviceXcbPresentationSupportKHR to check if the local device file descriptor is compatible with the descriptor retrieved from the X server via DRI3. This will stop radv binding to an X server until we have prime support in place. Hopefully apps use this API before trying to render things. v2: drop unneeded function, don't leak memory. (jekstrand) v3: also check in surface_get_support callback. Reviewed-by: Jason Ekstrand Signed-off-by: Dave Airlie --- src/amd/vulkan/radv_wsi_x11.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/amd/vulkan/radv_wsi_x11.c') diff --git a/src/amd/vulkan/radv_wsi_x11.c b/src/amd/vulkan/radv_wsi_x11.c index 946b99095ac..97d4277c490 100644 --- a/src/amd/vulkan/radv_wsi_x11.c +++ b/src/amd/vulkan/radv_wsi_x11.c @@ -45,7 +45,9 @@ VkBool32 radv_GetPhysicalDeviceXcbPresentationSupportKHR( return wsi_get_physical_device_xcb_presentation_support( &device->wsi_device, &device->instance->alloc, - queueFamilyIndex, connection, visual_id); + queueFamilyIndex, + device->local_fd, + connection, visual_id); } VkBool32 radv_GetPhysicalDeviceXlibPresentationSupportKHR( @@ -59,7 +61,9 @@ VkBool32 radv_GetPhysicalDeviceXlibPresentationSupportKHR( return wsi_get_physical_device_xcb_presentation_support( &device->wsi_device, &device->instance->alloc, - queueFamilyIndex, XGetXCBConnection(dpy), visualID); + queueFamilyIndex, + device->local_fd, + XGetXCBConnection(dpy), visualID); } VkResult radv_CreateXcbSurfaceKHR( -- cgit v1.2.3