[igt-dev] [PATCH i-g-t v2 04/12] lib: drmtest: Add helpers to check and require the VC4 driver

Paul Kocialkowski paul.kocialkowski at bootlin.com
Thu Dec 13 15:55:25 UTC 2018


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 at bootlin.com>
Reviewed-by: Lyude Paul <lyude at redhat.com>
---
 lib/drmtest.c | 10 ++++++++++
 lib/drmtest.h |  2 ++
 2 files changed, 12 insertions(+)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index d2aa1c19154f..53ea75980f2a 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;
@@ -444,3 +449,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 96ee517e2ec1..1d11bff9361c 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -78,8 +78,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:
-- 
2.19.2



More information about the igt-dev mailing list