[igt-dev] [PATCH i-g-t v9 27/29] tests/gem_ppgtt: Migrate memory check out of render blits

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Mon Nov 16 08:52:08 UTC 2020


Running memory cache flush when bcs is doing blits leads to serializing
bcs and rcs part. So we move memory check before blitting giving chance
to parallel the execution.

Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>
Cc: Dominik Grzegorzek <dominik.grzegorzek at intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 tests/i915/gem_ppgtt.c | 46 +++++++++++++++++++++++-------------------
 1 file changed, 25 insertions(+), 21 deletions(-)

diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c
index b9b3d1fc..5c138abe 100644
--- a/tests/i915/gem_ppgtt.c
+++ b/tests/i915/gem_ppgtt.c
@@ -81,14 +81,8 @@ static void fork_rcs_copy(int timeout, uint32_t final,
 #define CREATE_CONTEXT 0x1
 {
 	igt_render_copyfunc_t render_copy;
-	uint64_t mem_per_child;
 	int devid;
 
-	mem_per_child = SIZE;
-	if (flags & CREATE_CONTEXT)
-		mem_per_child += 2 * 128 * 1024; /* rough context sizes */
-	intel_require_memory(count, mem_per_child, CHECK_RAM);
-
 	for (int child = 0; child < count; child++) {
 		int fd = drm_open_driver(DRIVER_INTEL);
 		struct buf_ops *bops;
@@ -278,7 +272,8 @@ static bool has_contexts(void)
 	return result;
 }
 
-#define N_CHILD 8
+#define BCS_CHILD 1
+#define RCS_CHILD 8
 igt_main
 {
 	igt_fixture {
@@ -289,41 +284,50 @@ igt_main
 	}
 
 	igt_subtest("blt-vs-render-ctx0") {
-		struct intel_buf *bcs[1], *rcs[N_CHILD];
+		struct intel_buf *bcs[BCS_CHILD], *rcs[RCS_CHILD];
+		uint64_t mem_per_test;
 
 		intel_allocator_multiprocess_start();
 
-		fork_bcs_copy(30, 0x4000, bcs, 1);
-		fork_rcs_copy(30, 0x8000 / N_CHILD, rcs, N_CHILD, 0);
+		mem_per_test = SIZE;
+		intel_require_memory(BCS_CHILD + RCS_CHILD,
+				     mem_per_test, CHECK_RAM);
+
+		fork_bcs_copy(30, 0x4000, bcs, BCS_CHILD);
+		fork_rcs_copy(30, 0x8000 / RCS_CHILD, rcs, RCS_CHILD, 0);
 
 		igt_waitchildren();
 
-		surfaces_check(bcs, 1, 0x4000);
-		surfaces_check(rcs, N_CHILD, 0x8000 / N_CHILD);
+		surfaces_check(bcs, BCS_CHILD, 0x4000);
+		surfaces_check(rcs, RCS_CHILD, 0x8000 / RCS_CHILD);
 
-		cleanup_bufs(bcs, 1);
-		cleanup_bufs(rcs, N_CHILD);
+		cleanup_bufs(bcs, BCS_CHILD);
+		cleanup_bufs(rcs, RCS_CHILD);
 
 		intel_allocator_multiprocess_stop();
 	}
 
 	igt_subtest("blt-vs-render-ctxN") {
-		struct intel_buf *bcs[1], *rcs[N_CHILD];
+		struct intel_buf *bcs[BCS_CHILD], *rcs[RCS_CHILD];
+		uint64_t mem_per_test, mem_per_ctx = 2 * 128 * 1024; /* rough context sizes */
 
 		igt_require(has_contexts());
 
 		intel_allocator_multiprocess_start();
 
-		fork_rcs_copy(30, 0x8000 / N_CHILD, rcs, N_CHILD, CREATE_CONTEXT);
-		fork_bcs_copy(30, 0x4000, bcs, 1);
+		mem_per_test = SIZE + mem_per_ctx;
+		intel_require_memory(BCS_CHILD + RCS_CHILD, mem_per_test, CHECK_RAM);
+
+		fork_rcs_copy(30, 0x8000 / RCS_CHILD, rcs, RCS_CHILD, CREATE_CONTEXT);
+		fork_bcs_copy(30, 0x4000, bcs, BCS_CHILD);
 
 		igt_waitchildren();
 
-		surfaces_check(bcs, 1, 0x4000);
-		surfaces_check(rcs, N_CHILD, 0x8000 / N_CHILD);
+		surfaces_check(bcs, BCS_CHILD, 0x4000);
+		surfaces_check(rcs, RCS_CHILD, 0x8000 / RCS_CHILD);
 
-		cleanup_bufs(bcs, 1);
-		cleanup_bufs(rcs, N_CHILD);
+		cleanup_bufs(bcs, BCS_CHILD);
+		cleanup_bufs(rcs, RCS_CHILD);
 
 		intel_allocator_multiprocess_stop();
 	}
-- 
2.26.0



More information about the igt-dev mailing list