1873 Commits

Author SHA1 Message Date
Daniel Vetter
2371c79bbd lib/drmtest: roll out igt_assert
I've left the asserts as-is where they check for tests that use the
infrastructure in drmtest.c incorrectly. That way piglit's
differentiation between a failed testcase and a crashing testcase
should be more useful.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:07:44 +02:00
Daniel Vetter
646a6fefbc lib/drmtest: add igt_assert as a replacement for assert
The aim is that we keep on running subtests even when a not-too-lethal
assert failed in a subtest. To make that useful also print per-subtest
test results from igt_skip|fail|success functions.

If required we can always go googletest-nuts with different types of
asserts later on, but I think for now we're good with what we have
here.

v2: Also print out proper SKIP message when skipping all subsequent
tests since a global (i.e. outside of a subtest) init step failed and
resulted in an igt_skip call.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 15:07:01 +02:00
Daniel Vetter
c67ebf413a lib/drmtest: fixup igt_fail for the list-only case
Oops.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13 11:40:57 +02:00
Daniel Vetter
bd161f8c04 tests: add drm_get_client_auth
To check we don't break the magic authentication check libva does.

Ugh.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 19:51:40 +02:00
Daniel Vetter
a7433ec9ee tests: scrap old automake based kernel test runner
Upstream broke our dynamic creation of the testlist, and I think
adding stupid .tests suffixes everywhere just to appease upstream
autohell tools isn't that great. So scrap it, we can use piglit
instead.

References: https://lists.gnu.org/archive/html/help-debbugs/2013-06/msg00000.html
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 14:09:55 +02:00
Daniel Vetter
6877877558 tests: s/return igt_retval();/igt_exit();/
Requested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:26:35 +02:00
Daniel Vetter
1caaf0a6b6 s/drmtest_/igt_/
Requested-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:20:22 +02:00
Daniel Vetter
814b135541 s/drmtest_subtest_block/drmtest_subtest/
The _block postfix meant to convey that a C statement/block must
follow can be misread as the verb to block. So drop it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 12:15:16 +02:00
Daniel Vetter
16024841a1 lib/drmtest: __ prefix for drmtest_run_subtest
Now that callers must setup the longjmp target (we can't do that in
run_subtest itself since that callframe won't survive) tests shouldn't
call this function directly any more.

Make this clear by adding a __ prefix.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:57:32 +02:00
Daniel Vetter
d65d19d4f4 lib/intel_mmio: Remove unused label
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:17:58 +02:00
Daniel Vetter
7847ea2965 tests: use drmtest_skip to check for rings
To simplify things add a set of gem_check_<ring> functions which take
care of this. Since I've opted for static inlines drmtest.h grew a few
more header includes which was a neat opportunity to dump a few redundant
#defines.

This kills all the skipped_all hand-rolled logic we have.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:17:58 +02:00
Daniel Vetter
7553ad6e10 tests: use drmtest_skip() in caching ioctl helpers
This way we can rip out all the skip handling from the test control flow,
and additionally (by using drmtest_retval()) even get correct exit codes.

The only tricky part is that when we only want ot skip parts of a test
(like for gem_pread and gem_pwrite) we need to split out those parts as
subtests. But no addition of control-flow is required, the set/longjmp
magic in the helpers all makes it happen.

Also we make extensive use of the behaviour of drmtest_skip to skip
all subsequent subtests if it is called outside of a subtest. This allows
us to re-flatten the control flow a lot.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:17:58 +02:00
Daniel Vetter
a4038d3853 lib/drmtest: make signal process cleanup more robust
If we skip a test and and fail somewhere the parent might die before the
child. So add some cleanup to handle this case. Also make sure that the
parent indeed waits for the child to die.

This is required to make the latest version of the piglit runner happy,
it tends to wait for all zombies to disappear.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:10:26 +02:00
Daniel Vetter
740065f0f9 tests/gem_caching: convert to use drmtest retval infrastructure
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:10:26 +02:00
Daniel Vetter
ba0d2acf0e lib/drmtest: skip/fail handling
Exitcode handling in igt testcases has too ugly facets in combination
with subtests:

- When individual subtest needed to be skipped for different reasons
  we need to painstakingly thread this information through the test to
  make sure that we still succeed if just one testcase worked (for
  running it with the simple automake test runner in igt). But it also
  needs to correctly report the skip exit value if only this one
  skipped testcase has been run (e.g. when run with piglit or in QA's
  test infrastructure).

- We'd prefer to easily skip (and also fail) subtests without
  hampering other subtests. Again threading the return value of each
  subtest through the code is cumbersome.

To simplify test case writing use longjmps to be able to get out of
subcases easily. But since longjmps are funny things thug it all away
into the newly added drmtest_subtest_block macro.

Note that if drmtest_skip is called outside of a subtest, but in a
testcase with subtests all subsequent subtests will be automatically
skipped.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:10:26 +02:00
Daniel Vetter
9f6365e4ea lib/drmtest: Add drmtest_subtest_block macro
Doesn't do more than an if (drmtest_run_test(name)) right now, but
as soon as we get a bit of infrastructure to handle test failures and
skipping, this will get more interesting.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:10:26 +02:00
Daniel Vetter
40ea6f4ea8 tests: s/cacheing/caching
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12 11:10:26 +02:00
Chris Wilson
7b254f1939 gem_pwrite: Print the cache name not the number
Bugzilla: https://bugzilla.freedesktop.org/show_bug.cgi?id=68003
2013-08-12 08:39:26 +01:00
Chris Wilson
467796acc8 Expand gem_set_cacheing testing to handle the proposed DISPLAY domain 2013-08-10 15:49:33 +01:00
Chris Wilson
dbbf2e9b24 intel_error_decode: First try /sys/drm/card0/error for the error-state
As the sysfs is almost always mounted and readable, we have a higher
success rate checking for our error state there than in debugfs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-07 23:43:25 +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
ab6ac67243 lib: Reset sig_stat after stopping the rude interrupter 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
Imre Deak
24de8bac80 lib: export drm_format_to_bpp
Needed by the next patch.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-07-29 18:40:00 +03:00
Imre Deak
c1ee0bb532 intel_batchbuffer: add support for non-32bit blt copies
Needed by an upcoming patch fixing kms_render's blits for fbs that have
other than 32bpp formats.

Based on the corresponding SNA function.

v2:
- fix random ordering of src, dst parameters (Chris)
- pass pitch in bytes rather than pixels (Chris)

Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-07-29 18:40:00 +03:00
Ben Widawsky
a85548910c lib/intel_mmio: Fix the fixed fix (register access)
When I moved code around here:
commit 57bc7631e161a7bdcf7f68e1a46049dcb49c2256
Author: Ben Widawsky <ben@bwidawsk.net>
Date:   Thu May 23 11:09:55 2013 -0700

    lib/intel_mmio: Fix the fix

I accidently dropped the intel_gen() for the PCI id.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67289
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-07-27 15:30:41 -07: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