[igt-dev] [PATCH v3 2/3] igt: Add igt_vc4_get_param() helper

Boris Brezillon boris.brezillon at bootlin.com
Wed Feb 7 09:09:09 UTC 2018


From: Boris Brezillon <boris.brezillon at free-electrons.com>

v2: Rebase on get/set_tiling helpers (by anholt).

Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
Signed-off-by: Eric Anholt <eric at anholt.net>
Reviewed-by: Eric Anholt <eric at anholt.net>
---
 lib/igt_vc4.c | 15 +++++++++++++++
 lib/igt_vc4.h |  1 +
 2 files changed, 16 insertions(+)

diff --git a/lib/igt_vc4.c b/lib/igt_vc4.c
index 238bf26bd6bb..16dfe67a44b1 100644
--- a/lib/igt_vc4.c
+++ b/lib/igt_vc4.c
@@ -150,6 +150,21 @@ uint64_t igt_vc4_get_tiling(int fd, uint32_t handle)
 	return get.modifier;
 }
 
+int igt_vc4_get_param(int fd, uint32_t param, uint64_t *val)
+{
+	struct drm_vc4_get_param arg = {
+		.param = param,
+	};
+	int ret;
+
+	ret = igt_ioctl(fd, DRM_IOCTL_VC4_GET_PARAM, &arg);
+	if (ret)
+		return ret;
+
+	*val = arg.value;
+	return 0;
+}
+
 bool igt_vc4_purgeable_bo(int fd, int handle, bool purgeable)
 {
 	struct drm_vc4_gem_madvise arg = {
diff --git a/lib/igt_vc4.h b/lib/igt_vc4.h
index 2c016b16debd..ebc8a3881b5e 100644
--- a/lib/igt_vc4.h
+++ b/lib/igt_vc4.h
@@ -27,6 +27,7 @@
 uint32_t igt_vc4_get_cleared_bo(int fd, size_t size, uint32_t clearval);
 int igt_vc4_create_bo(int fd, size_t size);
 void *igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot);
+int igt_vc4_get_param(int fd, uint32_t param, uint64_t *val);
 bool igt_vc4_purgeable_bo(int fd, int handle, bool purgeable);
 
 void igt_vc4_set_tiling(int fd, uint32_t handle, uint64_t modifier);
-- 
2.14.1



More information about the igt-dev mailing list