summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tests/gem_reloc_vs_gpu.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c
index a00fb838..fcb917c8 100644
--- a/tests/gem_reloc_vs_gpu.c
+++ b/tests/gem_reloc_vs_gpu.c
@@ -270,6 +270,31 @@ static void do_test(int fd, bool faulting_reloc)
igt_enable_prefault();
}
+#define INTERRUPT (1 << 0)
+#define FAULTING (1 << 1)
+#define THRASH (1 << 2)
+#define ALL_FLAGS (INTERRUPT | FAULTING | THRASH)
+static void do_forked_test(int fd, unsigned flags)
+{
+ int num_threads = sysconf(_SC_NPROCESSORS_ONLN);
+
+ if (flags & THRASH) {
+
+ }
+
+ igt_fork(i, num_threads * 4) {
+ if (flags & INTERRUPT)
+ igt_fork_signal_helper();
+
+ do_test(fd, flags & FAULTING);
+
+ if (flags & INTERRUPT)
+ igt_stop_signal_helper();
+ }
+
+ igt_waitchildren();
+}
+
int fd;
#define MAX_BLT_SIZE 128
@@ -304,6 +329,14 @@ int main(int argc, char **argv)
do_test(fd, true);
igt_stop_signal_helper();
+ for (unsigned flags = 0; flags <= ALL_FLAGS; flags++) {
+ igt_subtest_f("forked%s%s%s",
+ flags & INTERRUPT ? "-interruptible" : "",
+ flags & FAULTING ? "-faulting-reloc" : "",
+ flags & THRASH ? "-thrashing" : "")
+ do_forked_test(fd, flags);
+ }
+
igt_fixture {
intel_batchbuffer_free(batch);
drm_intel_bufmgr_destroy(bufmgr);