[igt-dev] [PATCH i-g-t] tests/i915/gem_shrink: Fix memory requirement assertion

Niranjana Vishwanathapura niranjana.vishwanathapura at intel.com
Tue Nov 15 19:05:13 UTC 2022


The reclaim subtest do not require the alloc_size memory
allocations. Ensure the memory requirement assert is only
applied for other subtests.

Signed-off-by: Niranjana Vishwanathapura <niranjana.vishwanathapura at intel.com>
---
 tests/i915/gem_shrink.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/tests/i915/gem_shrink.c b/tests/i915/gem_shrink.c
index e3e20dfc9..380d2c846 100644
--- a/tests/i915/gem_shrink.c
+++ b/tests/i915/gem_shrink.c
@@ -456,9 +456,6 @@ igt_main
 			 num_processes, alloc_size);
 
 		alloc_size <<= 20;
-		igt_require_memory(num_processes, alloc_size,
-				   CHECK_SWAP | CHECK_RAM);
-
 		close(fd);
 	}
 
@@ -467,9 +464,12 @@ igt_main
 
 	for(const struct test *t = tests; t->name; t++) {
 		for(const struct mode *m = modes; m->suffix; m++) {
-			igt_subtest_f("%s%s", t->name, m->suffix)
+			igt_subtest_f("%s%s", t->name, m->suffix) {
+				igt_require_memory(num_processes, alloc_size,
+						   CHECK_SWAP | CHECK_RAM);
 				run_test(num_processes, alloc_size,
 					 t->func, m->flags);
+			}
 		}
 	}
 }
-- 
2.21.0.rc0.32.g243a4c7e27



More information about the igt-dev mailing list