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

Submitted by Paul Kocialkowski on Dec. 6, 2018, 2:11 p.m.

Details

Message ID 20181206141132.23349-4-paul.kocialkowski@bootlin.com
State New
Series "Chamelium VC4 plane testing, with T-tiled mode"
Headers show

Commit Message

Paul Kocialkowski Dec. 6, 2018, 2:11 p.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>
---
 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 d2aa1c19..53ea7598 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 96ee517e..1d11bff9 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:

Comments

Lyude Paul Dec. 6, 2018, 10:55 p.m.
Reviewed-by: Lyude Paul <lyude@redhat.com>

On Thu, 2018-12-06 at 15:11 +0100, Paul Kocialkowski wrote:
> 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>
> ---
>  lib/drmtest.c | 10 ++++++++++
>  lib/drmtest.h |  2 ++
>  2 files changed, 12 insertions(+)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index d2aa1c19..53ea7598 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 96ee517e..1d11bff9 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: