@@ -1182,14 +1182,14 @@ static void check_final_state(struct test_output *o, struct event_state *es,
/* Verify we drop no frames, but only if it's not a TV encoder, since
* those use some funny fake timings behind userspace's back. */
if (o->flags & TEST_CHECK_TS && !analog_tv_connector(o)) {
- int expected;
- int count = es->count;
+ int count = es->count * o->seq_step;
+ unsigned int min = frame_time(o) * (count - 1);
+ unsigned int max = frame_time(o) * (count + 1);
- count *= o->seq_step;
- expected = elapsed / frame_time(o);
- igt_assert_f(count >= expected * 99/100 && count <= expected * 101/100,
+ igt_assert_f(elapsed > min && elapsed < max,
"dropped frames, expected %d, counted %d, encoder type %d\n",
- expected, count, o->kencoder[0]->encoder_type);
+ elapsed / frame_time(o), count,
+ o->kencoder[0]->encoder_type);
}
}