diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-09-01 13:57:31 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-09-01 13:59:58 +0100 |
commit | 652ad3e549810f32b39f24b13023a050667e738a (patch) | |
tree | 5fc52f8f9efdabb30b94922a376d0495dc26547a | |
parent | 225a88bb6bc1fa826b880ddc8ab257e3a76a82e9 (diff) |
igt/prime_vgem: Simplify inter-process flip checks
Avoid having both the child and parent do the same "did the flip"
happen check with each looking for the same event on the same fd. The
problem being that the child may fall asleep and by the time it wakes up
to do its check, the parent has already eaten the event. So leave the
checking that the flip does occur to the parent.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | tests/prime_vgem.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c index 8985e0198..e78e074a5 100644 --- a/tests/prime_vgem.c +++ b/tests/prime_vgem.c @@ -628,6 +628,7 @@ static void flip_to_vgem(int i915, int vgem, unsigned hang, const char *name) { + const struct timespec tv = { 1, 0 }; struct pollfd pfd; struct drm_event_vblank vbl; uint32_t fence; @@ -648,16 +649,14 @@ static void flip_to_vgem(int i915, int vgem, name); get_vblank(i915, 0, DRM_VBLANK_NEXTONMISS); } - igt_assert_eq(poll(&pfd, 1, 20000), 1); } + igt_assert_f(nanosleep(&tv, NULL) == -1, + "flip to busy %s blocked\n", name); + /* And then the flip is completed as soon as it is ready */ if (!hang) { union drm_wait_vblank wait; - struct timespec tv = { 1, 0 }; - - igt_assert_f(nanosleep(&tv, NULL) == -1, - "flip to busy %s blocked\n", name); memset(&wait, 0, sizeof(wait)); wait.request.type = DRM_VBLANK_RELATIVE | pipe_select(0); |