During the kms_flip test we repeat the test over a short period of time,
and the setup of each iteration should not itself be inducing a vblank
miss. Warn if we do encounter any missed vblanks during the event setup.

Signed-off-by: Chris Wilson <ch...@chris-wilson.co.uk>
---
 tests/kms_flip.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index d701886e..4ea68d4b 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -736,6 +736,19 @@ static unsigned int run_test_step(struct test_output *o)
        if (o->flags & TEST_FB_BAD_TILING)
                new_fb_id = o->fb_ids[o->current_fb_id];
 
+       if (o->vblank_state.count > 0) {
+               drmVBlank vbl;
+
+               memset(&vbl, 0, sizeof(vbl));
+               vbl.request.type = kmstest_get_vbl_flag(o->pipe);
+               vbl.request.type |= DRM_VBLANK_RELATIVE;
+
+               do_or_die(drmWaitVBlank(drm_fd, &vbl));
+               if (vbl.reply.sequence != o->vblank_state.last_seq)
+                       igt_warn("vblank drift since last iteration! expected 
%x found %x\n",
+                                o->vblank_state.last_seq, vbl.reply.sequence);
+       }
+
        if (do_vblank && (o->flags & TEST_EINVAL) && o->vblank_state.count > 0)
                igt_assert(do_wait_for_vblank(o, o->pipe, target_seq, 
&vbl_reply)
                       == -EINVAL);
-- 
2.13.3

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to