2535 Commits

Author SHA1 Message Date
Daniel Vetter
252d1151a8 tests/kms_sink_crc_basic: Put into righ Makefile target
If it's a simple test, it needs to be in the simple lists. Tests with
subtests go into the _M tests.

Without that test enumeration is all screwed up.

Cc: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-16 23:36:25 +02:00
Oscar Mateo
542c2b5ed5 tests/kms_flip: test a fb backed by a bo too big/small for its own good
This is a "review by igt test" for a bug located in
i915_gem_object_pin_to_display_plane and fixed by:

commit 392013bdd4b6128795e33c84bd6d6d3fd66ff0a3
Author: Oscar Mateo <oscar.mateo@intel.com>
Date:   Fri May 16 11:23:12 2014 +0100

    drm/i915: Gracefully handle obj not bound to GGTT in is_pin_display

    Otherwise, we do a NULL pointer dereference.

    I've seen this happen while handling an error in
    i915_gem_object_pin_to_display_plane():

    If i915_gem_object_set_cache_level() fails, we call is_pin_display()
    to handle the error. At this point, the object is still not pinned
    to GGTT and maybe not even bound, so we have to check before we
    dereference its GGTT vma.

    v2: Chris Wilson says restoring the old value is easier, but that
    is_pin_display is useful as a theory of operation. Take the solomonic
    decision: at least this way is_pin_display is a little more robust
    (until Chris can kill it off).

v2: Avoid code duplication by using igt_create_fb_with_bo_size() as
requested by Ville Syrjälä (original author of the "too big" test idea).

Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-16 17:45:14 +03:00
Oscar Mateo
5bdd4d9b5e lib/igt_fb: igt_create_fb_with_bo_size
Useful for testing bigger/smaller fb-wrapped buffer objects.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-16 17:45:14 +03:00
Rodrigo Vivi
ace8a9e10c tests/kms_sink_crc_basic: Basic test to verify Sink CRC debugfs.
v2: rebase after a long time.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-16 11:12:40 +02:00
Daniel Vetter
1c9a5b1a7b tests/pm_pc8 -> pm_rpm rename
Plus naming convention for runtime pm tests to have "rpm" somewhere in
their tests. Note that all the pc8-specific tests (for e.g. residency
or similar) already have pc8 in their subtest names, so we don't lose
any information here.

Cc: "Yang, Guang A" <guang.a.yang@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-16 10:33:28 +02:00
Daniel Vetter
7357639397 tests/pm_pc8: Use igt_assert_cmpint
More pretty!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-16 10:29:49 +02:00
Rodrigo Vivi
5e83f0444d tests/gem_bad_reloc: Adding missing include.
It was breaking compilation.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2014-05-15 14:16:25 -04:00
Daniel Vetter
6797ca8c75 tests/kms_render: don't loop through modes
We kinda have testdisplay for this ... and doing this tends to take
forever.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77709
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-15 16:36:08 +02:00
Daniel Vetter
943511a3ab tests/gem_reg_read: Fix errno check
So I accidentally fixed a check when converting to the new macros and
the kernel never returned -ENOENT for invalid regs. Adjust the test.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-15 14:25:47 +02:00
Daniel Vetter
6727de0c1a tests/kms_flip: nasty power management tests
These check whether everything is still ok wrt vblank handling after
runtime pm and system suspend-resume.

In addition to the usual checks they also ensure that the vblank frame
counter isn't totally ridiculous, something Keith complained about
aeons ago. With Ville's drm_vblank_on/off rework this should now be
fixed and solid.

v2:
- Ignore seq_step, vblanks completely immediately when the crtc goes off
- Only run system suspend/resume tests once.

Cc: Keith Packard <keithp@keithp.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-15 14:25:47 +02:00
Daniel Vetter
bd521b493e lib/igt_aux: Extract runtime pm helpers from pm_pc8
I want to use them elsewhere ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-15 14:25:47 +02:00
Tim Gore
1bee7e8b82 intel-gpu-tools: Skip kms_fence_pin_leak if no cairo
The kms_fence_pin_leak test uses igt_kms.c which in turn
uses cairo. So in Android.mk add this test to the skip list
if we dont have cairo

Issue: VIZ-3894
Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-15 14:47:35 +02:00
Chris Wilson
af1fbc427f igt/gem_ringfill: Only check for rendercopy when testing render ring
Overzealous test runner ftl.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78591
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-15 13:38:10 +01:00
Chris Wilson
ef51988ab2 igt/gem_bad_reloc: Restrict negative reloc tests to IVB+
The bug doesn't seem to occur on SNB, so we can skip the workaround and
hence we do not expect the kernel to prevent invalid relocated offsets.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-15 13:25:02 +01:00
Chris Wilson
465793bfd1 gem_exec_lut_handle: Do a warm up pass before timing
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-15 13:11:41 +01:00
Chris Wilson
efd5a571f4 gem_bad_reloc: Add subtest for LUT-based execbuffers
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-15 13:11:41 +01:00
Chris Wilson
daa9e3d80a Add gem_bad_reloc
This test feeds a batch containing self-references into the kernel and
checks that the relocation offsets remain as valid GTT addresses. This
is to exercise SNA passing in negative relocation deltas which can hang
the GPU if they wrap around.

References: https://bugs.freedesktop.org/show_bug.cgi?id=78533
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-15 08:47:21 +01:00
Daniel Vetter
62cd793c37 tests/kms_flip: Fix vblank ts check
Oops, fumbled that in the conversion.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 18:00:07 +02:00
Ville Syrjälä
78f79e4e95 tests/kms_fence_pin_leak: Exercise full ppgtt fence pin_count leak in the kernel
The kernel full ppgtt support has a bug where it can drop a pinned
fence to the floor, hence we leak the pin_count as the subsequent
fence unpin becomes a nop. We can trigger it easily by unbinding a
buffer from a ppgtt address space while the buffer is simultaneosly
being used for scanout.

Make the kernel leak the fence pin_count and trick it into picking
a new fence register for the next scanout buffer. Looping like
this for a while we leak the pin_count for all fence registers after
which the kernel can no longer find a new fence register when it needs
one. As a result we get back a SIGBUS from the GTT mmap access.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-14 19:16:49 +03:00
Daniel Vetter
831eb21197 lib/igt_core: Fixup docs with symbolic exit codes
Conflict between me and Thomas pushing patches in parallel.

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 15:34:00 +02:00
Thomas Wood
17eb062661 lib: add exit status defines
Add defines for success, skip and timeout exit statuses.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-05-14 12:33:02 +01:00
Thomas Wood
c03d58595e lib: set a timeout when reading crc values
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
2014-05-14 12:33:02 +01:00
Thomas Wood
d8e5313a27 lib: add igt_set_timeout
Add a function to stop and fail a test after the specified number of
seconds have elapsed.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
2014-05-14 12:33:01 +01:00
Daniel Vetter
5597a1f418 tests/kms_flip: Use asserts
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 11:52:35 +02:00
Daniel Vetter
0b3407f528 tests/prime_nv_pcopy: Remove unused tiling tests
We now know that the hardware can't do this, and it's not designed to.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 11:41:55 +02:00
Daniel Vetter
ee90a4a0dc tests/prime_nv_pcopy: Drop return values from tests
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 11:39:31 +02:00
Daniel Vetter
a7294e0c22 tests/prime_nv_pcopy: Drop return values from copy/check functions
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 11:31:31 +02:00
Daniel Vetter
8710e302a4 tests/prime_nv_pcopy: Use asserts in setup code
Now we even have more fine-grained checking and only skip if the
nouveau card isn't supported, but fail properly if something else goes
wrong.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 10:57:46 +02:00
Daniel Vetter
782cda17b9 tests/prime_nv_pcopy: Use asserts in nv_bo_alloc
Step one to untangle the control flow in this test and replace it all
with igt assert magic.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 10:49:40 +02:00
Daniel Vetter
d502ae6f77 tests/prime_nv_api: Use asserts instead of control flow
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 10:44:16 +02:00
Daniel Vetter
722b25a303 tests/gem_seqno_wrap: Replace control flow with asserts
Only tricky bit was a bit of debug output sprinkled all over, I've
moved it all to cmp_bo.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 10:09:25 +02:00
Daniel Vetter
0b7ce4ac29 tests: Use igt macros more
Often just folding together of the common if (cond) printf;
abort|igt_skip|igt_fail; pattern. But in a few cases I've ripped out
more since the igt macros will already print the condition and errno.

A few tests where more work (like ripping out return codes en masse)
is needed left as-is.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 09:56:53 +02: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
Imre Deak
351e7d3950 pm_pc8: add system-suspend subtest
Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-05-13 16:26:26 +03:00
Ville Syrjälä
4e4ff4c1d1 tests/kms_fbc_crc: Use igt_create_color_fb()
No need to hand roll the alloc fb+paint code anymore, just use the
common helper.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-13 15:14:21 +03:00
Ville Syrjälä
abc262bf47 tests/kms_fbc_crc: Reset display state between subtests
If a subtest fails it'll leave the display in a state that may prevent
the next subtest from working. So reset the display state between
subtests.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-13 15:14:21 +03:00
Ville Syrjälä
54f8f5d13e tests/kms_fbc_crc: Switch to using the igt_display stuff
Let's try to use the common igt_display framework to make the code a bit
nicer.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-13 15:14:21 +03:00
Ville Syrjälä
d2d0a96eca tests/kms_fbc_crc: Simplify pipe_crc mess
There's no need to keep an array of pipe_crc objects around. Just keep
one for the duration of the specific crtc/connector/test combo.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-13 15:14:21 +03:00
Daniel Vetter
126b8ba72f lib/igt_core: Fix type on igt_log doc
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-13 12:28:26 +02:00
Daniel Vetter
1503d17cc5 lib/igt_core: Document testrunner interface a bit
Also fix up one gtkdoc fumble in igt_fb. We should use symbolic
defines if possible instead of just listening the magic 0, 77, 78
values for exit codes, but that's a separate patch.

Cc: tim.gore@intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-13 11:29:34 +02:00
Tim Gore
0be29daac1 intel-gpu-tools: Move igt tests to intel validation area
Currently when IGT is built for Android the resulting test
executables go to /system/bin, which is not ideal. After
discussion with the core validation team i have moved them
to /system/vendor/intel/validation/core/igt by setting
LOCAL_MODULE_PATH.

I have also added a --defsym linker option to export a
symbol that allows a script to easily distinguish between
tests that have subtests and those that dont. There are
better ways to do this (viz, in the source code) but
because the igt tests are not written consistently this
would require many more changes.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-13 11:15:53 +02:00
Daniel Vetter
bd7f9ab2ce NEWS: Android has libcairo support now!
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-13 11:12:34 +02:00
Tim Gore
41cbe36bba intel-gpu-tools: Build tests needing cairo if ANDROID_HAS_CAIRO=1
Until now the tests that depended on libcairo were simply
skipped in the android build. Now that I have a cairo port
working, build these cairo dependent tests if ANDROID_HAS_CAIRO
is set to 1 in the environment.
For information on building cairo for IGT on Android see the
wiki at:

https://securewiki.ith.intel.com/display/GFXCore/IGT+Test+Suite+on+Android

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-12 18:56:31 +02:00
Brad Volkin
0fee90b56d tests/gen7_forcewake_mt: Don't set the GGTT bit in SRM command
The command parser in newer kernels will reject it and setting this
bit is not required for the actual test case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76670
Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-12 18:49:58 +02:00
Imre Deak
63746417e2 testdisplay: fix restoring termio at exit
At normal exit in test_all_modes we don't restore the original termio,
since g_io_channel_shutdown() closes the stdin fd and so the following
tcsetattr on stdin will fail. We also don't restore the termio at signal
exit. Fix both cases by installing an exit hanlder with a dup'ed stdin fd.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-05-12 13:36:40 +03:00
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