[PATCH igt] tests/kms_flip: Assert that vblank timestamps aren't zeroed

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Wed Aug 6 04:50:03 PDT 2014


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

The kernel might mistakenly send out a zeroed vblank timestamp when
the vblank wait gets terminated early due to crtc disable. Add an
assertion to catch that.

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 tests/kms_flip.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 92f4eb5..e8a0b39 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -396,6 +396,9 @@ static int __wait_for_vblank(unsigned int flags, int crtc_idx,
 	ret = drmWaitVBlank(drm_fd, &wait_vbl);
 
 	if (ret == 0) {
+		igt_assert_f(wait_vbl.reply.tval_sec != 0 ||
+			     wait_vbl.reply.tval_usec != 0,
+			     "zeroed vblank timestamp\n");
 		reply->ts.tv_sec = wait_vbl.reply.tval_sec;
 		reply->ts.tv_usec = wait_vbl.reply.tval_usec;
 		reply->sequence = wait_vbl.reply.sequence;
-- 
1.8.5.5



More information about the dri-devel mailing list