From 19b2776e14e7711c97400c8f0c97435aa7e52386 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 3 Sep 2013 11:57:56 +0200 Subject: tests/gem_reloc_vs_gpu: add forked versions Seems to result in insta-hangs on my snb here ... Signed-off-by: Daniel Vetter --- tests/gem_reloc_vs_gpu.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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); -- cgit v1.2.3