1471 Commits

Author SHA1 Message Date
Ville Syrjälä
d848a36545 tests/kms_fbc_crc: Check context support earlier
Check for context support before doing anything else in the subtest.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-09 21:03:46 +03:00
Ville Syrjälä
f85fff0de6 tests/kms_fbc_crc: Allow the subtests to pass even if some planes aren't FBC capable
Don't skip the entire subtest if FBC only works on some of the primary
planes, as is the case on pre-gen4 and hsw+. Only skip the entire subtest
if all crtc/connector combinations skip.

Also print some kind of status for all otherwise valid crtc/connector combos
if they skip due to FBC being disabled or CRC support not being there.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-09 21:03:09 +03:00
Chris Wilson
66d5f092d4 igt/gem_render_tiled_blits: Speed up by using the GPU to detile
Avoid accessing via the slow GTT to read back and compare the contents
of each bo against expected results. It is much faster, on llc at least,
to detile using the GPU and then copy to system memory for the compare.

Before:

IVB: time sudo ./gem_render_tiled_blits
IGT-Version: 1.6-ge46ff3f (x86_64) (Linux: 3.15.0-rc3+ x86_64)
Using 3072 1MiB buffers
Verifying initialisation...
Cyclic blits, forward...
Cyclic blits, backward...
Random blits...

real	6m26.005s
user	6m19.234s
sys	0m2.414s

PNV: time sudo ./gem_render_tiled_blits
IGT-Version: 1.6-g8556f8a (i686) (Linux: 3.15.0-rc2+ i686)
Using 768 1MiB buffers
Verifying initialisation...
Cyclic blits, forward...
Cyclic blits, backward...
Random blits...

real	1m45.431s
user	1m34.960s
sys	0m4.624s

Using pread:

IVB: time sudo ./gem_render_tiled_blits
IGT-Version: 1.6-ge46ff3f (x86_64) (Linux: 3.15.0-rc3+ x86_64)
Using 3072 1MiB buffers
Verifying initialisation...
Cyclic blits, forward...
Cyclic blits, backward...
Random blits...

real	0m14.717s
user	0m3.699s
sys	0m3.192s

Using snoop:

IVB: time sudo ./gem_render_tiled_blits
IGT-Version: 1.6-ge46ff3f (x86_64) (Linux: 3.15.0-rc3+ x86_64)
Using 3072 1MiB buffers
Using a snoop linear buffer for comparisons
Verifying initialisation...
Cyclic blits, forward...
Cyclic blits, backward...
Random blits...

real	0m13.774s
user	0m3.900s
sys	0m2.089s

PNV: time sudo ./gem_render_tiled_blits
IGT-Version: 1.6-g8556f8a (i686) (Linux: 3.15.0-rc2+ i686)
Using 768 1MiB buffers
Using a snoop linear buffer for comparisons
Verifying initialisation...
Cyclic blits, forward...
Cyclic blits, backward...
Random blits...

real	0m20.831s
user	0m4.384s
sys	0m5.032s

So roughly 10-30x faster depending on platform.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78244
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-08 12:24:09 +01:00
Chris Wilson
e46ff3f8c2 igt/gem_lut_handle: Fix errno checking
Regression from
commit c1404e05b7477122b9923ba029593c2cb64671a7
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Apr 29 07:14:33 2014 +0100

    errno is reset after each syscall

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-08 10:05:37 +01:00
Mika Kuoppala
8741c2289f tests/gem_flink_race,prime_self_import: fix object counts
We need to add one drm_open_any() before getting the object counts
as first call to drm_open_any() allocates file descriptors for
exit handlers and thus is not symmetrical.

The regression, assymmetric behaviour, was introduced in:

commit 2f2c491cf3167befe7c79e4b17afb4f6284dfc84
Author: Mika Kuoppala <mika.kuoppala@intel.com>
Date:   Fri Mar 28 10:52:46 2014 +0200

    lib/drmtest: don't dup quiescent fd

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77867
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77875
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-05-07 17:31:40 +03:00
Chris Wilson
4bd9fe6e34 gem_alive: A utility to see if the driver or GPU has hung 2014-05-05 11:09:30 +01:00
Daniel Vetter
b38b8a59a8 tests/pm_pc8: subtests for runtime pm for dpms
Very basic since I lack a bit ideas. After all with the latest
patches runtime pm doesn't make much a difference between dpms off
and disabling the outputs completely with SetCrtc.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-30 18:07:58 +02:00
Daniel Vetter
29ee36f259 lib: extract kmstest_set_connector_dpms
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-30 18:07:58 +02:00
Daniel Vetter
066ad35ee7 tests: Fix make depencies for test list
Oops, pretty bad ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-30 18:05:21 +02:00
Chris Wilson
c1404e05b7 errno is reset after each syscall
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78055
Bugilla: https://bugs.freedesktop.org/show_bug.cgi?id=78053
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-29 07:17:30 +01:00
Ville Syrjälä
fa86e33ccc tests/gem_stress: Fix rendercopy vs. keep_gpu_busy on gen6+
If the hardware has a blt ring blits aren't allowed on the render ring.
Trying to execute blits on the render ring results in a GPU hang.

Flush outstanding blits from keep_gpu_busy() before calling rendercopy()
so that they don't end up on the render ring.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-28 19:28:39 +03:00
Daniel Vetter
6abfe2f0db tests/gem_exec_params: One more invalid ring tests
With the vebox 2 patches the number of internal rings don't match the
number of exposed rings. So add another subtest with an invalid ring
which should be invalid both internally and externally. The bug this
will catch is using the ring structure before validation, which the
old "invalide-ring" wont be able to due to the internal vebox2 ring.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-28 15:26:15 +02:00
Imre Deak
a595a40078 tests/pm_pc8: skip the test if runtime PM is disabled
The PC8 state won't be entered unless runtime PM is enabled, so support
for PC8 residency counters alone is not enough to run this test.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-25 20:14:30 +03:00
Daniel Vetter
e36c896a71 test: Fixup for the previous patch
Oops, failed to git add.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-25 17:57:22 +02:00
Daniel Vetter
1b55886c4b test/gem_userptr_*: Fix compile fail
Also shut up warnings. Those revealed incorrect usage of local
variables in conjunction with igt_fixture/igt_subtest. Since those use
longjmps we need to move the out of the stackframe those magic blocks
are declared in.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-25 17:54:08 +02:00
Tvrtko Ursulin
a3e97ddcbf tests/gem_vmap_blits: Remove obsolete test case
No need for the old test case once the new one was added.

v2:
   * Just rebase for lib/ reorganization.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-25 17:48:45 +02:00
Tvrtko Ursulin
863c0730f3 tests/gem_userptr_blits: Expanded userptr test cases
A set of userptr test cases to support the new feature.

For the eviction and swapping stress testing I have extracted
some common behaviour from gem_evict_everything and made both
test cases use it to avoid duplicating the code.

Both unsynchronized and synchronized userptr objects are
tested but the latter set of tests will be skipped if kernel
is compiled without MMU_NOTIFIERS.

Also, with 32-bit userspace swapping tests are skipped if
the system has a lot more RAM than process address space.
Forking swapping tests are not skipped since they can still
trigger swapping by cumulative effect.

v2:
   * Fixed dmabuf test.
   * Added test for rejecting read-only.
   * Fixed ioctl detection for latest kernel patch.

v3:
   * Use ALIGN macro.
   * Catchup with big lib/ reorganization.
   * Fixed up some warnings.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-25 17:48:41 +02:00
Ville Syrjälä
a461515b33 kms_cursor_crc: Fix the test on platforms where the pipe->port mapping has restrictions
On gen2 for instance the LVDS port can only be fed from pipe B. Check
whether the combinations is valid before trying to run the test. Also
clean up the state back to PIPE_ANY properly so that following tests
can again go through all the combinations.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75131
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:20 +03:00
Ville Syrjälä
5b90833941 kms_cursor_crc: Wrap igt_require() in igt_fixture
igt_require() must be within a fixture or subtest.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:19 +03:00
Ville Syrjälä
f688a56ee8 kms_cursor_crc: Replace snprintf()+%s with just %d
There's no point in first printing the int to temp string using %d
and then printing that out with %s. Just stick the %d into the final
string.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:19 +03:00
Ville Syrjälä
fb2ccb1ade kms_cursor_crc: Allow the test to run without cursor cap support
Assume that only 64x64 cursor size is supported if the cursor size caps
aren't supported by the kernel. This allows the test to run on older
kernels.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:19 +03:00
Ville Syrjälä
f8e5a3fc7e kms_cursor_crc: Wrap cursor fb creating into igt_fixture
We don't want to attempt creating the cursor fb when enumerating
subtests. So wrap it into igt_fixture. Also destroy the cursor
fb after the tests.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:19 +03:00
Ville Syrjälä
f6e869732c kms_cursor_crc: Simplify the pipe_crc mess
Instead of allocating an array of igt_pipe_ctc_t objects, just allocate
one and stick it into test_data.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
aaef7ad376 kms_cursor_crc: Add background picture
This gives the cursor something to be on, instead of just a black
background. Slows the test down only one second over six minutes.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
fafcff90a8 kms_cursor_crc: Add random cursor placement test
Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
470e5ce6c3 kms_cursor_crc: Add moving cursor test
Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
795eddc639 kms_cursor_crc: Add reference software rendering
This patch first render the cursor with hardware rendering and
then with software, acquiring the CRC in both cases so they can be
properly compared. Say goodbye to crc_must_match variable.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
ead0173c4d kms_cursor_crc: Separate onscreen and offscreen tests
Also remove onscreen boolean from parameter list. All test-related
data should be put into test_data from now.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
fe8041b8f9 kms_cursor_crc: Use a function pointer to call test
More tests are coming, and this allows us to not repeat the boilerplate
code in run_test() for each subtest.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:18:19 +03:00
Antti Koskipaa
7ec631c242 kms_cursor_crc: Move cursor enable and disable calls where they belong
We can't have the hw cursor enabled during software render tests.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
[vsyrjala: collect the crc before disalbing the cursor]
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-25 16:18:15 +03:00
Antti Koskipaa
a593d613f9 kms_cursor_crc: Remove some test cases and change cursor to color
Currently this test is quite useless, since it only checks for valid CRCs when
the correct output from a test is a completely black screen (invisible or visible
but black cursor, or cursor is offscreen) and disables the check when anything
visible is onscreen.

This patch changes the cursor to a colorful one and removes the test cases
that become redundant because of this change. The cursor is designed to be
asymmetrical such that future tests involving rotation, mirroring, etc. produce
different CRCs and failures can be detected.

This (temporarily) disables CRC testing until the next patch which will add
software rendering of the cursor and the CRC generation.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
2014-04-25 16:16:38 +03:00
Tvrtko Ursulin
e32664c8ee tests: Skip building kms_flip_tiling on Android
Dependencies are not available at the moment so it does not build.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-04-24 13:49:17 +01:00
Daniel Vetter
1639022aa8 tests/gem_exec_params: Fix rel-constants-invalid subtest
Reported by Ville and Zhao Yakui.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-24 10:46:32 +02:00
Zhao Yakui
5a8c06464e tests/gem_dummy_reloc_loop: Add one subtest based on multi drm_fd to test CPU<->GPU sync under multi BSD rings
The Broadwell GT3 machine has two independent BSD rings in kernel driver while
it is transparent to the user-space driver. In such case it needs to check
the CPU<->GPU sync for the second BSD ring.

V1->V2: Follow Daniel's comment to add one subtext instead of one individual
test case, which is used to test the CPU<->GPU sync under multi BSD rings.

V2->V3: Follow Imre's comment to remove the unnecessary initialization and
use igt_assert_f instead of igt_assert

Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-24 11:32:07 +02:00
Zhao Yakui
ae8e646127 tests: Add one ring sync case based on multi drm_fd to test ring semaphore sync under multi BSD rings
The Broadwell GT3 machine has two independent BSD rings in kernel driver while
it is transparent to the user-space driver. In such case it needs to check
the ring sync between the two BSD rings. At the same time it also needs to
check the sync among the second BSD ring and the other rings.

V2->V3: Follow Imre's comment to remove the unnecessary initialization and
use igt_assert_f instead of igt_assert.

V3->V4: Add gem_multi_bsd_sync_loop.c into the tests/.gitignore

Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-24 11:32:07 +02:00
Daniel Vetter
cd3850e28e tests: Add gem_exec_params
This fills all the gaps we've had in our execbuf testing. Overflow
testing of the various arrays is already done by gem_reloc_overflow.

Also add kms_flip_tiling to .gitignore.

This will cause a bunch of failures since current kernels don't catch
all fallout.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-24 07:55:46 +02:00
Chris Wilson
4e93890377 Add gem_render_copy_redux
This is an "advanced" form of the the simple gem_render_copy test.
Instead of aiming for maximal simplicity to aide debugging of new
rendercopy backends, this test aims to exercise the execbuf interface
using the render ring.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-24 08:06:26 +01:00
Ville Syrjälä
43c2ed758f tests: Compile all the tests
A bunch of the tests aren't being built due to a missing '\'. Fix it.

The problem was introduced here:
 commit ddf8cc107e3b78e4c8200b083ed298c24eec1f03
 Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
 Date:   Wed Apr 2 15:31:38 2014 +0300

    test: Add test for checking if page flip changes tiling

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-14 16:25:28 +03:00
Daniel Vetter
4fbd49beb9 tests/kms_flip_tiling: Fixes
- Wrap up testcase correctly into the magic code block.
- Put local variables out of the longjmp danger zone.

Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-14 09:37:53 +02:00
Ander Conselvan de Oliveira
ddf8cc107e test: Add test for checking if page flip changes tiling
Test that a page flip from a tiled buffer to a linear one works
correctly. First, it sets the crtc with the linear buffer andr
generate a reference crc for the pipe. Then, the crtc is set with
the tiled one and page flip to the linear one issued. A new crc is
generated and compared to the rerence one.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
2014-04-14 09:37:53 +02:00
Daniel Vetter
cc730c418f lib/kmstest: Fix up tiled buffer creation
When extracting a raw __gem_set_tiling helper I've fumbled this in

commit 590f6101402b51bca54f69c002380bda967484ea
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Oct 9 20:50:50 2013 +0200

    lib/drmtest: extract rawer __gem_set_tiling

Fix things up so that we properly propaget the error again.

Now to make this all properly work we also need to make kms_flip a
notch more robust against such failures ...

This only blows up on gen2/3 with the pan tests which want a too wide
framebuffer for tiling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-13 19:08:17 +02:00
Mika Kuoppala
99b8f80701 tests/gem_reset_stats: fix length check in inject_hang
To avoid writing past the batch end.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-04-10 17:53:08 +03:00
Mika Kuoppala
53ad1e4a70 tests/gem_reset_stats: check gpu state before each subtest
Some tests, namely the close pending variety, tries to
carefully drop all handles to gpu when hang is intruduced,
to expose bugs in reset handling without any clients.

Add guards after and before tests to really know if
the gpu is still alive as the particular test might
report success and then gpu dies few seconds after.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-04-10 17:50:49 +03:00
Mika Kuoppala
d983a47f14 tests: use lib igt_[get|set]_stop_rings()
on gem_reset_stats, kms_flip and pm_rps.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75876
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-04-10 17:50:43 +03:00
Mika Kuoppala
1c7ca57e53 tests/gem_reset_stats: end hanging batch properly
As we use chained batch into itself to hang the gpu, there
was no need to end the batchbuffer with BATCH_BUFFER_END.

With the introduction of command parser, the batch
need to have proper BATCH_BUFFER_END in it or it
will be rejected.

While at it, shift the upper half of batch gtt_offset
accordingly with gen8+

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-04-10 17:24:38 +03:00
Brad Volkin
f74c443925 tests/gem_exec_parse: Test for OACONTROL tracking
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-09 14:25:17 +02:00
Chris Wilson
9eec5b0f11 gem_tiled_swapping: Test using all available fences
Use extra threads to cause extra memory pressure and stress upon the
relevant code. Limit the number of threads to available fences to avoid
falling off the fence cliff.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-07 13:12:29 +01:00
Chris Wilson
ff7806e52c gem_tiled_swapping: Purge all page/swap caches first
Reset the system to a vanilla state before we query how much RAM/swap
space is available for our testing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-04-07 13:12:29 +01:00
Paulo Zanoni
1fd9fc0012 tests/pm_pc8: skip tests when no screens are connected
Instead of failing, just skip the tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73642
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-04-04 13:32:30 -03:00
Paulo Zanoni
abba92d9cf tests/pm_pc8: add missing newline
Otherwise the output will get even more confusing.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-04-04 13:31:49 -03:00