diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-09-03 11:57:56 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-09-03 15:19:30 +0200 |
commit | 2c7166eb7a60a87477be762d45aaafafb15aceff (patch) | |
tree | 6b350e19977190edef0a04ca3328c65ba4446430 | |
parent | f4b93781be0032b4d99097d71b305638c8eb03e2 (diff) |
tests/gem_reloc_vs_gpu: add forked versions
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | tests/gem_reloc_vs_gpu.c | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/gem_reloc_vs_gpu.c b/tests/gem_reloc_vs_gpu.c index a00fb838..050e24af 100644 --- a/tests/gem_reloc_vs_gpu.c +++ b/tests/gem_reloc_vs_gpu.c @@ -270,6 +270,35 @@ 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) { + /* re-create process local data */ + bufmgr = drm_intel_bufmgr_gem_init(fd, 4096); + batch = intel_batchbuffer_alloc(bufmgr, devid); + + 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 +333,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); |