summaryrefslogtreecommitdiff
path: root/tests/i915/gem_mmap_gtt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-11-05 14:48:38 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2019-11-06 12:44:48 +0000
commitf21213012393bd8041ad93084ce29da088ef8426 (patch)
treeba87cd931992140ad7c0658734e344bac8389951 /tests/i915/gem_mmap_gtt.c
parent8a5d44dc5e51622cd43f23c2cf24d44c24a0564d (diff)
i915/gem_mmap_gtt: Skip if we have no aperture and no mmap_gtt
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@chris-wilson.co.uk> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Cc: Matthew Auld <matthew.auld@intel.com> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Diffstat (limited to 'tests/i915/gem_mmap_gtt.c')
-rw-r--r--tests/i915/gem_mmap_gtt.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/i915/gem_mmap_gtt.c b/tests/i915/gem_mmap_gtt.c
index 91da5a37..ac25f13e 100644
--- a/tests/i915/gem_mmap_gtt.c
+++ b/tests/i915/gem_mmap_gtt.c
@@ -1019,9 +1019,20 @@ igt_main
if (igt_run_in_simulation())
OBJECT_SIZE = 1 * 1024 * 1024;
- igt_fixture
+ igt_fixture {
+ struct drm_i915_gem_mmap_gtt arg = {};
+
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];