2203 Commits

Author SHA1 Message Date
Damien Lespiau
3670d6dbff lib: Introduce a modeset API
The goals here are:
  - Reduce duplicated code in each KMS test
  - Provide an API that looks more like what we want for atomic
    modesets. The hope is then that it'll be easy to switch, at
    run-time, between the "legacy" path and atomic modesets, keeping
    the same API for tests.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-02-11 13:50:16 +00:00
Thomas Wood
01757d052c tests/gem_seqno_wrap: fix over allocation of arrays
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-11 14:35:09 +01:00
Thomas Wood
e6737b8a4e assembler: fix condition for printing a warning
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-11 14:35:09 +01:00
Thomas Wood
49aa4b0df5 debugger: fix the -p option
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-11 14:35:09 +01:00
Daniel Vetter
333a5c6f07 lib/drmtest: Fix up skip_henceforth checks
We need to first check whether we'll even run the testcase before
deciding to print a premature SKIP/FAIL. Without this and global
skipped resulted in superflous output when running only one testcase.

References: https://bugs.freedesktop.org/show_bug.cgi?id=74100
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-11 12:14:09 +01:00
Daniel Vetter
a6bc3d91af tests/gem_reset_stats: Correctly wrap global test code
Tests _must_ be able to run as non-root and on non-intel platforms,
otherwise the enumeration is busted (since QA enumerates testcases on
a gpu-less xeon box).

Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-11 12:06:11 +01:00
Daniel Vetter
971c7db2c8 tests/pm_rps: remove setfreq
It's unused.

Cc: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-07 10:03:24 +01:00
Daniel Vetter
ffc481b8ac tests/pm_rps: Round requested freq correctly
The kernel will round it, so if we don't we'll have a spurious
mismatch. Happens on my machine here with 650-1300MHz range, where the
midpoint is 975.

Cc: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-07 10:03:20 +01:00
Thomas Wood
0269d1da49 lib: fix signed/unsigned comparison issues
Store the result of set_vt_mode as a signed value so that errors can be
caught correctly.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06 18:32:12 +01:00
Thomas Wood
c3e9198dd0 assembler: define YY_NO_INPUT to prevent unused symbol warnings
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06 18:32:09 +01:00
Daniel Vetter
32b624c71d tests/pm_rps: Fix compilation on Linux
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06 07:49:33 +01:00
Jeff McGee
2b8d953aa2 pm_rps: New subtest for gpu reset
Test that RPS functions as expected after a gpu reset.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06 07:47:51 +01:00
Jeff McGee
663d758d91 pm_rps: Add variable load support to load helper
The load helper can be set to HIGH or LOW. HIGH is the original mode
of sending continuous dword store commands. LOW adds a pause between
each command to reduce throughput.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06 07:47:40 +01:00
Jeff McGee
22dfb0988a pm_rps: Load helper should stall for last write
This ensures that gpu is quiescent when load helper exits.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06 07:47:23 +01:00
Jeff McGee
2d16e0aad7 pm_rps: Add stop rings injection utility
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06 07:47:10 +01:00
Jeff McGee
2cbb0fbf5f pm_rps: New subtest min-max-config-loaded
Like subtest basic-api, but additionally requires that current
frequency is increasing to the configured maximum within reasonable
time since we are loaded.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06 07:46:42 +01:00
Jeff McGee
ceb14b1905 pm_rps: Add load helper for loading gpu
The load helper submits repeated dword store commands to keep the
gpu loaded while subtests running in the parent process check for
expected rps response.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06 07:46:06 +01:00
Jeff McGee
fd3fcbd3b3 lib/drmtest: Add igt_wait_helper
igt_wait_helper compliments igt_stop_helper and is used when helper
processes are expected to exit naturally.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06 07:45:53 +01:00
Jeff McGee
3bada1626c pm_rps: New subtest min-max-config-idle
Like subtest basic-api, but additionally requires that current
frequency is settling to the configured minimum within reasonable
time since we are idle.

Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-02-06 07:45:10 +01:00
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