From 36b92e809f378e18af980ffa5b29361bd28098cb Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 22 Apr 2017 13:45:18 +0100 Subject: igt: Import basic amdgpu tests from libdrm Simple copy and replace of the CUnit tests inside libdrm to form a basis for further prime integration testing. Signed-off-by: Chris Wilson --- lib/drmtest.c | 8 ++++++++ lib/drmtest.h | 1 + 2 files changed, 9 insertions(+) (limited to 'lib') diff --git a/lib/drmtest.c b/lib/drmtest.c index fab705ad..480bd0b1 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -122,6 +122,11 @@ static bool is_virtio_device(int fd) return __is_device(fd, "virt"); } +static bool is_amd_device(int fd) +{ + return __is_device(fd, "amdg"); +} + static bool has_known_intel_chipset(int fd) { struct drm_i915_getparam gp; @@ -271,6 +276,9 @@ int __drm_open_driver(int chipset) is_virtio_device(fd)) return fd; + if (chipset & DRIVER_AMDGPU && is_amd_device(fd)) + return fd; + /* Only VGEM-specific tests should be run on VGEM */ if (chipset == DRIVER_ANY && !is_vgem_device(fd)) return fd; diff --git a/lib/drmtest.h b/lib/drmtest.h index c9c019c0..a86799d5 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -42,6 +42,7 @@ #define DRIVER_VC4 (1 << 1) #define DRIVER_VGEM (1 << 2) #define DRIVER_VIRTIO (1 << 3) +#define DRIVER_AMDGPU (1 << 4) /* * Exclude DRVER_VGEM from DRIVER_ANY since if you run on a system * with vgem as well as a supported driver, you can end up with a -- cgit v1.2.3