summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-03 11:57:56 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2013-09-03 11:57:56 +0200
commit19b2776e14e7711c97400c8f0c97435aa7e52386 (patch)
treef6990a08b66cf9baea6894de11a85952bb52e44a
parente45b7d9474da7b771f941d4729a435b49ef8529d (diff)
tests/gem_reloc_vs_gpu: add forked versionshang
Seems to result in insta-hangs on my snb here ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-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);