From d7050f9f79fee8fb7c790f355c984d9e5141e1c5 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 11 May 2016 17:06:28 +0200 Subject: lib/igt_aux: Polish docs for igt_interruptible - Give __ prefix to internal funcstion and structs, only igt_interruptible is used by tests. - Move docs to igt_interruptible and adjust. - Explain more clearly how the timeout is getting doubled each iteration until no more interruptions happen. Also rename the argument to give it a more meaningful name in the docs. - Link from other functions to this one for cross-referencing. - Rename to igt_do_interruptible to make it clearer it's a loop, inspired by do {} while () loops. v2: Rename instead to igt_while_interruptible and fix typos (Chris). And add gtk-doc for igt_ioctl, too. Acked-by: Chris Wilson Signed-off-by: Daniel Vetter --- tests/gem_concurrent_all.c | 4 ++-- tests/gem_ctx_switch.c | 2 +- tests/gem_exec_flush.c | 8 ++++---- tests/gem_exec_whisper.c | 2 +- tests/gem_ringfill.c | 2 +- tests/gem_softpin.c | 6 +++--- tests/prime_mmap_coherency.c | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) (limited to 'tests') diff --git a/tests/gem_concurrent_all.c b/tests/gem_concurrent_all.c index c0af60d4..019628ed 100644 --- a/tests/gem_concurrent_all.c +++ b/tests/gem_concurrent_all.c @@ -1294,7 +1294,7 @@ static void run_interruptible(struct buffers *buffers, do_hang do_hang_func) { pass = 0; - igt_interruptible(true) + igt_while_interruptible(true) do_test_func(buffers, do_copy_func, do_hang_func); igt_assert_eq(intel_detect_and_clear_missed_interrupts(fd), 0); } @@ -1340,7 +1340,7 @@ static void __run_forked(struct buffers *buffers, buffers_reset(buffers, true); buffers_create(buffers); - igt_interruptible(interrupt) { + igt_while_interruptible(interrupt) { for (pass = 0; pass < loops; pass++) do_test_func(buffers, do_copy_func, diff --git a/tests/gem_ctx_switch.c b/tests/gem_ctx_switch.c index 004ba227..7b273368 100644 --- a/tests/gem_ctx_switch.c +++ b/tests/gem_ctx_switch.c @@ -116,7 +116,7 @@ static void single(int fd, uint32_t handle, clock_gettime(CLOCK_MONOTONIC, &start); do { - igt_interruptible(flags & INTERRUPTIBLE) { + igt_while_interruptible(flags & INTERRUPTIBLE) { for (int loop = 0; loop < 1024; loop++) { execbuf.rsvd1 = contexts[loop % 64]; reloc.presumed_offset = 0; diff --git a/tests/gem_exec_flush.c b/tests/gem_exec_flush.c index 705ef849..93265ae5 100644 --- a/tests/gem_exec_flush.c +++ b/tests/gem_exec_flush.c @@ -216,7 +216,7 @@ overwrite: if (flags & SET_DOMAIN) { unsigned domain = flags & WC ? I915_GEM_DOMAIN_GTT : I915_GEM_DOMAIN_CPU; - igt_interruptible(flags & INTERRUPTIBLE) + igt_while_interruptible(flags & INTERRUPTIBLE) gem_set_domain(fd, obj[0].handle, domain, (flags & WRITE) ? domain : 0); @@ -230,7 +230,7 @@ overwrite: } else if (flags & KERNEL) { uint32_t val; - igt_interruptible(flags & INTERRUPTIBLE) + igt_while_interruptible(flags & INTERRUPTIBLE) gem_read(fd, obj[0].handle, i*sizeof(uint32_t), &val, sizeof(val)); @@ -242,13 +242,13 @@ overwrite: if (flags & WRITE) { val = 0xdeadbeef; - igt_interruptible(flags & INTERRUPTIBLE) + igt_while_interruptible(flags & INTERRUPTIBLE) gem_write(fd, obj[0].handle, i*sizeof(uint32_t), &val, sizeof(val)); } } else { - igt_interruptible(flags & INTERRUPTIBLE) + igt_while_interruptible(flags & INTERRUPTIBLE) gem_sync(fd, obj[0].handle); if (!(flags & (BEFORE | COHERENT)) && diff --git a/tests/gem_exec_whisper.c b/tests/gem_exec_whisper.c index 8db475e2..e0739470 100644 --- a/tests/gem_exec_whisper.c +++ b/tests/gem_exec_whisper.c @@ -225,7 +225,7 @@ static void whisper(int fd, unsigned engine, unsigned flags) gem_write(fd, batches[n].handle, 0, batch, sizeof(batch)); } - igt_interruptible(flags & INTERRUPTIBLE) { + igt_while_interruptible(flags & INTERRUPTIBLE) { for (pass = 0; pass < 1024; pass++) { uint64_t offset; diff --git a/tests/gem_ringfill.c b/tests/gem_ringfill.c index 52192d9b..e503913d 100644 --- a/tests/gem_ringfill.c +++ b/tests/gem_ringfill.c @@ -75,7 +75,7 @@ static void fill_ring(int fd, * doing this, we aren't likely to with this test. */ igt_debug("Executing execbuf %d times\n", 128*1024/(8*4)); - igt_interruptible(flags & INTERRUPTIBLE) { + igt_while_interruptible(flags & INTERRUPTIBLE) { for (int i = 0; i < 128*1024 / (8 * 4); i++) gem_execbuf(fd, execbuf); } diff --git a/tests/gem_softpin.c b/tests/gem_softpin.c index 1a9ef02b..a6d4274c 100644 --- a/tests/gem_softpin.c +++ b/tests/gem_softpin.c @@ -492,7 +492,7 @@ igt_main igt_subtest("noreloc") test_noreloc(fd, NOSLEEP); igt_subtest("noreloc-interruptible") - igt_interruptible(true) test_noreloc(fd, NOSLEEP); + igt_while_interruptible(true) test_noreloc(fd, NOSLEEP); igt_subtest("noreloc-S3") test_noreloc(fd, SUSPEND); igt_subtest("noreloc-S4") @@ -500,9 +500,9 @@ igt_main for (int signal = 0; signal <= 1; signal++) { igt_subtest_f("evict-active%s", signal ? "-interruptible" : "") - igt_interruptible(signal) test_evict_active(fd); + igt_while_interruptible(signal) test_evict_active(fd); igt_subtest_f("evict-snoop%s", signal ? "-interruptible" : "") - igt_interruptible(signal) test_evict_snoop(fd); + igt_while_interruptible(signal) test_evict_snoop(fd); } igt_subtest("evict-hang") test_evict_hang(fd); diff --git a/tests/prime_mmap_coherency.c b/tests/prime_mmap_coherency.c index 5cacdc5d..fb67ef1f 100644 --- a/tests/prime_mmap_coherency.c +++ b/tests/prime_mmap_coherency.c @@ -277,7 +277,7 @@ static void test_ioctl_errors(void) } igt_fork(child, num_children) - igt_interruptible(true) blit_and_cmp(); + igt_while_interruptible(true) blit_and_cmp(); igt_waitchildren(); } } -- cgit v1.2.3