590 Commits

Author SHA1 Message Date
Daniel Vetter
dfe942edec Revert "tests/gem_flink_race: count leaked objects"
This reverts commit bd927662fcfb1443c5982fb04cc694f78e1c8d53.

It's bogus.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24 09:31:40 +02:00
Daniel Vetter
aaeaca7720 tests/gem_flink_race: check for expected flink failure code
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24 08:01:35 +02:00
Daniel Vetter
bd927662fc tests/gem_flink_race: count leaked objects
And fail the test if the leak count is bigger than 0.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24 07:37:45 +02:00
Daniel Vetter
9736fc09e2 tests/gem_flink_race: kill debug printf
Oops.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24 06:55:10 +02:00
Daniel Vetter
7b5440a09a tests: add gem_flink_race
This exercises a race in the flink name descruction of the current drm
gem core. When racing a gem close with a gem open the open can sneak
in and cause the kernel to leak the flink name and its reference.

This results in leaked gem objects that won't get reaped even at drm
file close time. On my 2 core/4 threads snb machine this leaks on the
order of 1k objects per second.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-23 23:15:12 +02:00
Daniel Vetter
8e46c382e3 lib/drmtest: add gem_flink and gem_open
Requires us to rename a few things in the gem_flink test to avoid
variable shadowing.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-23 23:15:12 +02:00
Daniel Vetter
5fcb528cb3 tests: sort tests in Makefile.am and .gitignore
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-23 23:15:12 +02:00
Daniel Vetter
10834f8610 tests/gem_suspend: exercise fence restore code
This exercise the bug fixed in

commit 94a335dba34ff47cad3d6d0c29b452d43a1be3c8
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Jul 17 14:51:28 2013 +0200

    drm/i915: correctly restore fences with objects attached

For fun I've also added a subtest for the inverse transition.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-23 20:46:57 +02:00
Ben Widawsky
89d96a12d6 tests: Basic tools tester
Requested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-07-21 22:04:20 -07:00
Chris Wilson
f801b92882 test/gem_pread_after_blit: Make the test a little more stressful
Extend the simply functionality by repeating it under the rude
interrupter and chain together a couple of steps in new test cases.

As a compromise for adding more tests, incorporate the piglit subtest
framework.
2013-07-20 10:25:12 +01:00
Damien Lespiau
7d9dbd1fed tests: Source drm_lib.sh instead of having its own INTEL_SIMULATION test
One code path to maintain is always better.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-19 18:40:25 +01:00
Damien Lespiau
a7c56938c8 tests: Allow a shell test to declare it doesn't need to be DRM master
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-19 18:40:22 +01:00
Xiong Zhang
fc5c693014 tests: add reloc, pread, pwrite slow path subtest
the reloc, pread, pwrite slow path will be prevented by prefault,
these subtests will disable prefault first, then do reloc, pread,
pwrite, finally enable prefault.

Signed-off-by: Xiong Zhang <xiong.y.zhang@intel.com>
2013-07-19 18:12:44 +02:00
Damien Lespiau
161e610765 tests: Add some tiled tests to the runs on simulation
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 16:16:19 +01:00
Damien Lespiau
00ab9a1313 tests: Instrument gem_seqno_wrap to run in simulation
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:56:59 +01:00
Damien Lespiau
204df66798 tests: Instrument gem_lut_handle for simulation
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:56:53 +01:00
Damien Lespiau
d1e862324b tests: Instrument tests run in simulation to run quickly
We tweak the tests marked as runnable in simulation to run more quickly,
more often then not at the expense of stress testing (which is of an
arguable interest for the initial bring up in simulation). Hopefully the
values chosen still test something, which is not always straightforward.

It does run quickly, the number on an IVB machines are:

$ time sudo IGT_SIMULATION=0 ./piglit-run.py tests/igt.tests foo
[...]
real	2m0.141s
user	0m16.365s
sys	1m33.382s

Vs.

$ time sudo IGT_SIMULATION=1 ./piglit-run.py tests/igt.tests foo
[...]
real	0m0.448s
user	0m0.226s
sys	0m0.183s

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:56:35 +01:00
Damien Lespiau
5fa15f79d0 tests: Black list tests we don't want to run on simulation
Let's start by a small set of tests, to eventually consider running
more.

The current list should then be:

gem_mmap
gem_pread_after_blit
gem_ring_sync_loop
gem_ctx_basic
gem_pipe_control_store_loop
gem_storedw_loop_render
gem_storedw_loop_blt
gem_storedw_loop_bsd
gem_render_linear_blits
gem_tiled_blits
gem_cpu_reloc

gem_exec_nop
gem_mmap_gtt

v2 add (Daniel Vetter)
gem_exec_bad_domains
gem_exec_faulting_reloc
gem_flink
gem_reg_read
gem_reloc_overflow
gem_tiling_max_stride
prime_*

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2013-07-18 15:49:02 +01:00
Daniel Vetter
05cc515f3a tests/prime_nv_api: check multiple foreign imports with flink
We want prime to only ever create one native gem object for each
dma-buf it sees. This can e.g. happen if multiple processes import the
same foreign dma-buf, e.g. the application imports a yuv frame from
v4l to encode it into a video stream and the compositor imports it
into his fd again to display it with an overlay.

Hence add a bunch of tests which check all the various orders in which
this could happen. Currently they all fail.

Checking flink names is the easiest (and afaik only) way to check
whether we're indeed dealing with the same object.

This checks both ways, i.e. exporting from i915 and from nouveau, each
with two variants of the test: One reuses the prime fd, the other
closes it and creates a new one.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-16 13:36:38 +02:00
Daniel Vetter
d64a9458b2 test/prime_nv_test: use gem drmtest functions for pread/pwrite
Different argument order, otherwise the same.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-15 11:12:31 +02:00
Daniel Vetter
bc1a85e813 test/prime_nv_test: nicer test names
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-15 11:09:57 +02:00
Daniel Vetter
4a9d50db1b test/prime_nv_api: more descriptive subtest names
Preprocessor magic ftw!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-15 11:04:20 +02:00
Daniel Vetter
1a3c7e3493 tests/prime_nv_api: Drop bogus check from import-twice
It's purely accidental that importing that same bo to different
drm nouveau fds yields the same handle.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-15 10:59:55 +02:00
Daniel Vetter
c28b898cd4 tests/prime_nv_api: convert to subtest infrastructure
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-15 10:51:10 +02:00
Chris Wilson
b37d89318d tests/gem_write_ring_switch: Skip on pre-SNB
The test requires MI commands only introduced with SNB, and so causes
GPU death on gm45 and ilk.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66838
2013-07-12 10:07:04 +01:00
Chris Wilson
7dbc43f27a tests/gem_write_read_ring_switch: Repeat under rude interrupter
Another waiter that will then be subject to being interrupted, so retest
the ring switches with the rude interrupter.
2013-07-12 10:00:42 +01:00
Daniel Vetter
727440c48a tests: actually add gem_write_read_ring_switch
Duh ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-10 15:34:56 +02:00
Daniel Vetter
21c0ab30a1 test: add gem_write_read_ring_switch
This is meant to exercise the bug fixed in

https://patchwork.kernel.org/patch/2825192/

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-10 10:35:10 +02:00
Chris Wilson
79b3029fe8 gem_(tiled|linear)_blits: s/interrutible/interruptible/
Spelling fix in "interruptible" subtest name.
2013-07-04 01:12:00 +01:00
Daniel Vetter
db94faede5 tests/kms_flip: don't run blocking relateve vblank waits with interrupts
They simply take forever with the current kernel implementation. And
since everyone switched over to the event based interface I don't see
much incentive to try to fix that.

So just disable them.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-04 01:52:04 +02:00
Daniel Vetter
9360df4ab3 tests/gem_linear|tiled_blits: convert to subtests
Finer granularity for nightly runs and regression reporting is always
nice.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-03 08:47:34 +02:00
Chris Wilson
bc388b54d4 drm_lib.sh: Be more precise in detecting the i915 /sys path
We need to be careful in case other devices grow an error file in the
future. The first step here is just to check the minor that corresponds
with the debugfs path found for the device
2013-07-03 08:17:18 +01:00
Chris Wilson
e50ae9596c tests/hangman: Be lenient towards a non-existent sysfs error state
As /sys/class/drm/cardX/error is a new interface for 3.11, we need to be
quiet when it does not exist or else we upset the automated tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66533
2013-07-03 08:17:18 +01:00
Chris Wilson
ae452e327a tests/gem_(linear|tiled)_blits: Repeat whilst being interrupted
Since these two tests exercise a working set larger than aperture, they
require stalls which are prone to being interrupted - so interrupt them
and check that everything still works.
2013-07-02 11:29:26 +01:00
Daniel Vetter
faf2a0223c tests/drm_lib.sh: Don't die if the sysfs path can't be found
That just means that the sysfs error file isn't there.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-02 09:13:57 +02:00
Daniel Vetter
3f93e1bc74 test/drm_lib.sh: Updated sysfs error filename
I've forgotten to bikeshed that part ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-02 09:09:56 +02:00
Mika Kuoppala
857b464b34 tests/ZZ_hangman: Test both error_state interfaces
Test both debugfs and sysfs error_state interfaces.

v2: sysfs error_state not mandatory

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
[danvet: Update sysfs file name.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-01 18:55:35 +02:00
Mika Kuoppala
6fd652ac1d tests: add i915_sfs_path
To access 'error_state' through sysfs.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-01 18:54:53 +02:00
Mika Kuoppala
3743a0b994 tests: rename debugfs base path to be more specific
In preparation to have sysfs entries used in scripts
rename to more specific name.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-01 18:54:40 +02:00
Chris Wilson
4541cbeba4 tests/kms_flip: Repeat all of the tests whilst being rudely interrupted
Once upon a time, our modesetting code used to fail if it was
interrupted. So lets make sure that never happens whilst flipping.
2013-07-01 12:52:43 +01:00
Daniel Vetter
64ff612b81 tests/gem_cpu_concurrent_blit: stop signal helper again
Not doing so totally upsets the piglit igt runner since we leave
a bunch of zombies behind.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-06-29 17:50:49 +02:00
Chris Wilson
13932d67de tests/gem_cpu_concurrent_blit: Restore lost intel_copy_bo()
Accidentally replaced the intel_copy_bo() with the set_bo() in the
"overwrite-source" in 4fd34977aff60f58cd955eb9c2d568d5fb824611 when
clearly I wanted to simply add the calls to set_bo() first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-29 17:19:35 +01:00
Chris Wilson
b1f23fe1d4 tests/gem_cpu_concurrent_blit: Undo debugging hack
Accidentally left in the hack to run the
"overwrite-source-interruptible" for only one loop, used whilst testing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-29 17:10:19 +01:00
Chris Wilson
4fd34977af test/gem_(cpu|gtt)_concurrent_blit: Move the set_bo() from create to the test
Hiding the initial set_bo() required for the "overwrite-source" tests
lead to a nice bit of hilarity as I missed repeating the initialisation
for the multiple loops of the interruptible version of
"overwrite-source".

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-29 17:07:51 +01:00
Chris Wilson
4c6f2d4e0c tests/gem_(cpu|gtt)_concurrent_blit: Restore the old tests and add the new interruptible as new tests
Daniel preferred to keep the old tests intact lest we accidentally break
them, and to add the new interruptible tests as new subtests.

In the process also make sure the GPU is idle before starting each loop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-29 16:49:05 +01:00
Chris Wilson
95426dc206 tests/gem_(cpu|gtt)_concurrent_blit: Enable signals
In order to exercise the bug behind:

commit 22fd5ca947b58901927d100d2b1aa0f1672b3435
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Fri Jun 28 16:54:08 2013 +0100

    drm/i915: Only clear write-domains after a successful wait-seqno

we need to check for concurrent access with the potential to be
interrupted by a signal. The framework for doing so is already in place,
so just enable it and repeat the tests for longer to give better chance
of being interrupted at just the wrong moment.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-29 16:37:20 +01:00
Chris Wilson
ebfd01908f tests/gem_lut_handle: Quit when we hit ENOSPC
I'd been working under the falsehood that we would always generate an
error for an invalid reloc->target_handle before reserving any object.
However, only the execlist is checked up front for validity before
reservation so ENOSPC is a genuine error condition raised by the test.
Fix it so that we stop reporting that limit as a test failure.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65391
2013-06-27 19:41:52 +01:00
Chris Wilson
60e3930987 tests/gem_lut_handle: Simplify creation of broken handles
Limit the broken handles to UINT32_MAX-4096 so that we can be sure that
they do not alias with a valid handle.

References: https://bugs.freedesktop.org/show_bug.cgi?id=65391
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-24 13:55:53 +01:00
Chris Wilson
6de9736394 tests/kms_flip: Suppress failure from setting mode
We may fail to set a mode if it fails some hidden constraints, such as
bandwidth on the third pipe. This is expected, so skip testing such
modes.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66111
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-06-24 12:06:00 +01:00
Chris Wilson
d2048819b9 kms_render: Skip unsupported display configurations
Certain modes may not be supported by certain combinations of pipes.
This is impossible to determine upfront, and we await an atomic
modesetting query operation. In the meantime, if we fail to set a mode,
just skip that test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66000
2013-06-21 16:54:47 +01:00