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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

Include diff.tv_secs in the jitter comparison.

Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux