summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2018-05-01 09:56:27 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2018-05-01 13:45:57 +0100
commit5baea95fc3abaedff3feb0f96ce29b995f0e301d (patch)
tree1abed0b911923b9f887c65fe9a8d3971103c2dbe /tests
parent29ae12bd764e3b1876356e7628a32192b4ec9066 (diff)
igt/drv_missed_irq: Sleep in the child waiting for the parent
Our parent is RT, we are not. In theory, we should wait until our parent has gone to sleep before we are allowed to proceed (we should both be bound to the same cpu). Double down on this by sleeping in the child until our parent has written a byte along a pipe(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/drv_missed_irq.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/drv_missed_irq.c b/tests/drv_missed_irq.c
index 9326a5a6..791ee51f 100644
--- a/tests/drv_missed_irq.c
+++ b/tests/drv_missed_irq.c
@@ -34,20 +34,29 @@ IGT_TEST_DESCRIPTION("Inject missed interrupts and make sure they are caught");
static void trigger_missed_interrupt(int fd, unsigned ring)
{
igt_spin_t *spin = __igt_spin_batch_new(fd, 0, ring, 0);
+ uint32_t go;
+ int link[2];
+
+ igt_assert(pipe(link) == 0);
igt_fork(child, 1) {
- /* We are now a low priority child on the *same* CPU as the
+ /*
+ * We are now a low priority child on the *same* CPU as the
* parent. We will have to wait for our parent to sleep
* (gem_sync -> i915_wait_request) before we run.
*/
+ read(link[0], &go, sizeof(go));
igt_assert(gem_bo_busy(fd, spin->handle));
igt_spin_batch_end(spin);
}
+ write(link[1], &go, sizeof(go));
gem_sync(fd, spin->handle);
igt_waitchildren();
igt_spin_batch_free(fd, spin);
+ close(link[1]);
+ close(link[0]);
}
static void bind_to_cpu(int cpu)