4351 Commits

Author SHA1 Message Date
Chris Wilson
314fa179c8 igt/gem_bad_reloc: Rename conflicting negative-reloc-blt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-15 09:45:18 +00:00
Chris Wilson
488dc3b1ac igt/gem_exec_whisper: Beware PIN_HIGH
Certain kernels/gen like to move execbuf around for relocations,
disrupting our prewritten batches. Be more careful and try and keep the
relocation/execobjects accurate.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-15 09:18:31 +00:00
Chris Wilson
1430eb065f igt/gem_bad_reloc: Fix handling of 64bit relocations
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94537
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 20:48:59 +00:00
Imre Deak
f0d5874bd8 drv_module_reload_basic: skip alive check after load failure injection
After loading the module with load failure injection enabled don't try
check the alive state. Also limit the number of failure points to
existing ones, to reduce the run time of the test.

v2:
- make VT binding/snd module loading part of reload and VT bind fail
  silently (Chris)

Signed-off-by: Imre Deak <imre.deak@intel.com>
2016-03-14 17:44:55 +02:00
Chris Wilson
772393e806 igt/gem_exec_nop: Decrease BAT timing
For basic, since CI doesn't hit the same hard lockup on Braswell that is
possible without hpet, stop running for so long!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:33:36 +00:00
Chris Wilson
2fdf5ac917 igt/gem_exec_whisper: Exercise rings individually
Not as stressful as testing inter-ring synchronisation, but it does
allow inspecting the simpler testcases if need be.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:17:13 +00:00
Chris Wilson
5459374120 lib: Remove dead gem_get_num_rings()
No users so time to die.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:17:12 +00:00
Chris Wilson
5acda10e7f igt/gem_exec_reloc: Exercise updating relocations of an active object
Supersedes gem_dummy_reloc_loop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:17:12 +00:00
Chris Wilson
e5abd779cf tests/gem_ring_sync_loop: Exercise all rings
Fix the engine selection to exercise all possible rings and in doing so
completely obsoletes gem_multi_bsd_sync_loop.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:17:12 +00:00
Chris Wilson
3d9bcd0804 lib: Remove unused gem_has_enable_ring()
No one uses this nor should they as it just gem_get_param() in disguise
and they are better feature queries for whether individual execution
engines are functional.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14 14:17:12 +00:00
Chris Wilson
8f6ed9e692 igt/gem_exec_whisper: Persistent relocation support
The goal is to test interengine synchronisation so remove any likelihood
that we introduce synchronisation for performing relocations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-12 17:45:55 +00:00
Chris Wilson
f14d56c42d igt/drv_module_reload_basic: Rinse and repeat with addition module parameters
An idea for testing failure paths along module load is to use a parameter
to perform fault injection. This rudimentary framework should get us
started.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-11 21:27:19 +00:00
Chris Wilson
9eacbd2acd igt/gem_exec_whisper: Test submission between fds
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-11 14:32:36 +00:00
Chris Wilson
6291678f31 igt/gem_exec_whisper: Stop passing NO_RELOC
We don't preserve the execobj.offset nor set the right values into the
batches between iterations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-11 14:21:46 +00:00
Chris Wilson
d99db0990e igt/gem_exec_whisper: Don't forget that 0 is a valid address on full-ppgtt
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-11 12:07:20 +00:00
Derek Morton
d264c73929 benchmarks/gem_syslatency: Add extra android guard to attr_setaffinity_np
Android defines __USE_GNU but does not provide pthread_attr_setaffinity_np()
so added an extra guard arround pthread_attr_setaffinity_np().

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
2016-03-11 11:34:48 +00:00
Chris Wilson
5615ab2a9d tests: Add gem_exec_whisper
A more complicated store variant to stress inter-engine dependencies
(i.e. semaphores and sync). We write a control value from one batch into
the next and then execute it. This is repeated a few times with each
execution happening on a different engine (so the kernel has to
serialise operations between engines) until we finally write the value
out into our scratch buffer where we can check the result, just like a
Chinese whisper.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-11 11:34:48 +00:00
Chris Wilson
3e2443f838 igt/gem_exec_nop: Fix logical inversion for checking of valid execbuf
Only if the trial __gem_execbuf reports an error do we want to remove
the fancy LUT flags.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 12:46:52 +00:00
Chris Wilson
544ba6ca88 benchmarks/gem_syslatency: Guard setaffinity_np
pthread_setaffinity_np is a GNU extensions, so add some __USE_GNU
ifdeffry and hope for the best if unavailable.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 12:28:26 +00:00
Chris Wilson
778f0796e8 igt/gem_reloc_overflow: 32bit compilation warning
gem_reloc_overflow.c: In function ‘__real_main365’:
gem_reloc_overflow.c:384:3: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 6 has type ‘size_t’ [-Wformat=]
   igt_require_f(mlock(reloc, reloc_size) == 0,
   ^

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 10:58:11 +00:00
Chris Wilson
5ec85f5bf8 igt/gem_concurrent_blit: 32bit compilation warning
gem_concurrent_all.c: In function ‘__real_main1556’:
gem_concurrent_all.c:1642:4: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘uint64_t’ [-Wformat=]
    igt_debug("Pinning %ld MiB\n", pin_sz);

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 10:58:11 +00:00
Chris Wilson
eb59497a83 igt/drv_hangman: 32bit compilation warning
drv_hangman.c: In function ‘hangcheck_unterminated’:
drv_hangman.c:290:27: warning: integer overflow in expression [-Woverflow]
  int64_t timeout_ns = 100 * NSEC_PER_SEC; /* 100 seconds */

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 10:58:11 +00:00
Chris Wilson
3e0d9ef02c benchmarks/gem_syslatency: Subtract the clock_gettime() overhead
Since clock_gettime() should be a fixed overhead that adds to the
latency result, subtract it from the result.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 10:15:31 +00:00
Chris Wilson
2a41c4b183 benchmarks/gem_syslatency: Prevent CPU sleeps (C-states)
In order to keep the latency as low as possible for the idle load, we
need to keep the CPU awake. Otherwise we end up with the busy workload
having lower latency than the idle workload!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 09:29:26 +00:00
Chris Wilson
c084c2b88b benchmarks/gem_syslatency: Measure unloaded latency
Also useful to know how much worse than baseline the latency is when the
gem load is applied. For slower systems, presenting in nanoseconds makes
it hard to read, so switch to microseconds for output.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-10 08:41:25 +00:00
Chris Wilson
6cd15fb930 benchmarks: Add gem_syslatency
Instead of measuring the wakeup latency of a GEM client, we turn the
tables here and ask what is the wakeup latency of a normal process
competing with GEM. In particular, a realtime process that expects
deterministic latency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-09 23:40:21 +00:00
Chris Wilson
0aacdac56f igt/gem_exec_nop: Only combine unique rings
Ignore the default ring as that is purely symbolic. On BSD2 systems it
is similarly useful to ignore the symbolic BSD ring.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-09 23:40:21 +00:00
Daniel Vetter
e1ca201fe9 tests/gem_reloc_overflow: Add missing igt_fixture
Boom when running with --list on non-intel machines or as non-root.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-09 15:09:56 +01:00
Daniel Vetter
598deeda52 lib: remove saved_sig_mask
Oversight from the exit handler cleanup, spotted by Chris Wilson.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-09 15:09:56 +01:00
Chris Wilson
c684065be0 igt/gem_exec_store: The simplest batch that does something!
A very simple, the simplest!, batch that can execution on any known
engine that just writes a value into memory.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-09 11:39:42 +00:00
Daniel Vetter
93824f0cd0 lib: Unit test for exit handler
Checks that
- exit handlers are run only once, even when registered multiple
  times.
- run in reverse order
- actually run for all ways a test could exit.

This is prep work to extend exit handlers to also work in a subtest
aware way.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-08 17:12:04 +01:00
Daniel Vetter
78f2ea3bc8 lib/igt_core: remove igt_disable/enable_exit_handlers
No longer needed, and also not really a safe idea.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-08 17:12:04 +01:00
Daniel Vetter
926bcc56f9 gitignore: Add .dirstamp
autofu apparently adds these files for non-recoursive make. Fallout
from the uwildmat addition.

While at it also exclude stuff generated by make distcheck

Cc: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-08 17:12:04 +01:00
Daniel Vetter
c644c55177 tests/kms_mmap_write_crc: Use the right fork helpers
For a background task the fork helpers are more appropriate, since we
can explicitly cancel children. Also, anything that does real work is
supposed to be in fixtures.

Cc: Tiago Vignatti <tiago.vignatti@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>

--
Tiago, can you pls check that I haven't broken anythig?

Thanks, Daniel
2016-03-08 17:12:04 +01:00
Daniel Vetter
771dbb06b5 lib/igt_kms: Don't disable exit handlers around set_vt_mode
This was originally added to work around a race, but then that's
broken now. And set_vt_mode generally never results in a test binary
crash, so overkill.

I want to get rid of this interface since I spotted some abuse.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-08 17:12:04 +01:00
Chris Wilson
74761382b3 benchmarks/gem_latency: Replace igt_stats with igt_mean
Use a simpler statically allocated struct for computing the mean as
otherwise we many run out of memeory!

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 14:58:59 +00:00
Chris Wilson
3a7325e498 igt/gem_exec_nop: Add a basic test
Demonstrate how trivial it is to lockup Braswell, at least my N3050 nuc,
by saturating the interrupt handler with a few requests.

References: https://bugs.freedesktop.org/show_bug.cgi?id=93467
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 12:23:42 +00:00
Chris Wilson
1985459b09 igt/gem_ringfill: Check full rings across suspend/hibernate
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
d8842d385c igt/gem_exec_suspend: Check with both cached/uncached objects
Keep an eye on domain tracking for both cached/uncached objects across
suspend.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
697c3f5550 lib: Magic for_each_engine() macro to iterate over available engines
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
60eafc5489 igt/gem_exec_suspend: Do pre/post suspend double checks
Check that the system operates normally before and after the suspend (as
well as across the suspend). The goal is to isolate the breakage to the
subtest.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
9ba9af2ea4 lib: Skip execution in gem_has_ring()
By looking for a particular error we can avoid actually executing
anything when testing whether the kernel supports an individual ring.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
0501dcfd0f lib: Flush all possible rings
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
310f99ceb8 lib: Flush BSD2 as well when available
When flushing work and idling the GPU, we need to flush all engines,
including the forgotten BSD2.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
2d2b61e160 igt/gem_reloc_overflow: Fix errno tests for "overflow"
The execbuffer2 ABI is not strictly limited to a total of UINT32_MAX
entries, rather each object can have a maximum of UINT32_MAX relocation
entries and the current implementation imposes that the total must be
allocable in a contiguous buffer when necessary (i.e as large as the
kernel can conceivably allocate). This is not an ABI constraint per-se,
just an implementation issue.

Whilst updating the limits for 64bit kernels, review usable of
ioctl-wrappers (i.e. use __gem_execbuf now available) and include a
batch of more tests to explore the boundary conditions of the maximum
relocation size. Note that rather than guess the reloc-max, it would be
better if we queried it. Also it is of vital importance that when
constructing a test to fail in a particular fashion, it must not include
any other error (e.g. we were passing in relocation arrays with invalid
target handle and domains when looking for a potential overflow across
multiple objects).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08 09:57:33 +00:00
Chris Wilson
ec1ac2e2e9 igt/pm_rpm: Wait for PCI D3
The transition to PCI device state D3 is not instantaneous and only
started when runtime suspended. Allow the driver/hardware a little bit
of time to complete the transition before declaring a test failure.

References: https://bugs.freedesktop.org/show_bug.cgi?id=93123
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-07 14:18:43 +00:00
Tvrtko Ursulin
174a06b129 gem_ppgtt: Fix flink-and-exit-vma-leak for engine->last_context
Now that engines keep references on the last executed contexts,
to fix this test we need to execute an unrelated context last to
ensure the one we are interested in is free to be cleaned up when
we expect it to be.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2016-03-07 13:03:04 +00:00
Marius Vlad
afa38a4d45 tests/kms_setmode: Fix compilation warnings.
kms_setmode.c:384:30: warning: declaration of ‘drm_fd’ shadows a global
declaration [-Wshadow]

kms_setmode.c:45:12: note: shadowed declaration is here static int drm_fd;

kms_setmode.c:391:38: warning: passing argument 8 of ‘drmModeSetCrtc’
discards ‘const’ qualifier from pointer target type
[-Wdiscarded-qualifiers] ids, crtc->connector_count, &crtc->mode);

Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-03-07 12:27:05 +01:00
Maarten Lankhorst
b33a78b9b1 tests/kms_setmode: Add tests when not stealing encoders on same crtc.
Excercise connector stealing harder. There is a border case in atomic currently where
encoder stealing is not prevented on the same crtc when the encoder is not reassigned.

The following testcase excercises that path and causes a OOPS on my system with nightly.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-03-07 09:47:44 +01:00
Paulo Zanoni
364d3785bf tests/kms_draw_crc: remove hardcoded PIPE_A
The test used to assume pipe A was being used for everything, and we
tried to fix this in commit "tests: fix CRTC assignment for a few
tests", but the pipe CRC code was forgotten.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-04 19:14:57 -03:00