Re: [Mesa-dev] [PATCH] vulkan/wsi: Use VK_EXT_pci_bus_info for DRM fd matching
Hi, On 18/10/2018 17:13, Jason Ekstrand wrote: This lets us avoid passing the DRM fd around all over the place and gets us closer to layer utopia. --- src/amd/vulkan/radv_wsi.c | 3 -- src/amd/vulkan/radv_wsi_x11.c | 4 +-- src/intel/vulkan/anv_wsi.c | 4 +-- src/intel/vulkan/anv_wsi_x11.c | 4 +-- src/vulkan/wsi/wsi_common.c | 45 + src/vulkan/wsi/wsi_common.h | 5 ++-- src/vulkan/wsi/wsi_common_display.c | 22 +- src/vulkan/wsi/wsi_common_private.h | 6 ++-- src/vulkan/wsi/wsi_common_wayland.c | 3 -- src/vulkan/wsi/wsi_common_x11.c | 34 +++--- src/vulkan/wsi/wsi_common_x11.h | 1 - 11 files changed, 61 insertions(+), 70 deletions(-) unfortunately this regresses radv, see https://bugs.freedesktop.org/show_bug.cgi?id=108491 Thanks, Andre ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] vulkan/wsi: Use VK_EXT_pci_bus_info for DRM fd matching
On Thursday, 2018-10-18 10:13:39 -0500, Jason Ekstrand wrote: > This lets us avoid passing the DRM fd around all over the place and gets > us closer to layer utopia. Yay! Reviewed-by: Eric Engestrom > --- > src/amd/vulkan/radv_wsi.c | 3 -- > src/amd/vulkan/radv_wsi_x11.c | 4 +-- > src/intel/vulkan/anv_wsi.c | 4 +-- > src/intel/vulkan/anv_wsi_x11.c | 4 +-- > src/vulkan/wsi/wsi_common.c | 45 + > src/vulkan/wsi/wsi_common.h | 5 ++-- > src/vulkan/wsi/wsi_common_display.c | 22 +- > src/vulkan/wsi/wsi_common_private.h | 6 ++-- > src/vulkan/wsi/wsi_common_wayland.c | 3 -- > src/vulkan/wsi/wsi_common_x11.c | 34 +++--- > src/vulkan/wsi/wsi_common_x11.h | 1 - > 11 files changed, 61 insertions(+), 70 deletions(-) > > diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c > index 43103a4ef85..346fb43d675 100644 > --- a/src/amd/vulkan/radv_wsi.c > +++ b/src/amd/vulkan/radv_wsi.c > @@ -72,7 +72,6 @@ VkResult radv_GetPhysicalDeviceSurfaceSupportKHR( > RADV_FROM_HANDLE(radv_physical_device, device, physicalDevice); > > return wsi_common_get_surface_support(>wsi_device, > - device->local_fd, > queueFamilyIndex, > surface, > pSupported); > @@ -171,7 +170,6 @@ VkResult radv_CreateSwapchainKHR( > > return wsi_common_create_swapchain(>physical_device->wsi_device, > radv_device_to_handle(device), > -device->physical_device->local_fd, > pCreateInfo, > alloc, > pSwapchain); > @@ -294,7 +292,6 @@ VkResult radv_GetPhysicalDevicePresentRectanglesKHR( > RADV_FROM_HANDLE(radv_physical_device, device, physicalDevice); > > return wsi_common_get_present_rectangles(>wsi_device, > - device->local_fd, >surface, >pRectCount, pRects); > } > diff --git a/src/amd/vulkan/radv_wsi_x11.c b/src/amd/vulkan/radv_wsi_x11.c > index 9ef02ccc435..f3ebc791e2d 100644 > --- a/src/amd/vulkan/radv_wsi_x11.c > +++ b/src/amd/vulkan/radv_wsi_x11.c > @@ -45,7 +45,7 @@ VkBool32 radv_GetPhysicalDeviceXcbPresentationSupportKHR( > return wsi_get_physical_device_xcb_presentation_support( >>wsi_device, >queueFamilyIndex, > - device->local_fd, true, > + true, >connection, visual_id); > } > > @@ -60,7 +60,7 @@ VkBool32 radv_GetPhysicalDeviceXlibPresentationSupportKHR( > return wsi_get_physical_device_xcb_presentation_support( >>wsi_device, >queueFamilyIndex, > - device->local_fd, true, > + true, >XGetXCBConnection(dpy), visualID); > } > > diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c > index 5d672c211c4..024bc1c245d 100644 > --- a/src/intel/vulkan/anv_wsi.c > +++ b/src/intel/vulkan/anv_wsi.c > @@ -89,7 +89,6 @@ VkResult anv_GetPhysicalDeviceSurfaceSupportKHR( > ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); > > return wsi_common_get_surface_support(>wsi_device, > - device->local_fd, > queueFamilyIndex, > surface, > pSupported); > @@ -183,7 +182,7 @@ VkResult anv_CreateSwapchainKHR( > else > alloc = >alloc; > > - return wsi_common_create_swapchain(wsi_device, _device, device->fd, > + return wsi_common_create_swapchain(wsi_device, _device, >pCreateInfo, alloc, pSwapchain); > } > > @@ -303,7 +302,6 @@ VkResult anv_GetPhysicalDevicePresentRectanglesKHR( > ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); > > return wsi_common_get_present_rectangles(>wsi_device, > -device->local_fd, > surface, > pRectCount, pRects); > } > diff --git a/src/intel/vulkan/anv_wsi_x11.c b/src/intel/vulkan/anv_wsi_x11.c > index 45c43f6f17f..bfa76e88e79 100644 > --- a/src/intel/vulkan/anv_wsi_x11.c > +++ b/src/intel/vulkan/anv_wsi_x11.c > @@ -41,7 +41,7 @@ VkBool32 anv_GetPhysicalDeviceXcbPresentationSupportKHR( > return wsi_get_physical_device_xcb_presentation_support( >>wsi_device, >queueFamilyIndex, > - device->local_fd, false, > + false, >connection, visual_id); > } > > @@ -56,7 +56,7 @@ VkBool32 anv_GetPhysicalDeviceXlibPresentationSupportKHR( > return
Re: [Mesa-dev] [PATCH] vulkan/wsi: Use VK_EXT_pci_bus_info for DRM fd matching
Looks good : Reviewed-by: Lionel Landwerlin On 18/10/2018 16:13, Jason Ekstrand wrote: This lets us avoid passing the DRM fd around all over the place and gets us closer to layer utopia. --- src/amd/vulkan/radv_wsi.c | 3 -- src/amd/vulkan/radv_wsi_x11.c | 4 +-- src/intel/vulkan/anv_wsi.c | 4 +-- src/intel/vulkan/anv_wsi_x11.c | 4 +-- src/vulkan/wsi/wsi_common.c | 45 + src/vulkan/wsi/wsi_common.h | 5 ++-- src/vulkan/wsi/wsi_common_display.c | 22 +- src/vulkan/wsi/wsi_common_private.h | 6 ++-- src/vulkan/wsi/wsi_common_wayland.c | 3 -- src/vulkan/wsi/wsi_common_x11.c | 34 +++--- src/vulkan/wsi/wsi_common_x11.h | 1 - 11 files changed, 61 insertions(+), 70 deletions(-) diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c index 43103a4ef85..346fb43d675 100644 --- a/src/amd/vulkan/radv_wsi.c +++ b/src/amd/vulkan/radv_wsi.c @@ -72,7 +72,6 @@ VkResult radv_GetPhysicalDeviceSurfaceSupportKHR( RADV_FROM_HANDLE(radv_physical_device, device, physicalDevice); return wsi_common_get_surface_support(>wsi_device, - device->local_fd, queueFamilyIndex, surface, pSupported); @@ -171,7 +170,6 @@ VkResult radv_CreateSwapchainKHR( return wsi_common_create_swapchain(>physical_device->wsi_device, radv_device_to_handle(device), - device->physical_device->local_fd, pCreateInfo, alloc, pSwapchain); @@ -294,7 +292,6 @@ VkResult radv_GetPhysicalDevicePresentRectanglesKHR( RADV_FROM_HANDLE(radv_physical_device, device, physicalDevice); return wsi_common_get_present_rectangles(>wsi_device, -device->local_fd, surface, pRectCount, pRects); } diff --git a/src/amd/vulkan/radv_wsi_x11.c b/src/amd/vulkan/radv_wsi_x11.c index 9ef02ccc435..f3ebc791e2d 100644 --- a/src/amd/vulkan/radv_wsi_x11.c +++ b/src/amd/vulkan/radv_wsi_x11.c @@ -45,7 +45,7 @@ VkBool32 radv_GetPhysicalDeviceXcbPresentationSupportKHR( return wsi_get_physical_device_xcb_presentation_support( >wsi_device, queueFamilyIndex, - device->local_fd, true, + true, connection, visual_id); } @@ -60,7 +60,7 @@ VkBool32 radv_GetPhysicalDeviceXlibPresentationSupportKHR( return wsi_get_physical_device_xcb_presentation_support( >wsi_device, queueFamilyIndex, - device->local_fd, true, + true, XGetXCBConnection(dpy), visualID); } diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c index 5d672c211c4..024bc1c245d 100644 --- a/src/intel/vulkan/anv_wsi.c +++ b/src/intel/vulkan/anv_wsi.c @@ -89,7 +89,6 @@ VkResult anv_GetPhysicalDeviceSurfaceSupportKHR( ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); return wsi_common_get_surface_support(>wsi_device, - device->local_fd, queueFamilyIndex, surface, pSupported); @@ -183,7 +182,7 @@ VkResult anv_CreateSwapchainKHR( else alloc = >alloc; - return wsi_common_create_swapchain(wsi_device, _device, device->fd, + return wsi_common_create_swapchain(wsi_device, _device, pCreateInfo, alloc, pSwapchain); } @@ -303,7 +302,6 @@ VkResult anv_GetPhysicalDevicePresentRectanglesKHR( ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); return wsi_common_get_present_rectangles(>wsi_device, -device->local_fd, surface, pRectCount, pRects); } diff --git a/src/intel/vulkan/anv_wsi_x11.c b/src/intel/vulkan/anv_wsi_x11.c index 45c43f6f17f..bfa76e88e79 100644 --- a/src/intel/vulkan/anv_wsi_x11.c +++ b/src/intel/vulkan/anv_wsi_x11.c @@ -41,7 +41,7 @@ VkBool32 anv_GetPhysicalDeviceXcbPresentationSupportKHR( return wsi_get_physical_device_xcb_presentation_support( >wsi_device, queueFamilyIndex, - device->local_fd, false, + false, connection, visual_id); } @@ -56,7 +56,7 @@ VkBool32 anv_GetPhysicalDeviceXlibPresentationSupportKHR( return wsi_get_physical_device_xcb_presentation_support( >wsi_device, queueFamilyIndex, - device->local_fd, false, + false,
[Mesa-dev] [PATCH] vulkan/wsi: Use VK_EXT_pci_bus_info for DRM fd matching
This lets us avoid passing the DRM fd around all over the place and gets us closer to layer utopia. --- src/amd/vulkan/radv_wsi.c | 3 -- src/amd/vulkan/radv_wsi_x11.c | 4 +-- src/intel/vulkan/anv_wsi.c | 4 +-- src/intel/vulkan/anv_wsi_x11.c | 4 +-- src/vulkan/wsi/wsi_common.c | 45 + src/vulkan/wsi/wsi_common.h | 5 ++-- src/vulkan/wsi/wsi_common_display.c | 22 +- src/vulkan/wsi/wsi_common_private.h | 6 ++-- src/vulkan/wsi/wsi_common_wayland.c | 3 -- src/vulkan/wsi/wsi_common_x11.c | 34 +++--- src/vulkan/wsi/wsi_common_x11.h | 1 - 11 files changed, 61 insertions(+), 70 deletions(-) diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c index 43103a4ef85..346fb43d675 100644 --- a/src/amd/vulkan/radv_wsi.c +++ b/src/amd/vulkan/radv_wsi.c @@ -72,7 +72,6 @@ VkResult radv_GetPhysicalDeviceSurfaceSupportKHR( RADV_FROM_HANDLE(radv_physical_device, device, physicalDevice); return wsi_common_get_surface_support(>wsi_device, - device->local_fd, queueFamilyIndex, surface, pSupported); @@ -171,7 +170,6 @@ VkResult radv_CreateSwapchainKHR( return wsi_common_create_swapchain(>physical_device->wsi_device, radv_device_to_handle(device), - device->physical_device->local_fd, pCreateInfo, alloc, pSwapchain); @@ -294,7 +292,6 @@ VkResult radv_GetPhysicalDevicePresentRectanglesKHR( RADV_FROM_HANDLE(radv_physical_device, device, physicalDevice); return wsi_common_get_present_rectangles(>wsi_device, -device->local_fd, surface, pRectCount, pRects); } diff --git a/src/amd/vulkan/radv_wsi_x11.c b/src/amd/vulkan/radv_wsi_x11.c index 9ef02ccc435..f3ebc791e2d 100644 --- a/src/amd/vulkan/radv_wsi_x11.c +++ b/src/amd/vulkan/radv_wsi_x11.c @@ -45,7 +45,7 @@ VkBool32 radv_GetPhysicalDeviceXcbPresentationSupportKHR( return wsi_get_physical_device_xcb_presentation_support( >wsi_device, queueFamilyIndex, - device->local_fd, true, + true, connection, visual_id); } @@ -60,7 +60,7 @@ VkBool32 radv_GetPhysicalDeviceXlibPresentationSupportKHR( return wsi_get_physical_device_xcb_presentation_support( >wsi_device, queueFamilyIndex, - device->local_fd, true, + true, XGetXCBConnection(dpy), visualID); } diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c index 5d672c211c4..024bc1c245d 100644 --- a/src/intel/vulkan/anv_wsi.c +++ b/src/intel/vulkan/anv_wsi.c @@ -89,7 +89,6 @@ VkResult anv_GetPhysicalDeviceSurfaceSupportKHR( ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); return wsi_common_get_surface_support(>wsi_device, - device->local_fd, queueFamilyIndex, surface, pSupported); @@ -183,7 +182,7 @@ VkResult anv_CreateSwapchainKHR( else alloc = >alloc; - return wsi_common_create_swapchain(wsi_device, _device, device->fd, + return wsi_common_create_swapchain(wsi_device, _device, pCreateInfo, alloc, pSwapchain); } @@ -303,7 +302,6 @@ VkResult anv_GetPhysicalDevicePresentRectanglesKHR( ANV_FROM_HANDLE(anv_physical_device, device, physicalDevice); return wsi_common_get_present_rectangles(>wsi_device, -device->local_fd, surface, pRectCount, pRects); } diff --git a/src/intel/vulkan/anv_wsi_x11.c b/src/intel/vulkan/anv_wsi_x11.c index 45c43f6f17f..bfa76e88e79 100644 --- a/src/intel/vulkan/anv_wsi_x11.c +++ b/src/intel/vulkan/anv_wsi_x11.c @@ -41,7 +41,7 @@ VkBool32 anv_GetPhysicalDeviceXcbPresentationSupportKHR( return wsi_get_physical_device_xcb_presentation_support( >wsi_device, queueFamilyIndex, - device->local_fd, false, + false, connection, visual_id); } @@ -56,7 +56,7 @@ VkBool32 anv_GetPhysicalDeviceXlibPresentationSupportKHR( return wsi_get_physical_device_xcb_presentation_support( >wsi_device, queueFamilyIndex, - device->local_fd, false, + false, XGetXCBConnection(dpy), visualID); } diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c index ad4b8c9075e..51d8655a5a9