From 8ff2937dfa60dd86ed0ee0b5bfb3d80f5ab0ae7e Mon Sep 17 00:00:00 2001 From: Emil Velikov Date: Thu, 1 Dec 2016 19:53:11 +0000 Subject: [PATCH] radv/winsys: use drmGetDevice2 API MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Analogous to previous commit v2: Add explicit require_libdrm check. Cc: Dave Airlie Signed-off-by: Emil Velikov Reviewed-by: Michel Dänzer (v1) Reviewed-by: Bas Nieuwenhuizen (v1) Reviewed-by: Eric Engestrom (v1) Tested-by: Mike Lothian --- configure.ac | 1 + src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 6b65ff831c5..a006976a0ca 100644 --- a/configure.ac +++ b/configure.ac @@ -1792,6 +1792,7 @@ if test -n "$with_vulkan_drivers"; then ;; xradeon) + require_libdrm "radv" PKG_CHECK_MODULES([AMDGPU], [libdrm >= $LIBDRM_AMDGPU_REQUIRED libdrm_amdgpu >= $LIBDRM_AMDGPU_REQUIRED]) radeon_llvm_check $LLVM_REQUIRED_RADV "radv" HAVE_RADEON_VULKAN=yes diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c index c9f52359912..783567fa5b4 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c @@ -124,9 +124,9 @@ do_winsys_init(struct radv_amdgpu_winsys *ws, int fd) int r; int i, j; /* Get PCI info. */ - r = drmGetDevice(fd, &devinfo); + r = drmGetDevice2(fd, 0, &devinfo); if (r) { - fprintf(stderr, "amdgpu: drmGetDevice failed.\n"); + fprintf(stderr, "amdgpu: drmGetDevice2 failed.\n"); goto fail; } ws->info.pci_domain = devinfo->businfo.pci->domain; -- 2.30.2