1471 Commits

Author SHA1 Message Date
Ville Syrjälä
eda904c9d7 tests: Add kms_flip_event_leak test
kms_flip_event_leak will issue a page flip and close the file
descriptor before the flip has finished. This may cause the kernel
to leak the page flip event. The test itself won't actually fail but
if the kernel notices the leak and WARNs piglit will report a failure.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-08-11 19:12:52 +03:00
Paulo Zanoni
5a06d361b5 tests/pm_rpm: refactor the modesetting code
Refactor the code so the params for the modesets are always stored and
don't have to be recomputed every time. With this, we can get rid of
our FB caching structures, and we now also allow the subtests that do
special modesets to reuse the parameters used on the default modesets,
just changing whatever they want.

The biggest win here is that the test case subfunctions get smaller
and simpler to read and write.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-08 17:02:43 -03:00
Paulo Zanoni
5a978121d3 tests/pm_rpm: add disable_or_dpms_all_screens()
And its and_wait() version. The goal is to extract common code
patterns into functions/macros, so the code for the test cases gets
easier to read and write.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-08 17:02:39 -03:00
Paulo Zanoni
1892059842 tests/pm_rpm: add macros to disable/enable screens and wait
This should make the test case functions better to read and write.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-08 17:02:34 -03:00
Paulo Zanoni
f6ffa3ca7f tests/pm_rpm: add wait_for_suspended() calls to test_one_plane
Make sure we do all operations while really runtime suspended, so we
can actually test things.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-08 17:02:29 -03:00
Paulo Zanoni
a17f0604ef tests/pm_rpm: add subtests for fences
Daniel thought fences were not surviving runtime PM on DPMS, so we
wrote this test to check. The good news is that the test passed, so
there's no need for a Kernel patch, at least on the Kernel I tested.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-07 15:44:28 -03:00
Paulo Zanoni
d52365677e igt_kms: add kmstest_unset_all_crtcs()
Both pm_rpm.c and pm_lpsp.c call it "disable_all_screens", but let's
give it a name that better describes what the implementation does.

v2: Rename to kmstest_unset_all_crtcs (Daniel).

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-07 15:44:06 -03:00
Paulo Zanoni
da458758e7 tests/pm_rpm: use kmstest_get_property()
So we can reduce the code size.

v2: Rebase after the rename to kmstest_get_property.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-07 15:43:00 -03:00
Paulo Zanoni
bfb5a75775 tests/pm_rpm: add subtests for planes and cursors
These tests should trigger WARNs on Kernels that don't have the most
recent fixes.

v2: - Merge both the cursor and planes patches into one so it's easier
      to update them.
    - Extend the tests a little bit to exercise fences.
    - Fix bug found by Matt to enable the test to run on older Kernels

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-07 15:40:28 -03:00
Thomas Wood
ff6b068ecd testdisplay: ignore invalid subtest options
testdisplay does not have any subtests and should therefore exit with
the appropriate exit code if the --list-subtests or --run-subtest
options are used.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-31 16:30:01 +01:00
Thomas Wood
9b500dbf6b Update .gitignore files
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-30 11:16:09 +01:00
Thomas Wood
8fc4107c91 testdisplay: set a non-zero exit code if getopt detected an error
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-30 11:13:13 +01:00
Daniel Vetter
21e9422b01 tests/gem_ringfill: add interruptible mode
Should be useful to test intel_ring_begin restart behaviour a bit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-29 18:46:09 +02:00
Damien Lespiau
660a7ffdba testdisplay: Destroy the cairo context once the fb is painted
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Chris Wilson
e48c495572 igt/pm_rps: Fix assertion in load_helper_stop
The load_helper isn't killed by the signal, but it exits gracefully. So
update the assertion to check for the successful exit.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-27 15:39:58 +01:00
Thomas Wood
8408e00e62 testdisplay: only set terminal attributes when in foreground process group
The Piglit test runner for intel-gpu-tools creates a new process group
for the test processes, so attempting to set terminal attributes causes
the process to receive SIGTTOU and be stopped. Since the test is not run
interactively in this case, the issue can be avoided by not setting
terminal attributes if the process is not in the foreground process
group.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-25 14:46:51 +01:00
Tim Gore
72b1263649 intel-gpu-tools: add sys/wait.h to pm_rps.c
commit 745945546f7366a413a3a51a37f90caa3a227b1d
breaks the build under Android because some of the
macros used in pm_rps.c are defined in sys/wait.h
which is not included.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-25 09:36:10 +02:00
Chris Wilson
745945546f igt_core: Refactor igt_stop_helper() to use igt_wait_helper()
Reduce code duplication as the igt_stop_helper can reuse
igt_wait_helper() to replace its own waiting routine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-24 11:52:37 +01:00
Tvrtko Ursulin
8b3ded404c igt/gem_userptr_blits: Fix multi-threaded mm stress tester
Two parts to the fix:
  1. Do not use pthread_cancel since not available on Android.
  2. Do not assert in the thread since that does not get propagated
     to the process. Rather pass out any failures so we know test
     did not work as expected.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Tim Gore <tim.gore@intel.com>
Reviewed-by: Tim Gore <tim.gore@intel.com>
2014-07-24 09:31:31 +01:00
Tvrtko Ursulin
700bdf1401 igt/gem_userptr_blits: Fix forked access test
copy() blit helper assumes a certain object size much larger than a page size.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-24 08:46:38 +01:00
Daniel Vetter
3efcb8c8ee tests/pm_rpm: Convert to new optparsing
Thomas missed the add-hoc parameter parsing in here, which did break
things for Paulo since the core now fails for unknown options.

Convert them over to the new infrastructure, which has the nice upside
that we can remove the comments and put them into the usage available
with --help.

Cc: Thomas Wood <thomas.wood@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-23 21:41:18 +02:00
Daniel Vetter
556ebc7a7c lib/drm_lib.sh: Bare-bones long option parsing
Just enough to stay compatible with simple subtests.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-23 21:03:07 +02:00
Daniel Vetter
91f536dc42 tests: Move root check to lib/drm_lib.sh
All tests want that anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-23 21:03:07 +02:00
Thomas Wood
743dc7997a build: improve version.h generation
Move version.h generation into lib/Makefile.sources so that it can be
shared between the Autotools and Android build systems. Also make sure the
"updating version.h" message is only displayed when version.h actually
changes and remove unnecessary includes of version.h.

This also includes changes from Tvrtko Ursulin to prevent a build from
within the git repository failing when git is not available.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
2014-07-23 16:43:05 +01:00
Thomas Wood
80d2c9bf82 tests: convert simple tests to use igt_simple_init_parse_opts
Convert simple tests to use igt_simple_init_parse_opts if they require
extra options.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-23 15:23:54 +01:00
Thomas Wood
e73008bae3 tests: remove unused getopt header includes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-23 15:23:53 +01:00
Chris Wilson
784b77257b igt/gem_userptr_blits: New tests, old issues
Introduce a new test to keep that we clean up on process exit (if the
userptr is busy or it has been gtt mmapped). This revealed a few bugs in
the existing tests so clean those up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-21 16:32:42 +01:00
Chris Wilson
4d4f4b213c igt/kms_flip: Skip if headless
If there are no connectors, we cannot perform any pageflips and so we
have nothing to test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73640&list_id=446828
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-19 11:59:42 +01:00
Paulo Zanoni
d0dc2c5b6a tests/pm_rpm: add dpms-mode-unset{,-non}-lpsp subtests
These tests currently trigger WARNs on our Kernel. Let's make sure we
fix the bug and it never comes back.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-07-17 18:01:19 -03:00
Daniel Vetter
428060c555 lib/igt.cocci: Add s/assert/igt_assert/
People use it way too often, and it upsets the test library. The only
valid places to use this is of igt infrastructure self-tests where you
need to check something _without_ all the other abi use checks
igt_fail and friends do. For those tests just #define an internal
assert to hide it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-15 10:23:20 +02:00
Daniel Vetter
43784baa13 tests/gem_userptr_blits: Polish
- Drop return values for test functions - we rely on the implicit
  control flow from igt_ checks.
- Don't use assert directly, this upsets the test flow logic (and
  results in a CRASH result instead of FAIL).

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-15 10:18:28 +02:00
Tvrtko Ursulin
abbfecb015 tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops
Userptr v23 was not thread safe against memory map operations and object
creation from separate threads. MMU notifier callback would get triggered
on a partially constructed object causing a NULL pointer dereference.

This test excercises that path a bit. In my testing it would trigger it
every time and easily, but unfortunately a test pass here does not guarantee
the absence of the race.

v2: Added explicit cancellation point and removed the stop flag.
    Use only igt_assert().

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-15 10:11:27 +02:00
Damien Lespiau
bcb2c65a14 tests: Move gem_render_copy_redux to the list of multi-subtests tests
Can we find a way to fix those for good? My preference goes to not
having that single/multi split but always have a test being a list of
one or more subtests.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-14 18:08:32 +01:00
Daniel Vetter
5a98fe9d4a lib: Add argc/argv to igt_simple_init
There's a pile of ideas around to add generally useful options like
--debug to all igt tests. Or unify the runtime behaviour between
simple and subtest tests a bit more.

The first step to get there is to add argc/argv to igt_simple_init so
that we can get at the argument list.

Cc: Tim Gore <tim.gore@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-14 15:03:59 +02:00
Tim Gore
c7be53c7cb intel-gpu-tools: Dont build kms_force_connector if no cairo
kms_force_connector is a new test that requires cairo.
I have added it to the list of tests not to build on
Android unless ANDROID_HAS_CAIRO is set.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-14 15:03:59 +02:00
Chris Wilson
b3d038a2b9 igt/gem_userptr_blits: Add missing RAM check before coherency tests
-ENOCOFFE.

References: https://bugs.freedesktop.org/show_bug.cgi?id=79237
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-14 10:33:55 +01:00
Chris Wilson
52ac9a4b57 igt/gem_userptr_blits: Add missing RAM check before coherency tests
References: https://bugs.freedesktop.org/show_bug.cgi?id=79237
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-14 10:30:36 +01:00
Chris Wilson
e74dd22ff8 igt/gem_close_race: Increase GPU load
Increate the GPU load slightly, but mitigate the CPU overhead from
clflushing by keeping the object alive using flink. This has also the
side-effect of magnifying the desired busy-close race.

References: https://bugs.freedesktop.org/show_bug.cgi?id=71029
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-12 09:13:12 +01:00
Chris Wilson
98165d60be igt/gem_close_race: Trim object size
The challenge here is to race GPU activity versus the gem_close. Using a
large objects makes the window of GPU activity larger - except on !llc
systems we then incur massive overhead from clflush, likely destroying
any race (due to mutex contention). And that mutex contention is
amplified by the number of cores - bad news for Baytrail.

Give up and make the objects smaller and hope that the test is run
frequently enough to catch the race.

References: https://bugs.freedesktop.org/show_bug.cgi?id=71029
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-11 23:39:36 +01:00
Chris Wilson
f796d9958b igt/gem_tiled_swapping: Speed up slightly
The exercise is moving tiled objects in and out of swap. They are moved
en-block and we test them all, therefore we can randomly test different
bytes from each buffer to have reasonable coverage of all tiles. This
shifts the bulk of the work from checking the tiled bo to kswapd.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-11 20:41:25 +01:00
Daniel Vetter
8bf115ed99 lib/igt.cocci: Add stanza for for_each_pipe
Damien dodged this ...

Also run the script while at it.

v2: Don't just capture identifiers for pipe, but also expressions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-11 17:43:22 +02:00
Damien Lespiau
7bf0f7fc58 lib: Extract gem_get_tiling() from a couple of tests.
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:23 +01:00
Damien Lespiau
92a2b292df kms_rotation_crc: Use the igt_kms enum to encode the plane rotation
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:23 +01:00
Damien Lespiau
a58f8b93b4 kms_rotation_crc: Remove unnecessary includes
Turns out we didn't need most of them.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:23 +01:00
Damien Lespiau
1a75439667 kms_rotation_crc: Always use the primary plane to compute the reference CRC
Trying to disable the primary planes isn't exactly working at the
moment. W/A it until it works.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:23 +01:00
Damien Lespiau
282f5605b0 kms_rotation_crc: Document the two steps in prepare_crtc()
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:23 +01:00
Damien Lespiau
05f3897dc1 kms_rotation_crc: Don't compile the test on Android with no cairo support
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:23 +01:00
Damien Lespiau
f7a37f02f7 kms_rotation_crc: Add the test to .gitignore
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:23 +01:00
Damien Lespiau
8767a794bb kms_rotation_crc: Properly paint the whole frame buffer
The -1 meant we weren't properly filling the whole fb.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00
Damien Lespiau
1bcac4dcb3 kms_rotation_crc: Don't commit with no fb set up
prepare_crtc() was trying to commit a display state without any fb to
scan out...

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11 15:12:22 +01:00