diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2013-10-16 22:43:04 +0300 |
---|---|---|
committer | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2015-10-23 15:40:09 +0300 |
commit | 75cf16e5854e232b5d3caba0bfb063d76866a6e4 (patch) | |
tree | b949b8a2635c4979064b75602a4e5629b438a748 /tests/kms_flip.c | |
parent | 8a17af80e0732cb6ce5e7348dcb2d56a7b870e1d (diff) |
tests/kms_flip: Improve the accuracy of out frame time calculation
Don't use the rounded vrefresh info to predict the frame duration.
Instead calculate if from the clock.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Diffstat (limited to 'tests/kms_flip.c')
-rw-r--r-- | tests/kms_flip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c index a139d402..48e90620 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -547,7 +547,7 @@ static void page_flip_handler(int fd, unsigned int frame, unsigned int sec, static double frame_time(struct test_output *o) { - return 1000.0 * 1000.0 / o->kmode[0].vrefresh; + return 1000.0 * o->kmode[0].htotal * o->kmode[0].vtotal / o->kmode[0].clock; } static void *vblank_wait_thread_func(void *data) @@ -1209,7 +1209,7 @@ static void check_final_state(struct test_output *o, struct event_state *es, int count = es->count; count *= o->seq_step; - expected = elapsed * o->kmode[0].vrefresh / (1000 * 1000); + expected = elapsed / frame_time(o); igt_assert_f(count >= expected * 99/100 && count <= expected * 101/100, "dropped frames, expected %d, counted %d, encoder type %d\n", expected, count, o->kencoder[0]->encoder_type); |