[PATCH i-g-t] i915/gem_mmap_gtt: Skip if we have no aperture and no mmap_gtt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the device does not expose an aperture for indirect access with
detiling functionality, the kernel rejects an attempt to create such a
mapping with -ENODEV. If the ioctl is not supported, we can skip all of
our mmap_gtt specific tests.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Abdiel Janulgue <abdiel.janulgue@xxxxxxxxxxxxxxx>
Cc: Matthew Auld <matthew.auld@xxxxxxxxx>
Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
---
 tests/i915/gem_mmap_gtt.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index 91da5a37b..7738c47cb 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -1019,9 +1019,18 @@ igt_main
 	if (igt_run_in_simulation())
 		OBJECT_SIZE = 1 * 1024 * 1024;
 
-	igt_fixture
+	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
 
+		/*
+		 * If the HW lacks or does not expose an aperture for indirect
+		 * detiling access from untrusted userspace to the objects,
+		 * the kernel does an early rejection of the mmap_gtt ioctl.
+		 */
+		igt_require_f(mmap_ioctl(fd, &arg) != -ENODEV,
+			      "HW & kernel support for indirect detiling aperture\n");
+	}
+
 	igt_subtest("bad-object") {
 		uint32_t real_handle = gem_create(fd, 4096);
 		uint32_t handles[20];
-- 
2.24.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux