Commit Graph

24 Commits

Author SHA1 Message Date
Chris Wilson c186d4dda3 sna/present: Restrict vblank.sequence range to 31bits
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>
2016-03-24 18:30:50 +00:00
Chris Wilson cd864c0055 tests: Anticipate Present reporting too early
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>
2016-03-16 14:18:56 +00:00
Chris Wilson a0bf3c1f48 test/present: Catch FPE when notifies are broken
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>
2016-03-15 21:30:49 +00:00
Chris Wilson 65cc48757e test/present: Do a double flip to test tiling changes
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>
2015-04-21 15:06:18 +01:00
Chris Wilson c47fd1dcad test/present: Synchronize MSC notifiy modulus test to the vblank
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>
2015-04-06 14:02:41 +01:00
Chris Wilson d348f897c8 test/present: Expland MSC accuracy test
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-05 21:33:40 +01:00
Chris Wilson 6de85a1e60 test/present: Include composite redirected windows in the test matrix
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-05 21:13:38 +01:00
Chris Wilson fd12095f89 test/present: Also test swaps on windows (as well as full screen flips)
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-05 10:52:21 +01:00
Chris Wilson 019402f8ca test: Test tiling across DRI3/Present
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-24 17:27:15 +00:00
Chris Wilson 1877c8f508 test/present: Compact flip queue checks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-16 12:00:20 +00:00
Chris Wilson b9eeb9dd84 test/present: Tighten MSC modulus computation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-16 09:45:17 +00:00
Chris Wilson 3382bd78d9 test/present: Test notifier accuracy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-15 19:21:01 +00:00
Chris Wilson 35ab0afd04 test/present: Automatically disable DPMS
DPMS plays havoc with Present timings, make sure the screen doesn't turn
off.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 21:10:25 +00:00
Chris Wilson 9eb0ab15b1 test/present: Look for MSC wraparound
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 17:10:13 +00:00
Chris Wilson 254f2f2f4b test/present: Check a simple double-buffer sequence
Just check that we can do a present roundtrip in time to submit a new
frame on the next vblank.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 17:10:13 +00:00
Chris Wilson 92f74186b0 test/present: Include test for timing accuracy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 17:10:13 +00:00
Chris Wilson 9d4df75edb test/present: Check modulus computation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 14:47:30 +00:00
Chris Wilson 51f184edfb test/present: Tighten the accuracy requirements
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 13:51:04 +00:00
Chris Wilson ac1eb7f7c9 test/present: Test accuracy of long pauses
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-12 13:51:04 +00:00
Chris Wilson 688f5e9bd7 sna/present: Compensate for time elapsed since last swap
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>
2015-02-11 22:16:25 +00:00
Chris Wilson 4f5d7825df test/present: Return the correct error counter from for_each_crtc
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>
2015-02-11 10:34:47 +00:00
Chris Wilson 426a3afcc6 sna/present: Prevent DoS from exhausting the kernel vblank queue
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>
2015-02-11 09:51:43 +00:00
Chris Wilson ee42e106fe test: Tighten present checks to catch CRTC interchange bug in a single pass
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-02-05 13:41:13 +00:00
Chris Wilson 9cf6cd9726 Add rudimentary tests for Present
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-02 08:32:11 +01:00