The old way worked too, but just skipping the test for the first event is more logical/simpler thing to do. Signed-off-by: Imre Deak <imre.deak at intel.com> --- tests/flip_test.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tests/flip_test.c b/tests/flip_test.c index 3dfce8e..e2af358 100644 --- a/tests/flip_test.c +++ b/tests/flip_test.c @@ -362,6 +362,9 @@ static void check_state(struct test_output *o, struct event_state *es) exit(5); } + if (es->count == 0) + return; + if (!timercmp(&es->last_received_ts, &es->current_ts, <)) { fprintf(stderr, "%s ts before the %s was issued!\n", es->name, es->name); @@ -372,9 +375,6 @@ static void check_state(struct test_output *o, struct event_state *es) exit(6); } - if (es->count == 0) - return; - /* This bounding matches the one in DRM_IOCTL_WAIT_VBLANK. */ if (es->current_seq - (es->last_seq + es->seq_step) > 1UL << 23) { fprintf(stderr, "unexpected %s seq %u, should be >= %u\n", @@ -862,9 +862,6 @@ static void run_test_on_crtc(struct test_output *o, int crtc, int duration) if (o->flags & TEST_CHECK_TS) sleep(1); - gettimeofday(&o->flip_state.last_ts, NULL); - gettimeofday(&o->vblank_state.last_ts, NULL); - if (do_page_flip(o, o->fb_ids[1])) { fprintf(stderr, "failed to page flip: %s\n", strerror(errno)); exit(4); -- 1.7.9.5