diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-10-02 15:37:24 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2012-10-02 15:37:24 +0200 |
commit | 73af035c598047147957a081b26bfb156e01a530 (patch) | |
tree | 5cd277b68059ef24be3ae413c57bb0a88fef8c38 | |
parent | f509d40fa95886266a6e78aa4aa1b2764769eba1 (diff) |
tests/flip_test: check whether the pageflip event took too long
We're suspecting that something is fishy with the event deliver/vblank
timestamp handling on gmch platforms. Unfortunately, this isn't it.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r-- | tests/flip_test.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/flip_test.c b/tests/flip_test.c index 6d3f46c..4f23155 100644 --- a/tests/flip_test.c +++ b/tests/flip_test.c @@ -151,6 +151,20 @@ static void page_flip_handler(int fd, unsigned int frame, unsigned int sec, { struct test_output *o = data; unsigned int new_fb_id; + struct timeval now, diff, pageflip_ts; + + pageflip_ts.tv_sec = sec; + pageflip_ts.tv_usec = usec; + + gettimeofday(&now, NULL); + + timersub(&pageflip_ts, &now, &diff); + + if (diff.tv_sec > 0 || diff.tv_usec > 2000) { + fprintf(stderr, "pageflip timestamp delayed for too long: %us, %uusec\n", + (unsigned) diff.tv_sec, (unsigned) diff.tv_usec); + exit(5); + } o->count++; |