[igt-dev] [PATCH i-g-t v3 20/23] tests/gem_ppgtt: Adopt test to use intel_bb with allocator
Zbigniew Kempczyński
zbigniew.kempczynski at intel.com
Fri Oct 23 12:42:09 UTC 2020
Tests work in multiprocess environment so we must turn on/off
thread in parent process which is responsible for allocations.
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 | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/tests/i915/gem_ppgtt.c b/tests/i915/gem_ppgtt.c
index 73bd19c5..b9b3d1fc 100644
--- a/tests/i915/gem_ppgtt.c
+++ b/tests/i915/gem_ppgtt.c
@@ -136,6 +136,7 @@ static void fork_rcs_copy(int timeout, uint32_t final,
dst[child], 0, 0);
intel_buf_destroy(src);
+ dst[child]->addr.offset = INTEL_BUF_INVALID_ADDRESS;
intel_bb_destroy(ibb);
}
@@ -175,6 +176,7 @@ static void fork_bcs_copy(int timeout, uint32_t final,
intel_buf_destroy(src[1]);
intel_buf_destroy(src[0]);
+ intel_bb_reset(ibb, true);
}
src[0] = create_bo(dst[child]->bops, ~0);
@@ -190,6 +192,7 @@ static void fork_bcs_copy(int timeout, uint32_t final,
intel_buf_destroy(src[1]);
intel_buf_destroy(src[0]);
+ dst[child]->addr.offset = INTEL_BUF_INVALID_ADDRESS;
intel_bb_destroy(ibb);
}
@@ -288,6 +291,8 @@ igt_main
igt_subtest("blt-vs-render-ctx0") {
struct intel_buf *bcs[1], *rcs[N_CHILD];
+ intel_allocator_multiprocess_start();
+
fork_bcs_copy(30, 0x4000, bcs, 1);
fork_rcs_copy(30, 0x8000 / N_CHILD, rcs, N_CHILD, 0);
@@ -298,6 +303,8 @@ igt_main
cleanup_bufs(bcs, 1);
cleanup_bufs(rcs, N_CHILD);
+
+ intel_allocator_multiprocess_stop();
}
igt_subtest("blt-vs-render-ctxN") {
@@ -305,6 +312,8 @@ igt_main
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);
@@ -315,6 +324,8 @@ igt_main
cleanup_bufs(bcs, 1);
cleanup_bufs(rcs, N_CHILD);
+
+ intel_allocator_multiprocess_stop();
}
igt_subtest("flink-and-close-vma-leak")
--
2.26.0
More information about the igt-dev
mailing list