2434 Commits

Author SHA1 Message Date
Imre Deak
2423b6c04e lib/drmtest: fix hang in quiescent_gpu_at_exit due to signal-unsafe asprintf
I got kms_flip in hung state with the backtrace below, while the parent process
waiting for the signal helper to exit. It was quite easy to reproduce the bug
by running

kms_flip --run-subtest=flip-vs-dpms-off-vs-modeset

With the change I couldn't reproduce it.

TODO: audit/fix other signal handlers with signal-unsafe functions

0  0x00007f9a1362018b in ?? () from /lib/x86_64-linux-gnu/libc.so.6
1  0x00007f9a1359df81 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
2  0x00007f9a1359b6cf in ?? () from /lib/x86_64-linux-gnu/libc.so.6
3  0x00007f9a13628eb6 in __vasprintf_chk () from /lib/x86_64-linux-gnu/libc.so.6
4  0x00007f9a13628e72 in __asprintf_chk () from /lib/x86_64-linux-gnu/libc.so.6
5  0x000000000040a4a2 in asprintf (__fmt=0x417441 "/dev/dri/card%u", __ptr=0x7fff1a972c08)
    at /usr/include/x86_64-linux-gnu/bits/stdio2.h:178
6  drm_get_card () at drmtest.c:190
7  0x000000000040a54a in __drm_open_any () at drmtest.c:229
8  0x000000000040a846 in quiescent_gpu_at_exit (sig=<optimized out>) at drmtest.c:281
9  0x0000000000408759 in call_exit_handlers (sig=3) at drmtest.c:1519
10 fatal_sig_handler (sig=3) at drmtest.c:1543
11 <signal handler called>
12 0x00007f9a13596770 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
13 0x00007f9a135d8f3f in fork () from /lib/x86_64-linux-gnu/libc.so.6
14 0x000000000040b3af in __igt_fork_helper (proc=0x61d8cc <signal_helper>) at drmtest.c:1199
15 0x000000000040b4ce in igt_fork_signal_helper () at drmtest.c:751
16 0x0000000000404167 in main (argc=<optimized out>, argv=<optimized out>) at kms_flip.c:1533

v2:
- can't use snprintf as that's also signal-unsafe, so just use a dup'ed fd (Chris,Daniel)

Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-02-05 15:28:45 +02:00
Chris Wilson
5c9c8841eb tests: Add gem_madvise
Exercise that calling madvise produces expected results

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-04 17:03:39 +01:00
Daniel Vetter
98952a1f6e fix make distcheck
Bunch of explicit include paths needed adjustments and
eviction_common.c needs to be added to the dist files.

This has been broken in the following three commits:

commit 42bcd05eb3f1545fbf9c397c3f37c3f6a27c5da4
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date:   Mon Feb 3 10:59:41 2014 +0000

    tests/eviction_common: Avoid submitting duplicate objects

commit b92b397d5e4ffe10ed92fb2fc6711758ef5bcf89
Author: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Date:   Tue Dec 3 15:09:57 2013 +0000

    build: Make sure asserts are enabled for tests

commit 8c33e9ad111d27b84db4daac43809a807f262632
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Fri Dec 6 20:35:29 2013 -0800

    intel-gpu-tools: Version informatio

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-04 13:10:37 +01:00
Tvrtko Ursulin
42bcd05eb3 tests/eviction_common: Avoid submitting duplicate objects
Make sure selection loop does not generate duplicates
when it picks a subset of objects for a single exec buffer.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-04 12:36:57 +01:00
Tvrtko Ursulin
e1dea7e2e1 tests/gem_evict_everything: Factor out eviction logic
In preparation for userptr test we move the eviction logic
into a common file so it can be used from both test cases.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-04 12:36:53 +01:00
Damien Lespiau
d8ea09f24d gem_ring_sync_copy: Add a ring to ring synchronization test
The goal of this test is to ensure that we respect inter ring
dependencies. A more detailed description of what it tests is in a
comment.

The tests relies on having a blit function for the ring, so is currently
only checking synchronization between the render and blitter ring.

v2: Actually create an inter-ring dependency by making the first copy on
ring2 and the second on ring2, not both on ring2.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-04 10:55:42 +00:00
Rafael Barbalho
09bcb0ab4b android: Change tests & tools directory to use the lib directory
Instead of recompiling the lib directory for every tool or tests we can just
re-use the static library. This also has the nice side effect of fixing the
android "mm" command to allow android users to only rebuild the local changes
in either the test or tools directory.

Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-04 10:52:15 +00:00
Rafael Barbalho
bdb08f981c android: Add the generation of vesion.h & config.h to lib
The lib directory is used by all the tests & tools so it should really be
the place where the generate files are created.

Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-04 10:52:13 +00:00
Rafael Barbalho
005c333e5c android: Add makefile for the lib directory
The lib directory should really be compiled as a static library on its own
and be re-used by any tests or tools that require it.

Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-04 10:52:09 +00:00
Rafael Barbalho
4c79264b3c android: Clean-up common makefile directives
All the Android.mk files had the same directives to find the path of
libdrm & libpciaccess. These are no longer required as the android system
now allows the libraries being used to export include paths to dependant
modules & programs.

Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-04 10:52:06 +00:00
Rafael Barbalho
79ea9a9071 android: Handle the case when android doesn't have mmap64
Not all versions of Android have the mmap64 call, thus a suitable alternative
must be called.

Signed-off-by: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-04 10:51:46 +00:00
Ben Widawsky
e72f3bcc77 quick_dump/broadwell: Add gen7 ring mode registers
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-02-02 10:48:54 +01:00
Ben Widawsky
56d347fad8 quick_dump/haswell: Add gen7 stuff + VECS_MODE
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-02-02 10:48:54 +01:00
Ben Widawsky
556c200e99 quick_dump/gen7: Add other GFX_MODE registers
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-02-02 10:48:54 +01:00
Ben Widawsky
b5a1ab3d6e quick_dump: Add a file argument
-f, or --file will simply dump the file in the specified format. All
other options will be skipped. This is helpful when one wants to create
their own list for temporary debug, or if one requires a subset of
registers to work around things like fused off PCH.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-02-02 10:48:54 +01:00
Ben Widawsky
8ce7c366d7 quick_dump: Refactor to allow future code
Extract everything possible, and create a main function which is pretty
darn simple. The goal is to make the various paths the program can take
based on command line options (one more is coming) more decipherable.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-02-02 10:48:54 +01:00
Chris Wilson
48ad03ca0c lib: Capture errno on entry
When printing the errno, it is important that we capture the user errno
before we make any library calls - as they may alter the value.

References: https://bugs.freedesktop.org/show_bug.cgi?id=74007
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-31 16:57:17 +00:00
Chris Wilson
be22e10885 igt/gem_close_race: Fix blit commands for BDW
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73958
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-29 23:02:50 +00:00
Jesse Barnes
5e21b434da iosf: make iosf_rw take a larger addr
For higher DPIO ranges for example.  Also fix it up to use
intel_register_read/write.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2014-01-28 14:20:22 -08:00
Jesse Barnes
e558dd998d dpio: make dpio reg read/write output like normal reg read/write output
Just for consistency.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2014-01-28 14:00:39 -08:00
Jesse Barnes
670a717b5b mmio: drop unused i915_loaded fn
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2014-01-28 13:58:23 -08:00
Jesse Barnes
81095305f4 mmio: use intel_iosf.c for DPIO reads and writes
This makes it a bit more like the kernel, so we can go poke at DPIO and
other IOSF regs a bit more easily.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2014-01-28 13:58:01 -08:00
Daniel Vetter
d1b5823ee7 tests/pm_rps: rename basic test to "basic-api"
Jeff plans to add more tests ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-27 23:38:02 +01:00
Jeff McGee
5d26a7e2a2 pm_rps: Make frequency logging more compact
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-27 23:37:50 +01:00
Jeff McGee
88864d2ba5 pm_rps: Remove repeat sysfs reads
Storing values avoids some unnecessary overhead but more importantly
allows all of our processing to be atomic.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-27 23:37:50 +01:00
Jeff McGee
4e3b661b48 pm_rps: Expand on min and max config testing
Add a function that methodically varies min and max to exercise
several valid and invalid combinations. Allow the caller to
define what is to be checked between each step.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-27 23:37:50 +01:00
Jesse Barnes
22533b1eb0 NEWS: update with nomodeset register access change 2014-01-27 10:43:02 -08:00
Jesse Barnes
0d20fa3cc2 quick_dump: more vlv dpio regs 2014-01-27 10:27:20 -08:00
Jesse Barnes
5ecac45ff0 mmio: allow register init even if debugfs isn't available and i915 isn't loaded
This lets us dump regs even if modeset=0 for example.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2014-01-27 10:27:20 -08:00
Chris Wilson
0b4c33f62c igt/gem_concurrent_blit: Scale resource usage to RAM correctly
Note that we use twice the number of buffers, and so we need to restrict
num_buffers appropriately to fit within RAM.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=72255
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-26 14:38:42 +00:00
Chris Wilson
b5109e62ce intel_error_decode: Protect against missing ring registers
A dodgy kernel may miss printing out the ring registers leading to a
FPE.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-01-23 21:51:57 +00:00
Tvrtko Ursulin
4a9b70c326 tools: Allow building on Android after noinst_PROGRAMS is not defined any more
Looks like filter-out macro gets silently unhappy about an undefined variable.

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-01-23 08:57:55 +00:00
Mika Kuoppala
c05c88c2b6 tests/gem_reset_stats: stop only one ring when submitting hang
If we stop all the rings, we can end up blaming the innocent
rings on hangcheck.

Reference: https://bugs.freedesktop.org/show_bug.cgi?id=73652
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-22 09:45:27 +01:00
Ben Widawsky
1bbb607d9f gem_storedw_batches_loop: Fix for pre-BDW
My git failures are truly remarkable. I ended up pushing the wrong
commit here:
commit 1552aa21124cabe762862bb414490510415a2b2d
Author: Ben Widawsky <benjamin.widawsky@intel.com>
Date:   Mon Jan 13 06:28:45 2014 -0800

    gem_storedw_batches_loop: Fix for BDW

This puts the offset of the reloc in the wrong place for pre-BDW

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73866
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-01-21 18:03:42 -08:00
Chris Wilson
03d144d16f kms_flip: Try to consume all fences after a flip
As a flip is outstanding, there is an issue that the kernel may not be
able to release one of the fences that userspace requires and erroneous
report EDEADLK (on gen2, gen3).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73696
2014-01-20 20:27:42 +00:00
Ben Widawsky
ac0224f184 quick_dump/watermarks: lp3, misc and debug
I forgot to git add this originally.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-01-20 11:01:58 -08:00
Ben Widawsky
3deaeb2826 quick_dump/broadwell: Use haswell_other
For now, the power controls and watermarks seem to be the same offsets.
So just reuse haswell_other.txt

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-01-20 10:27:39 -08:00
Ben Widawsky
58aa7346c3 quick_dump/hsw: Watermark debug
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-01-20 10:27:39 -08:00
Ben Widawsky
73ca22c9e8 quick_dump: Allow comments in the register files
Simple addition to the parser to add the following full line comments:
{';', '#', "//"}

Empty lines will also be ignored

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-01-20 10:27:39 -08:00
Ben Widawsky
724340cf36 quick_dump: Fix the indentation
Fix the spaces to use [the python standard] 4 soft spaces for tabe.
While here, add the proper vim tag so we don't do it again.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-01-20 10:27:39 -08:00
Ben Widawsky
a5d17d2b0e .gitignore: Add pycache
quick_dump which is python, generates files in __pycache__ which are the
moral equivalent of object files. Don't let people add them to the index
accidentally.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2014-01-20 10:27:39 -08:00
Daniel Vetter
5b91475130 tests/gem_fd_exhaustion: Make it work
- We need to drop root to actually hit the limits. This requires us to
  fork the actual test since otherwise the exit handlers (which
  require root) fail the entire test.
- Don't assert that the gem create ioctl succeeds, it won't on the
  final run of the loop.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-19 22:24:23 +01:00
Daniel Vetter
7d2ba073ad lib: add __gem_create
Useful for when a gem_create ioctl is expected to fail.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-19 22:13:36 +01:00
Daniel Vetter
71f1f9eafd tests/pm_rps: Add missing static
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-19 22:12:25 +01:00
Daniel Vetter
ae57cd7dc7 debugger: avoid global variable shadowing
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-19 22:11:47 +01:00
Daniel Vetter
862de5636f lib: extract igt_drop_root
Useful in other tests.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-19 22:06:48 +01:00
Daniel Vetter
70082e3677 tests: Add gem_fd_exhaustion
Exhausts the system limit on open files and then tries to create
a new shmem-backed gem object. Linus Torvalds reported that this
blows up on a null obj->base.filp, but I can't reproduce this here:

http://lists.freedesktop.org/archives/intel-gfx/2014-January/038433.html

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-19 18:01:24 +01:00
Daniel Vetter
36106004e0 tests: Move pm_rps to the right Makefile target
If it's not in the multi-test target group testrunners won't pick up
on the fact that they need to enumerate subtests first.

Cc: jeff.mcgee@intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-19 14:48:07 +01:00
Jeff McGee
7f1c5057cf pm_rps: Fix verbose option and streamline its use
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-18 15:20:56 +01:00
Jeff McGee
d14cd7430b pm_rps: Convert to subtest structure
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-01-18 15:18:58 +01:00