Thread (3 messages) 3 messages, 2 authors, 2021-03-31

[igt-dev] [PATCH i-g-t] tests/gem_softpin: Check using same offset in more children

From: Zbigniew Kempczyński <hidden>
Date: 2021-03-31 11:33:39
Subsystem: the rest · Maintainer: Linus Torvalds

Check vma eviction for same offset is working properly when
execbuf stresstest is executed.

Signed-off-by: Zbigniew Kempczyński <redacted>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Chris Wilson <redacted>
---
 tests/i915/gem_softpin.c | 26 ++++++++++++++++++++++++++
 1 file changed, 26 insertions(+)
diff --git a/tests/i915/gem_softpin.c b/tests/i915/gem_softpin.c
index aba060a42..0723e6a5c 100644
--- a/tests/i915/gem_softpin.c
+++ b/tests/i915/gem_softpin.c
@@ -247,6 +247,29 @@ static void test_full(int i915)
 	gem_close(i915, obj[0].handle);
 }
 
+static void test_fork(int fd)
+{
+	struct drm_i915_gem_execbuffer2 execbuf;
+	struct drm_i915_gem_exec_object2 obj = {0};
+	uint32_t batch = MI_BATCH_BUFFER_END;
+
+	igt_fork(child, 2) {
+		igt_until_timeout(5) {
+			memset(&execbuf, 0, sizeof(execbuf));
+			obj.handle = gem_create(fd, 4096);
+			obj.offset = 0x1000;
+			obj.flags = EXEC_OBJECT_PINNED;
+			execbuf.buffers_ptr = to_user_pointer(&obj);
+			execbuf.buffer_count = 1;
+			gem_write(fd, obj.handle, 0, &batch, sizeof(batch));
+			gem_execbuf(fd, &execbuf);
+			gem_close(fd, obj.handle);
+		}
+	}
+
+	igt_waitchildren();
+}
+
 static void test_softpin(int fd)
 {
 	const uint32_t size = 1024 * 1024;
@@ -727,6 +750,9 @@ igt_main
 
 		igt_subtest("full")
 			test_full(fd);
+
+		igt_subtest("fork")
+			test_fork(fd);
 	}
 
 	igt_subtest("softpin")
-- 
2.26.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help