760 Commits

Author SHA1 Message Date
Chris Wilson
467796acc8 Expand gem_set_cacheing testing to handle the proposed DISPLAY domain 2013-08-10 15:49:33 +01:00
Daniel Vetter
a285f03f56 tests/prime_self_import: fix comment 2013-08-07 19:56:47 +02:00
Daniel Vetter
00280fa82a tests/prime_self_import: Fixup previuos test
... not a great display of my prowess here.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-07 18:36:31 +02:00
Daniel Vetter
8e11ab4192 tests/prime_self_import: Add a flink/dma-buf self-import test
This checks that we really always fill the dma-buf export cache. Which
sometimes we don't.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-07 18:13:48 +02:00
Daniel Vetter
e7c4fde8c1 tests: update .gitignore
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-07 12:01:35 +02:00
Daniel Vetter
57622965e5 tests/gem_pwrite_pread: subtest annotation
This testcase mixes correctnes tests with performance tests, so it's
good to track the different correctness test separate for QA.

Together with pread_after_blt the pwrite->blt tests here exercise the
full cache coherency lifecycle of both snooped and uncached objects.

/me is happy

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-07 11:59:05 +02:00
Daniel Vetter
3dba47e896 tests: add gem_prw_concurrent_blt
New testcase to check that pwrite/pread correctly synchronize with
oustanding rendering. Just to catch regressions when we change
something.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-06 22:28:41 +02:00
Daniel Vetter
4901b5ff0e tests/prime_self_import: Add racing handle2fd testcase
Similar to how we test flink races. Note that on unfixed kernels this
oopses, and with my current set of patches it still leaks like mad.

v2: Only close the prime fd if we've successfully created it.

v3: Add a reimport test to check whether we don't race when reaping
the obj->dma_buf link.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-06 21:59:55 +02:00
Daniel Vetter
9ff5161354 tests/gem_flink_race: Kill duplicate drm_open_any
Leak test that leaks ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-06 21:59:55 +02:00
Chris Wilson
d9bc787673 gem_pwrite_pread: Use mmap to bypass pwrite/pread for comparison
Just to help sanity test alternate paths.
2013-08-06 18:03:18 +01:00
Chris Wilson
e4a7c2fe6d gem_pwrite_pread: Measure how long it takes to upload/copy/download
Further trying to determine the effects of setting snooping.
2013-08-06 16:58:59 +01:00
Chris Wilson
5d635f95f2 gem_pread: Symmetric measurement to gem_pwrite 2013-08-06 16:58:59 +01:00
Chris Wilson
aad68d1a86 gem_pwrite: Time pwrites to both uncached/snooped memory 2013-08-06 16:58:59 +01:00
Chris Wilson
a661c098b0 gem_partial_pwrite_pread: Exercise different cacheing of the staging bo 2013-08-06 16:58:59 +01:00
Chris Wilson
24eade08ab gem_pread_after_blit: Exercise reading back through different cache levels 2013-08-06 16:58:59 +01:00
Imre Deak
3052fe2c91 kms_render: fix gpu-blit for non-32bit bpps
intel_copy_bo assumes a 32bpp bo, whereas we passed it bos with
arbitrary bpp values. This resulted in thrashing GPU memory following the
destination bo.

Fix this by using a blit helper that can handle other bpps too.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-07-29 18:40:00 +03:00
Daniel Vetter
e3e4db93db tests/sysfs_edid_timing: use real bash
The lib/drm_lib.sh load path trick doesn't work otherwise. Tsk.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-25 21:51:53 +02:00
Daniel Vetter
db225aa38d tests/gem_flink_race: correct thread count
They all race against each another, no worker-slave relationship
like in the other subtest.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24 17:04:35 +02:00
Daniel Vetter
bc62a64b8a tests/gem_flink_race: fix up scanf format
Oops, failed to git add.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24 17:01:11 +02:00
Daniel Vetter
24bbca9237 tests/gem_flink_race: actually make it somewhat useful
- Enable subtest support.

- Add a check for the same flink name in the racing threads, which is
  an issue one of my recent patches actually fixes.

- Add the test I've actually wanted to write which races an flink
  against gem close (with no open in between). That one does indeed
  leak.

- Readd the leak check, but note that this needs a fixed kernel.
  Otherwise the leak counter will be utter garbage.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-24 12:52:01 +02:00
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