Commit 0c392904 authored by Ville Syrjälä's avatar Ville Syrjälä

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's avatarChris Wilson <>
Signed-off-by: Ville Syrjälä's avatarVille Syrjälä <>
Reviewed-by: Chris Wilson's avatarChris Wilson <>
parent 50f9d1f7
......@@ -447,8 +447,17 @@ static void check_timings(int crtc_idx, const drmModeModeInfo *kmode)
wait.request.sequence = last_seq;
for (n = 0; n < CALIBRATE_TS_STEPS; n++) {
drmVBlank check = {};
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);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment