diff options
author | Eric Anholt <eric@anholt.net> | 2016-01-22 17:18:56 -0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2016-02-08 16:34:13 -0800 |
commit | 3f83f07039753131f01dbc09f312ffd61c088e31 (patch) | |
tree | 1ab03d525f2cbb3d6c6be4bb6c9ce2ea75a27ee9 | |
parent | ceca9ef8d0a9fb64c1a4da11381f13adb6eca303 (diff) |
igt: Add support for DRIVER_VC4 flags on tests.
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Daniel Stone <daniels@collabora.com>
-rw-r--r-- | lib/drmtest.c | 16 | ||||
-rw-r--r-- | lib/drmtest.h | 1 |
2 files changed, 15 insertions, 2 deletions
diff --git a/lib/drmtest.c b/lib/drmtest.c index 2896af01..7b2227fe 100644 --- a/lib/drmtest.c +++ b/lib/drmtest.c @@ -100,6 +100,16 @@ static bool is_i915_device(int fd) return !ret && strcmp("i915", name) == 0; } +static bool is_vc4_device(int fd) +{ + int ret; + char name[5] = ""; + + ret = __get_drm_device_name(fd, name); + + return !ret && strcmp("vc4", name) == 0; +} + static bool is_intel(int fd) { struct drm_i915_getparam gp; @@ -237,7 +247,7 @@ int __drm_open_driver(int chipset) for (int i = 0; i < 16; i++) { char name[80]; int fd; - bool found_intel; + bool found_intel, found_vc4; sprintf(name, "/dev/dri/card%u", i); fd = open(name, O_RDWR); @@ -246,7 +256,9 @@ int __drm_open_driver(int chipset) found_intel = is_i915_device(fd) && is_intel(fd) && (chipset & DRIVER_INTEL); - if ((chipset & DRIVER_ANY) || found_intel) + found_vc4 = is_vc4_device(fd) && (chipset & DRIVER_VC4); + + if ((chipset & DRIVER_ANY) || found_intel || found_vc4) return fd; close(fd); diff --git a/lib/drmtest.h b/lib/drmtest.h index ed384ffe..9fcab931 100644 --- a/lib/drmtest.h +++ b/lib/drmtest.h @@ -40,6 +40,7 @@ #define DRIVER_ANY 0x1 #define DRIVER_INTEL (0x1 << 1) +#define DRIVER_VC4 (0x1 << 2) #ifdef ANDROID #if (!(defined HAVE_MMAP64)) && (!(defined __x86_64__)) |