919 Commits

Author SHA1 Message Date
Daniel Vetter
64cfe4eefe lib/drmtest: Improve printf-like igt_skip_on/require
Ben Widawsky suggested to use vasprintf, which perfectly fits the bill.

Also fix the logic conversion bug in tests/gem_storedw_batches_loop that
crept in again :(

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-19 19:56:03 +02:00
Daniel Vetter
e5cdd62624 lib/drmtest: igt_assert|require with format strings
v2: Add a comment about the pitfalls around va_list handling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-19 19:40:32 +02:00
Daniel Vetter
b352512953 tests/gem_stored_batches_loop: use igt_assert more
Terser code ftw!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-19 15:51:33 +02:00
Daniel Vetter
867b1a51a6 tests/gem_reloc_overflow: New subtest for overflowing buffer_count
Luckily everything seems to be fine.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-19 11:01:14 +02:00
Daniel Vetter
bf6f166035 tests/gem_reloc_overflow: Extract reloc_tests
I'll be adding more stuff soon ;-)

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-19 10:20:46 +02:00
Daniel Vetter
0a587e24b7 tests/gem_storedw_batches_loop: Add testcase to check secure dispatch
v2: Use the mrb_exec function since otherwise we can't pass flags.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-18 18:37:10 +02:00
Daniel Vetter
195f04c300 tests/gem_persistent_relocs: Tune down the test a bit
Takes too long.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-17 00:13:47 +02:00
Daniel Vetter
31139f6b8f tests/gem_fenced_exec_thrash: Add interruptible and busy-load subtests
Usual progression for gem tests up the nasty-scale.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-17 00:13:47 +02:00
Daniel Vetter
7b3634364a tests/gem_fenced_exec_thrash: New subtests that uses all fences
igt runs under the assumption that nothing else (besides maybe fbcon)
is using the gpu. So we should be able to use all fences.

Keep the conservative testcase around though in case someone has a
broken setup.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-17 00:13:47 +02:00
Daniel Vetter
14e12b8008 tests/*: scrap get_num_fences
Just use gem_available_fences directly.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-17 00:13:47 +02:00
Daniel Vetter
9298dfabd9 lib: add test for igt_fork_signal_helper
If we're really fast we've trying to stop the signal helper again
we somehow race somewhere and it'll never happen. So add a testcase for
this. Since I expect more to come for testsuite tests add a separate
make target for them. Run tests with

$ make check

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-13 16:48:08 +02:00
Daniel Vetter
1978aecf1d tests/gem_persisten_relocs: Update like gem_reloc_vs_pug
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11 14:03:47 +02:00
Daniel Vetter
5dc424f70d tests/gem_reloc_vs_gpu: some fixes
- Clear the igt_helper_process struct to avoid hitting asserts.
- Fix up the logic for enumerating forked processes.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11 13:59:18 +02:00
Daniel Vetter
7c25e8cff1 tests/gem_reloc_vs_gpu: use igt_fork_helper
Now we do a waitpid instead of a simple wait which could eat
the "wrong" child ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-10 17:40:06 +02:00
Daniel Vetter
b3dadedd2e tests/gem_reloc_overflow: Add more checks
For reloc offsets and batch start/len. Doesn't quite fit into the test
subject at hand here, but meh.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04 15:27:14 +02:00
Daniel Vetter
44d4a3defb tests/gem_reloc_overflow: convert to subtests
More will come!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04 15:27:14 +02:00
Daniel Vetter
3c46789c8d tests/gem_exec_bad_domains: enable conflicting write domains test
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04 15:27:14 +02:00
Daniel Vetter
52221651ab tests/gem_pipe_control_store_loop: Add subtest for reused buffers
This exercises the slightly faulty kernel w/a that Eric fixed in

commit e844b990b1df9242bb91b7d490552f3198946838
Author: Eric Anholt <eric@anholt.net>
Date:   Tue Jul 31 15:35:01 2012 -0700

    drm/i915: Don't forget to apply SNB PIPE_CONTROL GTT workaround.

    If a buffer that was the target of a PIPE_CONTROL from userland was a
    reused one that hadn't been evicted which had not previously had this
    workaround applied, then the early return for a correct
    presumed_offset in this function meant we would not bind it into the
    GTT and the write would land somewhere else.

    Fixes reproducible failures with GL_EXT_timer_query usage in apitrace,
    and I also expect it to fix the intermittent OQ issues on snb that
    danvet's been working on.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48019
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52932
    Signed-off-by: Eric Anholt <eric@anholt.net>
    Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
    Reviewed-by: Carl Worth <cworth@cworth.org>
    Tested-by: Carl Worth <cworth@cworth.org>
    Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04 14:08:10 +02:00
Daniel Vetter
0550092c9a tests: add missing igt_exit() calls
Forgotten while converting to subtests, then copy&pasted.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04 13:25:28 +02:00
Daniel Vetter
1f9d201be4 tests: Update .gitignore
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04 10:36:28 +02:00
Daniel Vetter
87c690f9e2 tests: add gem_persisten_relocs
This reproduces the 3.7 relocation regression ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04 10:30:21 +02:00
Ben Widawsky
a3276e9713 gem_vmap_blits: Demote warning to note
The warning that vmap isn't supported is useful, but it shouldn't get in
the way of developers (or distros) being able to use -Werror.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-09-03 15:31:14 -07:00
Daniel Vetter
7db283f930 tests/gem_reloc_vs_gpu: add thrashing tests
Using the i915_gem_drop_caches debugfs interface to thrash without
really thrashing.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 17:51:05 +02:00
Daniel Vetter
2c7166eb7a tests/gem_reloc_vs_gpu: add forked versions
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 15:19:30 +02:00
Daniel Vetter
e45b7d9474 tests/gem_reloc_vs_gpu: Add faulting reloc tests
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 10:59:13 +02:00
Daniel Vetter
225a91bc54 lib/drmtest: include sys/mman.h from drmtest.h
We need it for mmapping to get at PROT_READ|WRITE anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 10:38:29 +02:00
Daniel Vetter
9cc16e8afd lib/drmtest: extract gem_execbuf helper
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 10:37:14 +02:00
Daniel Vetter
bd59d60275 tests/gem_reloc_vs_gpu: add interruptible version
Exercise a bug where we've failed to propagate the error code
correctly.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03 08:58:20 +02:00
Chris Wilson
472c9dac03 kms_flip: Fix use of fb_width for PAN subtests
We need to be careful to remember that fb-width is not always the same
as hdisplay, since for panning we allocate a larger framebuffer. So fix
up the printfs to use hdisplay/vsisplay since that should be uniform
across the array.

Regression from
commit 919d68901187fa797a9b648fcf87c838fae22fa3
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Thu Aug 29 15:33:53 2013 +0100

    kms_flips: Operate on an array of crtc

Buzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68832
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-09-02 13:53:29 +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
859159a272 tests/gem_tiled_swapping: fix igt_require conversion
I seem to be incompetent at logic ...

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68831
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-02 07:51:24 +02:00
Daniel Vetter
f73724c362 tests/gem_mmap_gtt: fix access checks
Reading manpages advisable ;-)

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-30 08:15:32 +02:00
Daniel Vetter
694bd81ed6 tests/gem_mmap_gtt: clarify access check checks a bit
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-30 08:13:05 +02:00
Daniel Vetter
8f5d541620 tests/gem_evict_everything: add swapping and forked subtests
Much better at hitting the list corruption here on my machines
than what we have thus far.

Note that somehow I just can't reproduce the bug any more. No idea
why. But I guess it's time to simply push this pile out.

v2: Limit threads and rounds to something reasonable.

v3: Use igt_permute_array to avoid EINVAL due to duplicated bo.

v4:
- Add a variant of the forked tests with multiple drm fds.
- Tune the swapped forked tests a bit to complete in a reasonable
  amount of time.

v5: Add some memory pressure from the cpu by using cpu mmaps (which
directly hit shmem, so bypass gem completely).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-29 21:44:28 +02:00
Daniel Vetter
5fe116e913 tests/gem_evict_*: Fix leak in copy
This turned out to be the reason one one of my tests was hitting
the list corruption bug - we need a good deal more memory pressure.
So I'll now add a new testcase for that.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-29 18:18:33 +02:00
Daniel Vetter
fa06b0bce3 tests/gem_tiled_swapping: Use igt_require
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-29 18:18:33 +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
Chris Wilson
90a25055e3 kms_flip: Remove debugging leftovers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 18:04:11 +01:00
Chris Wilson
a60f930018 kms_flip: Set everything to zero to disable a CRTC
Just setting fb=0 is not enough as the kernel thinks userspace is
insane.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 18:04:11 +01:00
Chris Wilson
93550043ca kms_flip: Use the first mode if we find no matching modes for the crtc pair
We will check that we can set the mode on both crtcs before use, so
hopefully this will work...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 17:41:01 +01:00
Chris Wilson
865b7821e3 kms_flip: Hook up primary events for page-flips
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 17:41:01 +01:00
Chris Wilson
1f2b3e99f9 kms_flip: Run on pairs of connected outputs.
The goal is to flip the same framebuffer on a pair of CRTCs (clone mode)
and check that (a) the flip works in all combinations of workloads, and
(b) that we can hit the desired refresh rate under the simplest, most
ideal of conditions.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 16:19:41 +01:00
Chris Wilson
919d689011 kms_flips: Operate on an array of crtc
This should be no functional change as we operate on an array of
crtc[1]. Later we shall test clone mode across a number of crtc.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 16:19:41 +01:00
Chris Wilson
d0ed912107 kms_flip: Exercise flip-vs-render
For machine with split BCS/RCS rings, we also need to test whether we
correctly wait upon outstanding render work before flipping and changing
modes. This should also serve to exercise the ring selection code for
flips.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2013-08-29 16:19:41 +01: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
cf93ba45b0 tests/gem_mmap_gtt: Add testcase for the vma access manager
Currently fails since the patches aren't merged yet.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-26 19:44:31 +02:00
Daniel Vetter
c2c0efc21a tests/gem_mmap: Convert to subtests
I wanted to write a testcase for gtt mmap access restriction checking
and only noticed after conversion to subtests that this here is for
cpu mmaps ;-)

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-26 19:44:31 +02:00
Imre Deak
86f60ee593 tests/kms_setmode: don't save/restore vt graphics for dry-run
Signed-off-by: Imre Deak <imre.deak@intel.com>
2013-08-26 17:20:29 +03:00
Daniel Vetter
09d9089ead tests/gem_evict_*: Add interruptible modes
Also I've stumbled over igt_fixture again. Somehow gcc loves to wreak
havoc with stack variables set up in igt_fixtures ... Duct-tape in the
form of moving fd out to global scope applied.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-23 22:32:29 +02:00
Daniel Vetter
fd88db77cc tests/sysfs_rps: Fix igt_require conversion
Another fumble caught by QA.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68461
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-23 09:30:47 +02:00