radv/winsys: use drmGetDevice2 API
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 1 Dec 2016 19:53:11 +0000 (19:53 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 15 Mar 2017 11:38:00 +0000 (11:38 +0000)
Analogous to previous commit

v2: Add explicit require_libdrm check.

Cc: Dave Airlie <airlied@redhat.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1)
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> (v1)
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1)
Tested-by: Mike Lothian <mike@fireburn.co.uk>
configure.ac
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c

index 6b65ff831c500d3aaeb67d003bd53f0ad20f694c..a006976a0ca94e33011dcc5e7a1d0d684d307ca1 100644 (file)
@@ -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
index c9f52359912bb5d4409939560c30e2e7081dfcd0..783567fa5b4fd0cfb73e21b7c04121113facb9e1 100644 (file)
@@ -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;