diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2018-11-22 20:08:06 +0200 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2019-03-11 22:03:49 +0200 |
commit | 0c392904a550642ef2f18ccddb88b541249dccd7 (patch) | |
tree | 660ed5838fc754bec9efb3dc27a436430db46fc1 /tests/kms_setmode.c | |
parent | 50f9d1f76dc60e34788a86ba4aa1c4213bc7857a (diff) |
tests/kms_setmode: Validate the vbl sequence numbers
Make sure we haven't already passed the seq numbers we're
requesting when doing the ts calibration.
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tests/kms_setmode.c')
-rw-r--r-- | tests/kms_setmode.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c index d150483c..c40c723d 100644 --- a/tests/kms_setmode.c +++ b/tests/kms_setmode.c @@ -447,8 +447,17 @@ static void check_timings(int crtc_idx, const drmModeModeInfo *kmode) 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); |