40 Commits

Author SHA1 Message Date
Chris Wilson
a72d405629 igt/gem_concurrent_blit: Test copying over itself
Suggested by Lionel Landwerlin as a means to emulate video decode
workloads.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-19 10:14:34 +00:00
Chris Wilson
a172676488 igt/gem_concurrent_blt: Test overwrite source used for read-read optimisation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-17 09:43:52 +00:00
Chris Wilson
35b0ac99fc igt/gem_concurrent_blit: Exercise concurrent reads
Since we are considering implementing read-read optimisations for mixed
engine workloads, make sure that we at least have a few tests that check
for coherency when doing so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-17 09:43:52 +00:00
Chris Wilson
99b5ee8aaa igt/gem_concurrent_blit: Move buffer allocation after requires
The choice is to either move the igt_require from the buffer allocation
(and allow the allocation to fail) inside the igt_fixture, or move the
buffer allocation to the subtest. Moving it to the subtest has the
advantage of ensuring that every test has the same initial state (no
chance of leaking state across tests) and speeding up running a single
subtest.

Note this is necessary in order to run igt/gem_concurrent_blit on older
kernels, otherwise the requirement for mmap(wc) causes us to skip the
majority of tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-17 09:43:52 +00:00
Daniel Vetter
3cd45dec2e lib/igt_gt: Document and consolidate
Also move forcewake and stop_rings code from igt_debugfs to igt_gt
since it fits better. And move the hang injection fork helpers from
igt_aux to igt_gt, too.

Also push the intel_gen call into igt_hang_ring while at it.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:36 +01:00
Daniel Vetter
3e9b4e37e6 tests: Align subtest with naming convention
Yeah, historically grown but we should try to be somewhat consistent.
It helps with filtering testcases.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:36 +01:00
Daniel Vetter
a3e34ce258 lib/ioctl: gem_ prefix for igt_require_mmap_wc
We stick to the overall prefix even for magic require functions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13 09:35:35 +01:00
Daniel Vetter
c66b2425e7 lib/gt: api polish for igt_can_hang_ring
Align with common igt library style:
- Push the igt_require into the function.
- Push the intel_gen into the function.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13 09:35:35 +01:00
Daniel Vetter
6011508afe tests/gem_concurrent_blit: Fix indent
Thrown up my brain's parser for a moment ;-)

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-01-22 10:01:28 +01:00
Daniel Vetter
fbcc7ba20f tests/gem_concurrent_blt: Adjust subtest naming
Our tooling doesn't cope with () in the testnames (piglit becomes all
confused apparently) and the naming convention says to use "blt" and
"render".

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88220
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=88349
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-01-22 09:49:17 +01:00
Chris Wilson
16bafdf5bf igt/gem_concurrent_blit: Inject hangs before verifying contents
After setting up the copy operations, add a hanging batch. This should
mean that we complete the copy and the compare then races against the
GEM reset. Hopefully, this will catch driver bugs where the target
object is no longer accessible after the hang.

Note: hang injection is disabled until the required kernel interface is
completed. But there are useful additional tests here...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-01-07 17:35:14 +00:00
Chris Wilson
f2a045f851 igt/gem_concurrent_blit: Exercise wc mappings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06 09:29:45 +01:00
Thomas Wood
b2ac2642a9 tests: add more test descriptions
Add more test descriptions based on exiting comments.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-12-04 16:07:55 +00:00
Chris Wilson
3e766b8255 igt/gem_concurrent_blit: Only read back a few GTT values
Due to the nature of the test, we can be reasonably sure that it is
either all copied or not. So we can sacrificing testing the entire
buffer for the expected value in order to speed up the test by only
testing along the diagonal.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84354
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-26 07:58:11 +01:00
Chris Wilson
081887504a igt/gem_concurrent_blit: Move igt_require() out of children
Otherwise the test infrastructure throws a fit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83420
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-03 13:38:30 +01:00
Chris Wilson
c12f292b1d igt/gem_concurrent_blit: Use the preallocated dummy bo for temporary copies
Use the existing allocation, saves having to make fresh allocations in
the innermost loop - trimming code and potential failure paths.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-31 16:25:43 +01:00
Chris Wilson
86055df968 igt/gem_concurrent_blit: Apply some fence pressure as well
As before, we also want to race against access through the fence
registers. This overlaps slightly with gem_set_tiling_vs_blt, but the
different access pattern should make it useful.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 20:02:10 +01:00
Chris Wilson
59c55626f9 igt/gem_concurrent_blit: Add ring race checks
Similar to the previous commit, we also want to check that every
pipeline is serialised correctly. This extends the test to include
render copies as well as blits.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 13:52:50 +01:00
Chris Wilson
6c428a6c06 igt/gem_concurrent_blit: Add GPU-vs-GPU checks
In future, we may allow reordering of GPU batches. This implements a
simple race detector by extending the current CPU-vs-GPU checks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29 13:20:39 +01:00
Daniel Vetter
e624fa8a2e tests: sprinkle igt logging
All the cases that simply dump some debug information and couldn't be
converted to some of the fancier macros.

Some information output removed when it's redundant with the subtest
status.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 00:36:04 +02:00
Daniel Vetter
f5daeec724 lib: extract igt_aux.[hc]
And shovel all the various helpers in there.

Also move igt_set_vt_graphics_mode to igt_kms.h since the function is
implemented in igt_kms.c. And it fits better. I kinda missed this in
the prep work.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-23 13:47:09 +01:00
Daniel Vetter
c03c6ceb29 lib: rename intel_gpu_tools.h to intel_io.h
With the header cleanup we can now give this header a suitable name,
since it now really only contains register access and other I/O
functions and assorted definitions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 21:34:29 +01:00
Daniel Vetter
e49ceb8690 lib: unnecessary header removal for drmtest.h, part 1
Brought a few missing headers to light in ioctl_wrappers.h, too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22 21:07:37 +01:00
Daniel Vetter
eaccd444f7 lib: switch intel_copy_bo to directly take a size
Instead of a width/height combination. Since I've been lazy with the
math this now only accepts page-aligned copy operations, but that's
all we need really.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-13 18:07:22 +01:00
Chris Wilson
0b4c33f62c igt/gem_concurrent_blit: Scale resource usage to RAM correctly
Note that we use twice the number of buffers, and so we need to restrict
num_buffers appropriately to fit within RAM.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72255
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-26 14:38:42 +00:00
Daniel Vetter
aee0dcb1ec test/gem_concurrent_blt
Limit working set size also with available ram.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72255
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-03 16:32:52 +01:00
Daniel Vetter
071e9ca1ca lib: add igt_main macro
In the past new testcases with subtest often forgot to add the call to
igt_exit at the end of their main() function. That is now caught with
a bit more obnoxious asserts, but it's still a nuissance.

This little igt_main macro takes care of that (and also of calling the
subtest machinery initialization code correctly).

If no one objects I'll roll this out for all the simple cases (i.e.
those tests that don't have additional argv parsing on top of the
subtest machinery).

v2: Roll it out across the board.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01 21:10:59 +01:00
Daniel Vetter
8eaa0982d0 test/gem_concurrent_blt: remove hack for testing igt_fork
Oops, this shouldn't have been committed ...

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68830
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-02 08:04:19 +02:00
Daniel Vetter
cd1f220847 lib/drmtest: extract igt_fork from gem_concurrent_blt
Making sure that we correctly collect the exit codes from all children
is a bit a hassle. So add another magic igt codeblock for easy forking
and joining.

Note that children are (currently at least) not allowed to call igt_skip.
Add an assert to enforce this.

v2:
- Properly propagate the exit code.
- Fix the segfault.
- Add a child int and num_children paramter to the magic codeblock as
  suggested by Chris Wilson.
- Don't dump noise into stdout when a child thread fails, the parent
  will do that for us already.

v3: Now with some docs.

v4: Fixup igt_waitchildren to properly reset state so it can be used
again.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-29 18:18:33 +02:00
Daniel Vetter
ad0f081f2b Revert "tests/gem_concurrent_blit: Fix segmentation fault"
This reverts commit 912a7d855600aadb937517ec5bab26bfd9b8953d.

Now fixed for real!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-26 20:55:54 +02:00
Daniel Vetter
912a7d8556 tests/gem_concurrent_blit: Fix segmentation fault
Apparently the simple changes introduced in

commit 78865847f9fae7e590960f9836f2ec8b611a190e
Author:     Daniel Vetter <daniel.vetter@ffwll.ch>
AuthorDate: Mon Aug 19 07:23:49 2013 +0200
Commit:     Daniel Vetter <daniel.vetter@ffwll.ch>
CommitDate: Mon Aug 19 08:09:25 2013 +0200

    lib/drmtest: skip fixtures after an igt_skip

pushed the stack space requirement for run_modes over some magic limit
(I guess where the strack grow logic starts to fail, but I didn't
check). Fix this by moving the data into .bss.

Also add some asserts to check that fixtures aren't abused while at
it (i.e. the useful parts of my debug printf/assert craze).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68299
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-20 06:42:10 +02:00
Chris Wilson
0d320fdced gem_concurrent_blit: Purge the child bufmgr's cache
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68169
2013-08-16 12:23:17 +01:00
Chris Wilson
1b17cb9d04 gem_concurrent_blit: Fix the leak from the children.
As the children use the parent's fd, the kernel only has a single filp
for everyone. Therefore we cannot rely on the process termination
reaping the buffers we allocate for the children.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68169
2013-08-16 11:26:00 +01:00
Chris Wilson
1ca607b458 gem_concurrent_blit: Share total num_buffers between all children
Apparently not all machines have more than 4GiB of RAM available.
Spoilsports.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68169
2013-08-16 09:52:43 +01:00
Daniel Vetter
2dbd998429 tests: Introduce igt_fixture
Just a tiny wrapper to protect global test setup/teardown code when
just listing subtests. Rolling this out over all tests with subtests
should allow us to generate the testlist with piglit as an
unpriviledged user on a non-intel system.

The aim here is to make our QA team happy who currently suffers from
this. Even more so for the prime tests since you need a system with
intel _and_ nouveau gpus to just be able to list tests.

Exemplary conversion with gem_concurrent_blt.c

Fixture is the same name other test suites like googletest use for
setup/teardown code used by multiple tests.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 17:04:56 +02:00
Daniel Vetter
a1ca8ef5b1 tests: use igt_exit() consistently with subtests
This is mostly important to get the SKIP reporting right, but I've
found a few stragglers that wanted to get converted over to the igt
result reporting completely.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 16:08:00 +02:00
Daniel Vetter
ec283d6a52 tests/gem_concurrent_blt: extract run wrappers
Functional programming ftw!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 15:18:37 +02:00
Daniel Vetter
9a4957a1b3 tests/gem_concurrent_blt: use the test helpers in the forked tests
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 15:10:52 +02:00
Daniel Vetter
5a598c9b2e tests/gem_concurrent_blt: refactor basic run modes a bit
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 15:08:05 +02:00
Daniel Vetter
43779e37b5 tests: merge gem_*_concurrent_blt together
Too much copy&pasting isn't good.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-14 14:50:50 +02:00