956 Commits

Author SHA1 Message Date
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
Imre Deak
21393431f1 drmtest: add function to remove an DRM FB
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-16 16:51:56 +02:00
Ben Widawsky
dc3ac00f03 sysfs_rps: Add negative test case for bad values
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2012-10-15 10:05:56 -07:00
Daniel Vetter
50d46750d9 lib/mmio: gen2 has a bigger register window, too
It's split up into two parts, with the gtt pte range in between.
Without this I couldn't read the ADPA register ...
2012-10-12 10:45:52 +02:00
Imre Deak
31dfc98a30 fix warn in testdisplay: ignoring return value of 'chdir'
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-10 15:59:19 +02:00
Imre Deak
0bf5fd894c fix warn in prime_nv_*: ignoring return value of ‘fgets’
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-10 15:59:17 +02:00
Imre Deak
bcfc0f1e4b fix warn in gem_reg_read: 'read' shadows a global declaration
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-10 15:59:14 +02:00
Imre Deak
3a622b9784 fix warn in sysfs_{rc6, rps}*: ignoring return value of 'fscanf'
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-10 15:59:12 +02:00
Imre Deak
b614b4d648 fix warn in gem_readwrite: 'read/write' shadows a global declaration
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-10 15:59:10 +02:00
Imre Deak
9de58cf6c1 fix warn in intel_reg_snapshot: ignoring return value of 'write'
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-10 15:59:07 +02:00
Imre Deak
5efd3d3d22 fix warn in intel_error_decode: ignoring return value of 'asprintf'
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-10 15:59:05 +02:00
Imre Deak
6456e75f0d fix warn: 'div' shadows a global declaration
Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-10 15:59:02 +02:00
Daniel Vetter
1a83c0990a tests/gem_exec_big: fixups
- don't emit a self-modifying batch, the kernel doesn't like those
- also change the buffer size, to exercise all corner-cases of the
  sg_table stuff
2012-10-09 22:47:59 +02:00
Daniel Vetter
fa6b0208ab tests/gem_exec_big: add a reloc at the end of the big batch
Since that's the other place where the broken get_page blows up.

Actually it seems to only blow up on specific pages ...
2012-10-09 19:53:52 +02:00
Daniel Vetter
1431938c5c tests: add big batchbuffer test
... and use it in the hangman to stress the error_state capture a bit more.

Uncovered a bug in the obj->pages ->obj->sg_list rework.
2012-10-09 19:29:02 +02:00
Daniel Vetter
5f94468f52 lib: remove auto-quiescenting of the gpu
In retrospective, this is an ugly idea. Any tests that needs this
can call it themselves.
2012-10-09 19:27:41 +02:00
Daniel Vetter
b8e384a4d5 lib: make drmtest_progress more robust 2012-10-09 17:50:40 +02:00
Daniel Vetter
e5722bac9c tests: update .gitignore
I've thought I've fixed this, but looks like I've failed to commit.
2012-10-09 17:32:00 +02:00
Daniel Vetter
c9795c6dfe tests: add gem_cs_tlb
Should test tlb coherency, but somehow it fails to hit the bug I want
it to hit ... needs more work.
2012-10-09 17:30:59 +02:00
Daniel Vetter
a7787baccc tests/gem_cs_prefetch: clarify what it tests
I've forgotten ;-)
2012-10-09 15:51:13 +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
1422c22e89 tests/*storedw*: add subcases with more outstanding batches
Just in case this is better at hitting seqno signalling races ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-04 13:22: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
630dd4087d tests/gem_caching: only disable on vintage i965g/gm
Hooray for confusing macros!

Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-03 19:01:30 +02:00
Daniel Vetter
2d431fd6b6 tests: add drm_threaded_access_tiled
This catches parallel access to bo->virtual causing sigbus

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
[danvet: applied some bikeshed
- changed prefix from drm_ to gem_, it's a kernel gem test
- added autohell magic to link with pthreads
- .gitignore entry
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2012-10-03 13:44:30 +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
Chris Wilson
aaa460951d gem_cpu_reloc: Do another pass explicitly moving to the CPU write domain
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 21:40:46 +01:00
Chris Wilson
99a0824669 gem_cpu_reloc: Use the mappable aperture size!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 21:05:29 +01:00
Chris Wilson
217511012a gem_cpu_reloc: And run the test in reverse to check with already bound batches
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 21:05:29 +01:00
Chris Wilson
8b2c19da0b gem_cpu_reloc: Fix for running on SNB+
I work with these everyday and I still made a basic mistake.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 21:05:29 +01: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
Chris Wilson
ef45b44036 gem_wait_render_timeout: Fix SKIP return code
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 19:22:37 +01:00
Chris Wilson
3b9a76d2fa tests: Add gem_cpu_reloc
Attempt to stress test performing relocations whilst the batch is in the
CPU domain.

A freshly allocated buffer starts in the CPU domain, and the pwrite
should also be performed whilst in the CPU domain and so we should
execute the relocations within the CPU domain. If for any reason one of
those steps should land it in the GTT domain, we take the secondary
precaution of filling the mappable portion of the GATT.

In order to detect whether a relocation fails, we first fill a target
buffer with a sequence of invalid commands that would cause the GPU to
immediate hang, and then attempt to overwrite them with a legal, if
short, batchbuffer using a BLT. Then we come to execute the bo, if the
relocation fail and we either copy across all zeros or garbage, then the
GPU will hang.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-10-02 17:35:01 +01: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