From: Daniel Vetter Date: Wed, 3 Oct 2012 21:16:18 +0000 (+0200) Subject: flip_test: fix timestamp order X-Git-Tag: intel-gpu-tools-1.4~942 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=826326bc7c464c7297687a82d03da83922555ca1;p=platform%2Fupstream%2Fintel-gpu-tools.git flip_test: fix timestamp order When grabbing the timestamp after a flip, it has a decent chance to actually be after the flip. Surprising. --- diff --git a/tests/flip_test.c b/tests/flip_test.c index d083fa6..539e08f 100644 --- a/tests/flip_test.c +++ b/tests/flip_test.c @@ -413,6 +413,8 @@ static void flip_mode(struct test_output *o, int crtc, int duration) if (o->flags & TEST_CHECK_TS) sleep(1); + gettimeofday(&o->last_flip_received, NULL); + if (drmModePageFlip(drm_fd, o->crtc, o->fb_ids[1], DRM_MODE_PAGE_FLIP_EVENT, o)) { fprintf(stderr, "failed to page flip: %s\n", strerror(errno)); @@ -427,7 +429,6 @@ static void flip_mode(struct test_output *o, int crtc, int duration) evctx.page_flip_handler = page_flip_handler; gettimeofday(&end, NULL); - gettimeofday(&o->last_flip_received, NULL); end.tv_sec += duration; while (1) {