Mesa (master): vulkan/wsi: use the drmGetDevice2() API

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 30 16:42:30 UTC 2018


Module: Mesa
Branch: master
Commit: c210d0c3b72ac426ee18b43f036e1a852a39950b
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c210d0c3b72ac426ee18b43f036e1a852a39950b

Author: Emil Velikov <emil.velikov at collabora.com>
Date:   Mon Oct 22 17:43:03 2018 +0100

vulkan/wsi: use the drmGetDevice2() API

On older kernels, the drmGetDevice() call will wake up all the GPUs
on the system, while fetching the PCI revision.

Use the 2 version of the API and pass flags == 0, so we don't fetch the
device PCI revision, since we don't need that information.

Fixes: baa38c144f6 ("vulkan/wsi: Use VK_EXT_pci_bus_info for DRM fd matching")
Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/vulkan/wsi/wsi_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/vulkan/wsi/wsi_common.c b/src/vulkan/wsi/wsi_common.c
index 51d8655a5a..1cd5f8d62c 100644
--- a/src/vulkan/wsi/wsi_common.c
+++ b/src/vulkan/wsi/wsi_common.c
@@ -135,7 +135,7 @@ bool
 wsi_device_matches_drm_fd(const struct wsi_device *wsi, int drm_fd)
 {
    drmDevicePtr fd_device;
-   int ret = drmGetDevice(drm_fd, &fd_device);
+   int ret = drmGetDevice2(drm_fd, 0, &fd_device);
    if (ret)
       return false;
 




More information about the mesa-commit mailing list