The kernel checks for past vblanks using an int32_t comparison, so we
can only program up to 31bits into the future (and similarly programing
a timer that large would also overflow).
References: https://bugs.freedesktop.org/show_bug.cgi?id=94685
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Given Present bugs, any completion event may be sent too early and
out-of-order. Make sure we drain all outstanding events before
continuing on to the next test.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
If the Xserver reports 10 frames passed instantaneously, flag an error
rather than divide by zero.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Since the first flip may require a fixup, we will only really know with
the second flip whether we can start a flip chain with different tiling.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
As the test presumes we can queue all the modulus queries within the
same vblank, we can improve matters by synchronizing to the next vblank
first.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When computing the delay for the fake flip, compensate for any time
elapsed since the last frame in order to hit the desired vblank more
accurately. A side-effect of this is that we may now compute 0 delay
timers which require special handling.
Testcase: present-test/accuracy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
When the xserver is fixed and we no longer block for ever inside the
test, we can see that the test itself falsely reports failure!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
The kernel caps the number of vblanks per client to 128. There are
already reports from the wild that Present clients are running foul of
that limit, so supplement it with a timer fallback.
Testcase: present-test with future flips
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>