[Intel-gfx] [PATCH i-g-t 4/6] tests/kms_flip: Account for diff.tv_secs in jitter check

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Tue Jun 21 17:25:30 UTC 2016


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

Include diff.tv_secs in the jitter comparison.

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

diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index 743e4ad8f673..7718e950b823 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -643,7 +643,6 @@ static void vblank_handler(int fd, unsigned int frame, unsigned int sec,
 static void check_state(const struct test_output *o, const struct event_state *es)
 {
 	struct timeval diff;
-	double usec_interflip;
 
 	dump_event_state(es);
 
@@ -689,10 +688,13 @@ static void check_state(const struct test_output *o, const struct event_state *e
 	}
 
 	if ((o->flags & TEST_CHECK_TS) && (!analog_tv_connector(o))) {
+		double usec_interflip, usec_diff;
+
 		timersub(&es->current_ts, &es->last_ts, &diff);
-		usec_interflip = (double)o->seq_step * frame_time(o);
+		usec_diff = diff.tv_sec * USEC_PER_SEC + diff.tv_usec;
 
-		igt_assert_f(fabs((((double) diff.tv_usec) - usec_interflip) /
+		usec_interflip = o->seq_step * frame_time(o);
+		igt_assert_f(fabs((usec_diff - usec_interflip) /
 				  usec_interflip) <= 0.005,
 			     "inter-%s ts jitter: %ld.%06ld\n",
 			     es->name, diff.tv_sec, diff.tv_usec);
-- 
2.7.4



More information about the Intel-gfx mailing list