summaryrefslogtreecommitdiff
path: root/lib/igt_vc4.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2017-06-07 13:31:51 -0700
committerEric Anholt <eric@anholt.net>2017-11-21 09:59:27 -0800
commit02a0a9ce9720337cf55b69531cf081d36118ffca (patch)
tree2205fde7105e0b523728f9ec710c73c13615fcba /lib/igt_vc4.c
parentaa97faa3828488478d97c1fce51650591681bdc9 (diff)
igt/vc4_tiling: Test vc4's new set/get_tiling ioctls.
This just checks that the appropriate errors get thrown, and that the modifier can be set/get successfully, and that the modifier doesn't leak to other BO allocations. Testing of scanout will be done with the writeback support that Boris is building. The modifier has no effect on V3D rendering, so no need to test that. v2: Add to the meson build. Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'lib/igt_vc4.c')
-rw-r--r--lib/igt_vc4.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/igt_vc4.c b/lib/igt_vc4.c
index c4682f56..5347af8d 100644
--- a/lib/igt_vc4.c
+++ b/lib/igt_vc4.c
@@ -128,3 +128,24 @@ igt_vc4_mmap_bo(int fd, uint32_t handle, uint32_t size, unsigned prot)
else
return ptr;
}
+
+void igt_vc4_set_tiling(int fd, uint32_t handle, uint64_t modifier)
+{
+ struct drm_vc4_set_tiling set = {
+ .handle = handle,
+ .modifier = modifier,
+ };
+
+ do_ioctl(fd, DRM_IOCTL_VC4_SET_TILING, &set);
+}
+
+uint64_t igt_vc4_get_tiling(int fd, uint32_t handle)
+{
+ struct drm_vc4_get_tiling get = {
+ .handle = handle,
+ };
+
+ do_ioctl(fd, DRM_IOCTL_VC4_GET_TILING, &get);
+
+ return get.modifier;
+}