[i-g-t,v3,01/21] lib: drmtest: Add helpers to check and require the VC4 driver

Submitted by Paul Kocialkowski on Jan. 11, 2019, 9:05 a.m.

Details

Message ID 20190111090532.19235-2-paul.kocialkowski@bootlin.com
State New
Series "Chamelium VC4 plane fuzzy testing, with SAND and T-tiled mode"
Headers show

Commit Message

Paul Kocialkowski Jan. 11, 2019, 9:05 a.m.
In order to add support for features specific to the VC4 driver, add
helpers for checking and requiring the driver like it's done for the
i915 driver.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Reviewed-by: Lyude Paul <lyude@redhat.com>
Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
---
 lib/drmtest.c | 10 ++++++++++
 lib/drmtest.h |  2 ++
 2 files changed, 12 insertions(+)

Patch hide | download patch | download mbox

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 35914c502432..f7a93c2419c5 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -105,6 +105,11 @@  bool is_i915_device(int fd)
 	return __is_device(fd, "i915");
 }
 
+bool is_vc4_device(int fd)
+{
+	return __is_device(fd, "vc4");
+}
+
 static bool has_known_intel_chipset(int fd)
 {
 	struct drm_i915_getparam gp;
@@ -476,3 +481,8 @@  void igt_require_intel(int fd)
 {
 	igt_require(is_i915_device(fd) && has_known_intel_chipset(fd));
 }
+
+void igt_require_vc4(int fd)
+{
+	igt_require(is_vc4_device(fd));
+}
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 8743b1bb1ed3..ca347a7120db 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -80,8 +80,10 @@  int __drm_open_driver(int chipset);
 void gem_quiescent_gpu(int fd);
 
 void igt_require_intel(int fd);
+void igt_require_vc4(int fd);
 
 bool is_i915_device(int fd);
+bool is_vc4_device(int fd);
 
 /**
  * do_or_die: