[igt-dev] [PATCH i-g-t 5/5] tests/kms_setmode: Validate the vbl sequence numbers

Ville Syrjala ville.syrjala at linux.intel.com
Thu Mar 7 21:39:26 UTC 2019


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

Make sure we haven't already passed the seq numbers we're
requesting when doing the ts calibration.

Suggested-by: Chris Wilson <chris at chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tests/kms_setmode.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index acd606cd5b5e..5ce1397f968f 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);
-- 
2.19.2



More information about the igt-dev mailing list