diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-10-20 16:10:32 +0200 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2013-10-20 16:11:57 +0200 |
commit | 8e11f8778adff693f3a0246fe0e87be4e3ddb83f (patch) | |
tree | bc7be1b579b7c46077a22e1fda0122c93021b1e7 /tests/kms_flip.c | |
parent | e313dee22b8edf1429ce861e5974b09bb2ab1b68 (diff) |
tests/kms_flip: no absolute vblank wait on the first frame
We don't have a reference value for the vblank counter yet, so
will end up waiting for a long time for the vblank counter to
wrap around again.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'tests/kms_flip.c')
-rw-r--r-- | tests/kms_flip.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c index d9760699..b63d3241 100644 --- a/tests/kms_flip.c +++ b/tests/kms_flip.c @@ -376,8 +376,13 @@ static int do_wait_for_vblank(struct test_output *o, int pipe_id, int target_seq, struct vblank_reply *reply) { int ret; + unsigned flags = o->flags; - ret = __wait_for_vblank(o->flags, pipe_id, target_seq, (unsigned long)o, + /* Absolute waits only works once we have a frame counter. */ + if (!(o->vblank_state.count > 0)) + flags &= ~TEST_VBLANK_ABSOLUTE; + + ret = __wait_for_vblank(flags, pipe_id, target_seq, (unsigned long)o, reply); if (ret == 0 && !(o->flags & TEST_VBLANK_BLOCK)) set_flag(&o->pending_events, EVENT_VBLANK); @@ -732,7 +737,8 @@ static unsigned int run_test_step(struct test_output *o) uint32_t handle = 0; /* Suppress GCC warning */ target_seq = o->vblank_state.seq_step; - if (o->flags & TEST_VBLANK_ABSOLUTE) + /* Absolute waits only works once we have a frame counter. */ + if (o->flags & TEST_VBLANK_ABSOLUTE && o->vblank_state.count > 0) target_seq += o->vblank_state.last_seq; /* @@ -1056,6 +1062,8 @@ static unsigned int wait_for_events(struct test_output *o) ret = select(drm_fd + 1, &fds, NULL, NULL, &timeout); } while (ret < 0 && errno == EINTR); + igt_assert_f(ret >= 0, + "select error (errno %i)\n", errno); igt_assert_f(ret > 0, "select timed out or error (ret %d)\n", ret); igt_assert_f(!FD_ISSET(0, &fds), |