From 73af035c598047147957a081b26bfb156e01a530 Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Tue, 2 Oct 2012 15:37:24 +0200 Subject: [PATCH] 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 --- tests/flip_test.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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++; -- 2.7.4