[igt-dev] [v2 PATCH-i-g-t] tests/i915/gem_mmap_wc: Skip gtt test if aperture is missing

Vinay Belgaumkar vinay.belgaumkar at intel.com
Sat Jan 25 00:01:35 UTC 2020


Skip subtest on platforms that do not have mappable aperture.

v2: Skip the test_write_gtt as well when there is no aperture.
It seems like the purpose of this test was to mmap the buffer in
gtt even though it uses the incorrect mapping call. Until this
can be fixed, might be better to skip it. Also remove all subtests
that use run_without_prefault, since this debugfs is being removed.

Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar at intel.com>
Cc: Antonio Argenziano <antonio.argenziano at intel.com>
Cc: Ashutosh Dixit <ashutosh.dixit at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 tests/i915/gem_mmap_wc.c | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)

diff --git a/tests/i915/gem_mmap_wc.c b/tests/i915/gem_mmap_wc.c
index 375a9b50..c836aa20 100644
--- a/tests/i915/gem_mmap_wc.c
+++ b/tests/i915/gem_mmap_wc.c
@@ -461,15 +461,6 @@ test_pf_nonblock(int i915)
 	igt_spin_free(i915, spin);
 }
 
-static void
-run_without_prefault(int fd,
-			void (*func)(int fd))
-{
-	igt_disable_prefault();
-	func(fd);
-	igt_enable_prefault();
-}
-
 static int mmap_ioctl(int i915, struct drm_i915_gem_mmap *arg)
 {
 	int err = 0;
@@ -577,8 +568,10 @@ igt_main
 		test_write(fd);
 	igt_subtest("coherency")
 		test_coherency(fd);
-	igt_subtest("write-gtt")
+	igt_subtest("write-gtt") {
+		gem_require_mappable_ggtt(fd);
 		test_write_gtt(fd);
+	}
 	igt_subtest("read-write")
 		test_read_write(fd, READ_BEFORE_WRITE);
 	igt_subtest("write-read")
@@ -589,18 +582,14 @@ igt_main
 		test_read_write2(fd, READ_AFTER_WRITE);
 	igt_subtest("fault-concurrent")
 		test_fault_concurrent(fd);
-	igt_subtest("read-no-prefault")
-		run_without_prefault(fd, test_read);
-	igt_subtest("write-no-prefault")
-		run_without_prefault(fd, test_write);
-	igt_subtest("write-gtt-no-prefault")
-		run_without_prefault(fd, test_write_gtt);
 	igt_subtest("write-cpu-read-wc")
 		test_write_cpu_read_wc(fd, 1);
 	igt_subtest("write-cpu-read-wc-unflushed")
 		test_write_cpu_read_wc(fd, 0);
-	igt_subtest("write-gtt-read-wc")
+	igt_subtest("write-gtt-read-wc") {
+		gem_require_mappable_ggtt(fd);
 		test_write_gtt_read_wc(fd);
+	}
 	igt_subtest("pf-nonblock")
 		test_pf_nonblock(fd);
 	igt_subtest("set-cache-level")
-- 
2.22.0.245.g4d8ec15c66



More information about the igt-dev mailing list