summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Syrjälä <ville.syrjala@linux.intel.com>2014-11-28 11:13:45 +0200
committerVille Syrjälä <ville.syrjala@linux.intel.com>2014-12-01 13:18:15 +0200
commite06a7448d894392a294d89959fc1cf4e6a01fd19 (patch)
tree24773b13a441e6c6a22daa3f525d4a1da9d57267
parentddf0f097764da6fdc50ab40c33bef7a0c08d54e3 (diff)
tests/kms_flip: Fix assert about vblank wait duration
If we wait for one vblank, we may end up returning almost immediately, so trying to assert anything but >0 about the minimum duration is bogus. Instead wait for two vblanks and then we can assert that we should have be blocked for at least one frame. And move the upper bound to a little over two frames to match. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79050 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
-rw-r--r--tests/kms_flip.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/kms_flip.c b/tests/kms_flip.c
index cce9594d..041f46a6 100644
--- a/tests/kms_flip.c
+++ b/tests/kms_flip.c
@@ -867,10 +867,16 @@ static unsigned int run_test_step(struct test_output *o)
/* modeset/DPMS is done, vblank wait should work normally now */
start = gettime_us();
- igt_assert(__wait_for_vblank(TEST_VBLANK_BLOCK, o->pipe, 1, 0, &reply) == 0);
+ igt_assert(__wait_for_vblank(TEST_VBLANK_BLOCK, o->pipe, 2, 0, &reply) == 0);
end = gettime_us();
- igt_assert(end - start > 1 * frame_time(o) / 2 &&
- end - start < 3 * frame_time(o) / 2);
+ /*
+ * we waited for two vblanks, so verify that
+ * we were blocked for ~1-2 frames.
+ */
+ igt_assert_f(end - start > 0.9 * frame_time(o) &&
+ end - start < 2.1 * frame_time(o),
+ "wait for two vblanks took %lu usec (frame time %f usec)\n",
+ end - start, frame_time(o));
join_vblank_wait_thread();
}