62 Commits

Author SHA1 Message Date
Daniel Vetter
c3d5c1292b tests/flip_test: use subtest infrastructure
To make the testnames easier to handle in scripts, replace all
spaces with dashes.

The important part is to not print anything to stdout when enumerating
subtests, so protect the timestamp test with the right check.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-28 11:57:58 +01:00
Imre Deak
314953117f flip_test: switch to using monotonic timestamps (v2)
Since monotonic timestamps are now the preferred time format, change
timestamps checks to compare against monotonic instead of real time.
Also add two tests for DRM's compatibility mode where it returns real
timestamps.

v2: drop the tests for the compatibilty mode (Daniel)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-22 21:20:30 +01:00
Imre Deak
b7067d6c10 flip_test: use monotonic time to measure the test duration
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-22 14:51:28 +01:00
Imre Deak
8a2593bd3c flip_test: skip check for last_received_ts for the first event
The old way worked too, but just skipping the test for the first event
is more logical/simpler thing to do.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-11-22 14:51:26 +01:00
Imre Deak
b28caa0ac0 flip_test: add wf-vblank test for expired sequence
In v2:
- Wait for the seq that just completed (current_seq) not last_seq - 1.
- Do an equality check for ts and seq instead of >=. The previous
  issue didn't let us do this before.
- Simplify the condition when we do an "expired sequence" check by
  only using the last flip event as a reference.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-23 12:45:06 +02:00
Imre Deak
c7dd1dcdd9 flip_test: add comment about the race between flip vs. vblank events
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-23 10:34:29 +02:00
Imre Deak
7f32adc6c5 flip_test: check if the vblank and flip states correlate
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-23 10:34:26 +02:00
Imre Deak
429dc01636 flip_test: fixup zero timestamp for premature vblanks
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-23 10:34:20 +02:00
Imre Deak
5fc312e9f1 flip_test: increase duration for vbl+flip tests with ts check
We need a big enough duration, so the hotplug event's affect doesn't
distort our final frame count too much.

Without this these tests will exit with a "dropped frames" error.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-23 10:34:17 +02:00
Daniel Vetter
ea50871f15 flip_test: check whether wait_vblank fails when it should 2012-10-17 11:09:13 +02:00
Daniel Vetter
3b1fbbf412 flip_test: drop vblank vs. pan
pageflip vs. pan is interesting since we wait for outstanding flips
before updating the fb base address. For vblank absolutely nothing
interesting happens.
2012-10-17 00:35:43 +02:00
Daniel Vetter
7125a338ec flip_test: tune test-durations a bit
15 seconds for timestamp checkers (to at least hit the dreaded hotplug
once), 5 seconds for fast tests that check every vblank something, 30
for slow test (dpms/modeset cycles).
2012-10-17 00:34:43 +02:00
Imre Deak
6473c537d8 flip_test: add wait-for-vblank tests
Signed-off-by: Imre Deak <imre.deak@intel.com>
[danvet: add {} for multi-line but single-statement if block.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-16 21:46:18 +02:00
Imre Deak
ae62874cf1 flip_test: add check to see if any event has occured
At the moment select() would time out in case we don't get any event.
When we add vblank events in a later patch, it's possible that we
receive one type of events but not the other type. In this case select()
doesn't time out and we need another way to detect this.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:40:06 +03:00
Imre Deak
fe7fea0be3 flip_test: add event sequence number tracking
Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:40:06 +03:00
Imre Deak
887a2597fa flip_test: add logic to track pending events
When we add the vblank tests later, it can happen that one type of event
is pending while we are servicing another. Prepare for that by
maintaining a pending/completed event mask.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:40:06 +03:00
Imre Deak
a7d9a57c47 flip_test: make page flip tests conditional
Since later we want to add vblank tests where we don't want to flip,
make the flips and corresponding state checks conditional.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:40:06 +03:00
Imre Deak
eecae8dfef flip_test: unify the name of the current test in status messages
Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:40:06 +03:00
Imre Deak
6c2b53d894 flip_test: store the pipe id in the test context obj
For DRM_IOCTL_WAIT_VBLANK we'll have to pass the pipe id - as opposed to
the crtc id required by the rest of the IOCTLs we use.

Thanks for Chris Wilson for pointing this out.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:40:06 +03:00
Imre Deak
641261f4fe flip_test: don't skip checks for sequence #1
So far we skipped some tests for seq#0 and #1, since at that point we
were missing the 'last' state against which we could compare the current
state. Since in the previous patches we fixed the ordering in the test
loop and moved the increment of count to the update state phase, we have
a proper 'last' state for seq#1, so enable the tests already at that
point.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:40:06 +03:00
Imre Deak
ee8f485e55 flip_test: factor out the event state
Factor out the status vars that are specific to the flip events into a
separate structure. This will allow us tracking the vblank events with
the same code.

We move the increment of the flip event counter to the end of the test
loop, but this shouldn't affect anything. This is the only functional
change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:40:02 +03:00
Imre Deak
5fa695529c flip_test: swap the order of check state/run test step
At the moment we first check the state then run the test step in our
test loop. Swapping the order makes the starting state of each iteration
better defined, allowing an easier extension of these steps in the
future.

Since now it's guaranteed that we exit the event loop with no pending
flips, we can also get rid of the final flushing of events.

We don't want the first initializing flip to affect the test loop other
than setting an initial FB, so before starting the test loop wait for it
to complete by calling wait_for_events() and leave the flip event
counter at zero.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:34:28 +03:00
Imre Deak
960a3895a0 flip_test: split the flip handler into logical parts
The handler consits of handle_event/run_test/check_state/update_state
logical steps, split the function accordingly. This is needed by the
following patches that need to do part of these steps for both flip and
vblank events.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:34:28 +03:00
Imre Deak
9e43ecdf21 flip_test: store current flip/received timestamps in the context obj
This is needed by the next patch that splits the flip handler function
into logical parts. Make the timestamps accesible to these parts.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:34:28 +03:00
Imre Deak
161e525fd8 flip_test: factor out the final state check
Needed by an upcoming patch where we want to make a final state check
for both the flip and vblank events.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:34:28 +03:00
Imre Deak
c96d18a994 flip_test: factor out the event loop/wait for event logic
Needed by an upcoming patch where we want to wait for an event without
starting a new round of test run.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:34:28 +03:00
Imre Deak
0699dc7259 flip_test: move output panning inside the flip_handler
Move the panning to a more logical place where the rest of the test
steps are performed. As Daniel Vetter pointed it out, the proper place
is _after_ the flip command is sent, so that fb_set_base correctly waits
for any outstanding flip. So move the function between the flip and the
dpms/modeset off calls.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 19:33:33 +03:00
Imre Deak
3731fee849 flip_test: store fb width, height in test context object
We will need these in event handlers, so store them where the handlers
have access to them.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2012-10-16 18:45:16 +03:00
Imre Deak
f9f6bff80d flip_test: factor out drmModePageFlip
For better readability and to prepare for the upcoming patch marking
pending flip events with a flag.

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-16 16:55:04 +02:00
Imre Deak
43f6f873eb test_flip: fix checking for delayed event reception
The intent for the time limit seems to be 2ms, but the current condition
will result in a 1s limit and makes the check against tv_usec redundant.
Fix the condition to check for a 2ms limit.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-16 16:54:33 +02:00
Imre Deak
95a967faa2 flip_test: check drmHandleEvents()' return value
Signed-off-by: Imre Deak <imre.deak@intel.com>
[danvet: s/assert/do_or_die]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-16 16:54:10 +02:00
Imre Deak
f1b1729a8a flip_test: reset the state for each test run
Each test run needs a clean state.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-16 16:52:14 +02:00
Imre Deak
472e8a70c2 flip_test: free FBs after each test run
Though the FBs will be freed implicitly at process exit, with the
growing number of test cases it's probably better not to let them
accumulate and free them as soon as we can.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-16 16:52:04 +02:00
Daniel Vetter
dc5d76e2bf tests/flip_test: check -EBUSY and -EINVAL behaviour
We want -EBUSY for a pending flip and -EINVAL if the pipe is off
(either dpms off or completely off). With the small exception that
someone thought it would be funny to return -EBUSY when the crtc is
fully off.
2012-10-04 22:09:16 +02:00
Daniel Vetter
826326bc7c flip_test: fix timestamp order
When grabbing the timestamp after a flip, it has a decent chance to
actually be after the flip. Surprising.
2012-10-03 23:16:18 +02:00
Daniel Vetter
9965299cf3 flip_test: add an explicit flag for timing checks
We'll need this for the wait_vblank test cases.
2012-10-03 08:26:46 +02:00
Daniel Vetter
43737163d3 flip_test: increase runtime of the plain flip to 15s
This ensures that we'll hit the stupid hpd poll handler in every run.

Also don't yell around about jitter for tv outputs ...
2012-10-02 19:45:52 +02:00
Daniel Vetter
400535e82f tests/flip_test: measure inter-frame ts jitter
Yell if it's wrong.

For some odd reason this blows up on my snb. And always on the same
o->count frame on the 2nd crtc ... And we have to thank the hpd poll
helper for that. Comment explaining this added, also made the error
non-fatal.
2012-10-02 19:39:17 +02:00
Daniel Vetter
87f7dccab6 flip_test: race against modesets, too
Even slower than dpms switching ;-)
2012-10-02 19:39:17 +02:00
Daniel Vetter
d619a672df tests/flip_test: also test pannning with dummy load
Needs a bit more relaxed select timeout to work (which is not
required when testing dummy_load vs. dpms, since the dpms forces the
sync, not the select timeout).
2012-10-02 17:22:09 +02:00
Daniel Vetter
66fe119afd tests/flip_test: test interaction with panning
Since panning with set_crtc is synchronous, we need to stall for any
outstanding pageflips. This new testcase exercise that code. Unfortunately
we still need eyes to check whether we don't loose the offset :(
2012-10-02 17:17:40 +02:00
Daniel Vetter
3441ad29bf tests/flip_test: robustifications
- don't yell around about dropped frames on tv connectors (and explain
  why in a comment)
- wait a bit when using a test config that checks for dropped frames before
  starting. Also allow for 1% of fudge, this makes it reliably work
- make the dummy load more variable, took too long on older machines.
2012-10-02 17:01:06 +02:00
Daniel Vetter
cdad308a4b tests/flip_test: don't complain about timestamps in the future
those can happen due to the scanline vblank timestamp adjuster ...
2012-10-02 16:09:00 +02:00
Daniel Vetter
4c7fc65cb6 tests/flip_test: actually try to check what I want to check
/me sucks
2012-10-02 15:59:58 +02:00
Daniel Vetter
6b034a6fd6 tests/flip_test: check whether timestamp isn't in the past
This is mostly useful for when we add support for other clock sources,
e.g. clock_monotic, to check whether the kernel picked the right
clock.
2012-10-02 15:42:34 +02:00
Daniel Vetter
73af035c59 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 <daniel.vetter@ffwll.ch>
2012-10-02 15:37:24 +02:00
Chris Wilson
f509d40fa9 flip_test: count the number of flips and check we don't drop any
In the basic case of just flipping between two buffers with no
additional work, we should neve drop a frame.
2012-10-02 13:31:33 +01:00
Daniel Vetter
93ea0182c4 tests/flip_test: re-enable disabled testcases
oops
2012-10-02 11:50:20 +02:00
Daniel Vetter
4701dacbc5 tests/flip_test: new testcase with a busy load before the flip
I've hoped that this would be good enough to hang pch platforms, but
it looks like those just complete the flip immediately on disabled pipes.
2012-10-02 10:33:13 +02:00
Chris Wilson
a65087a26e tests/flip_test: Revamp to demonstrate race with modeset/dpms and pageflips
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-09-28 13:02:46 +01:00