summaryrefslogtreecommitdiff
path: root/tests/prime_vgem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2019-04-04 08:01:04 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2019-04-04 09:42:28 +0100
commitf43bb29c3e29143d8ad5fc70b82eccf5749d3958 (patch)
tree3faab159beb4dfc93c347737f510a890b6a3277f /tests/prime_vgem.c
parent5a50ec8921095c6641ab84e69c40f1036c5a31a9 (diff)
prime_vgem: Downgrade the severity of a single missed vblank on flipping
Not displaying the flip on the next vblank is bad, but not the end of the world -- so long as that is only a temporary glitch. Give the vblank a few more frames to complete, and warn instead of failing if it takes more than one vblank interval to flip. v2: Bump the warning to >1 missed flip, to spare us the noise. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/prime_vgem.c')
-rw-r--r--tests/prime_vgem.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/tests/prime_vgem.c b/tests/prime_vgem.c
index 85a27b69..94632452 100644
--- a/tests/prime_vgem.c
+++ b/tests/prime_vgem.c
@@ -713,15 +713,23 @@ static void flip_to_vgem(int i915, int vgem,
/* And then the flip is completed as soon as it is ready */
if (!hang) {
- union drm_wait_vblank wait;
+ unsigned long miss;
- memset(&wait, 0, sizeof(wait));
- wait.request.type = DRM_VBLANK_RELATIVE | pipe_select(0);
- wait.request.sequence = 10;
- do_or_die(drmIoctl(i915, DRM_IOCTL_WAIT_VBLANK, &wait));
-
- vgem_fence_signal(vgem, fence);
+ /* Signal fence at the start of the next vblank */
get_vblank(i915, 0, DRM_VBLANK_NEXTONMISS);
+ vgem_fence_signal(vgem, fence);
+
+ miss = 0;
+ igt_until_timeout(5) {
+ get_vblank(i915, 0, DRM_VBLANK_NEXTONMISS);
+ if (poll(&pfd, 1, 0))
+ break;
+ miss++;
+ }
+ if (miss > 1) {
+ igt_warn("Missed %lu vblanks after signaling before flip was completed\n",
+ miss);
+ }
igt_assert_eq(poll(&pfd, 1, 0), 1);
}