From 50f9d1f76dc60e34788a86ba4aa1c4213bc7857a Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Thu, 22 Nov 2018 20:08:00 +0200 Subject: tests/kms_flip: Validate the vbl sequence numbers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Make sure we haven't already passed the seq numbers we're requesting when doing the ts calibration. Suggested-by: Chris Wilson Signed-off-by: Ville Syrjälä Reviewed-by: Chris Wilson --- tests/kms_flip.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'tests/kms_flip.c') diff --git a/tests/kms_flip.c b/tests/kms_flip.c index b9729dfd..05ea3df0 100755 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -1118,8 +1118,17 @@ static void calibrate_ts(struct test_output *o, int crtc_idx) wait.request.type |= DRM_VBLANK_ABSOLUTE | DRM_VBLANK_EVENT; wait.request.sequence = last_seq; for (n = 0; n < CALIBRATE_TS_STEPS; n++) { + drmVBlank check = {}; + ++wait.request.sequence; do_or_die(drmWaitVBlank(drm_fd, &wait)); + + /* Double check that haven't already missed the vblank */ + check.request.type = kmstest_get_vbl_flag(crtc_idx); + check.request.type |= DRM_VBLANK_RELATIVE; + do_or_die(drmWaitVBlank(drm_fd, &check)); + + igt_assert(!igt_vblank_after(check.reply.sequence, wait.request.sequence)); } igt_stats_init_with_size(&stats, CALIBRATE_TS_STEPS); -- cgit v1.2.3