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 /lib/drmtest.c | |
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>
Diffstat (limited to 'lib/drmtest.c')
-rw-r--r-- | lib/drmtest.c | 16 |
1 files changed, 14 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); |