4139 Commits

Author SHA1 Message Date
Thomas Wood
fa24ce6b96 docs: add igt_edid_template.h to IGNORE_HFILES
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-12-21 17:09:19 +00:00
Chris Wilson
1b9085b979 benchmarks/gem_latency: Hide spinlocks for android
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-21 16:32:08 +00:00
Ville Syrjälä
23aa051369 lib: Use igt_assert_eq() to check for crc component count
It's nice to see just how many components the crc claims to have
when the count don't match what we expect.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-21 16:54:44 +01:00
Ville Syrjälä
793aff199f lib: Make 'extra_long_opts' const
The extra_long_opts passed to igt_*_parse_opts() isn't modified,
so let's make it const.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-21 16:54:40 +01:00
Chris Wilson
a1d465a3c5 benchmarks/gem_latency: Serialise mmio reads
The joy of our hardware; don't let two threads attempt to read the same
register at the same time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-21 13:34:58 +00:00
Chris Wilson
3ebce37b65 benchmarks/gem_latency: Guard against inferior pthreads.h
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-21 10:00:21 +00:00
Chris Wilson
3cc8f957f1 benchmarks/gem_latency: Measure CPU usage
Try and gauge the amount of CPU time used for each dispatch/wait cycle.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-20 21:22:35 +00:00
Chris Wilson
a91ee853b1 benchmarks/gem_latency: Measure effect of using RealTime priority
Allow the producers to be set with maximum RT priority to verify that
the waiters are not exhibiting priorty-inversion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-20 21:22:35 +00:00
Chris Wilson
27e093dd1f benchmarks/gem_latency: Use RCS on Sandybridge
Reading BCS_TIMESTAMP just returns 0...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-20 13:02:02 +00:00
Chris Wilson
c0942bf528 benchmarks/gem_latency: Rearrange thread cancellation
Try a different pattern to cascade the cancellation from producers to
their consumers in order to avoid one potential deadlock.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-20 13:02:02 +00:00
Chris Wilson
8ea61ec1ff benchmarks/gem_latency: Tweak workload
Do the workload before the nop, so that if combining both, there is a
better chance for the spurious interrupts. Emit just one workload batch
(use the nops to generate spurious interrupts) and apply the factor to
the number of copies to make inside the workload - the intention is that
this gives sufficient time for all producers to run concurrently.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-20 13:02:02 +00:00
Chris Wilson
db011021a1 benchmarks/gem_latency: Add output field specifier
Just to make it easier to integrate into ezbench.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-19 15:07:56 +00:00
Chris Wilson
646cab4c0c benchmarks/gem_latency: Split the nop/work/latency measurement
Split the distinct phases (generate interrupts, busywork, measure
latency) into separate batches for finer control.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-19 12:16:52 +00:00
Chris Wilson
e37a4c8092 benchmarks/gem_latency: Add time control
Allow the user to choose a time to run for, default 10s

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-19 12:16:52 +00:00
Chris Wilson
2ef368acfa benchmarks/gem_latency: Add nop dispatch latency measurement
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-19 12:16:52 +00:00
Chris Wilson
1db5b05243 benchmarks/gem_latency: Expose the workload factor
Allow the user to select how many batches each producer submits before
waiting.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-19 12:16:52 +00:00
Chris Wilson
6dbe0a3012 benchmarks/gem_latency: Measure whole execution throughput
Knowing how long it takes to execute the workload (and how that scales)
is interesting to put the latency figures into perspective.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-19 12:16:52 +00:00
Chris Wilson
2f74892ebd benchmarks/gem_latency: Fix for !LLC
Late last night I forgot I had only added the llc CPU mmaping and not
the !llc GTT mapping for byt/bsw.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-19 10:32:38 +00:00
Chris Wilson
39bad606c5 benchmarks: Remove gem_wait
Superseded by gem_latency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-19 01:31:06 +00:00
Chris Wilson
c9da0b5221 benchmark: Measure of latency of producers -> consumers, gem_latency
The goal is measure how long it takes for clients waiting on results to
wakeup after a buffer completes, and in doing so ensure scalibilty of
the kernel to large number of clients.

We spawn a number of producers. Each producer submits a busyload to the
system and records in the GPU the BCS timestamp of when the batch
completes. Then each producer spawns a number of waiters, who wait upon
the batch completion and measure the current BCS timestamp register and
compare against the recorded value.

By varying the number of producers and consumers, we can study different
aspects of the design, in particular how many wakeups the kernel does
for each interrupt (end of batch). The more wakeups on each batch, the
longer it takes for any one client to finish.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-19 01:30:57 +00:00
Chris Wilson
8bf09f3d12 tests/gem_concurrent_all: Add a couple more sanitycheck patterns
As always, the goal is to quickly stress a variety of workloads that
often lead to kernel bugs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-17 15:25:43 +00:00
Chris Wilson
04bd964527 igt/gem_exec_nop: Restore SLOW_QUICK loop terminator
The upper bound for SLOW_QUICK was added for the benefit of the slow
simulator, not because, as I wrongly thought, of the latency
measurements.

SLOW_QUICK was added in

commit d1e862324b747a0ab5d985eaa6830076817231c5
Author: Damien Lespiau <damien.lespiau@intel.com>
Date:   Mon Mar 25 20:06:20 2013 +0000

    tests: Instrument tests run in simulation to run quickly

and dropped in

commit 89bcdb9022fb7a1f66635b9f2546356ad0c0761a
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date:   Tue Dec 8 13:42:50 2015 +0000

    igt/gem_exec_nop: Remove nop latency measurements

Reported-by: Ben Widawsky <benjamin.widawsky@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-16 19:55:36 +00:00
Thomas Wood
a012e44b6a tests: remove .gitignore and add a Makefile rule to create it
v2: generate the .gitignore file with the default target
v3: remove the .gitignore file

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-12-16 16:54:28 +00:00
Daniel Vetter
40798efd85 tests/gem_eio: New ABI - no EIO even from wait_ioctl
So there's 3 competing proposals for what wait_ioctl should do wrt
-EIO:

- return -EIO when the gpu is wedged. Not terribly useful for
  userspace since it might race with a hang and then there's no
  guarantee that a subsequent execbuf won't end up in an -EIO.
  Terminally wedge really can only be reliably signalled at execbuf
  time, and userspace needs to cope with that (or decide not to
  bother).

- EIO for any obj that suffered from a reset. This means big internal
  reorginazation in the kernel since currently we track reset stats
  per-ctx and not on the obj. That's also what arb robustness wants.
  We could do this, but this feels like new ABI territory with the
  usual userspace requirements and high hurdles.

- No -EIO at all. Consistent with set_domain_ioctl and simplest to
  implement. Which is what this patch does.

We can always opt to change this later on if there's a real need.

To make the test really exercise this do a full wedged gpu hang, to
make sure -EIO doesn't leak out at all.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-16 13:46:47 +00:00
Derek Morton
3953d2dd22 gem_flink_race/prime_self_import: Improve test reliability
gem_flink_race and prime_self_import have subtests which read the
number of open gem objects from debugfs to determine if objects have
leaked during the test. However the test can fail sporadically if
the number of gem objects changes due to other process activity.
This patch introduces a change to check the number of gem objects
several times to filter out any fluctuations.

v2: Moved the common code to a library and made the loop android
specific (Daniel Vetter)
v3: Renamed get_stable_obj_count -> igt_get_stable_obj_count

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-12-16 10:21:14 +01:00
Mika Kuoppala
5a8d063e42 tests/gem_softpin: Fix compiler warning on 32bit systems
We get build error as we try to cast from ptr to integer
of different size on 32 bit platforms. Use unsigned long
as the cast, it will work with both 32 and 64 bit
systems.

Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
2015-12-14 10:23:58 +02:00
Chris Wilson
14f70a861b igt/gem_read_read_speed: Tweak to show comparison against write-write
Since we hold an exclusive write lock we expect 2 writes to happen
serially, but we expect 2 reads to happen in parallel. Expand the testing
to demonstrate this effect (i.e. we expect read-read to be roughly 2x
faster than write-write for small copies on big core.)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-13 15:20:18 +00:00
Chris Wilson
866a6f2c41 tests/gem_pread,gem_pwrite: Fix compiler warnings
Many warnings of the form

gem_pread.c: In function ‘main’:
gem_pread.c:128:8: warning: assignment discards ‘const’ qualifier from
pointer target type [-Wdiscarded-qualifiers]
    bps = bytes_per_sec(buf, object_size/usecs*1e6);

Regression from
commit 48c945322b4c5f6443758143cccb9c4c04da4aaa
Author: Ankitprasad Sharma <ankitprasad.r.sharma@intel.com>
Date:   Wed Dec 2 14:54:51 2015 +0530

    igt/gem_pread: Support to verify pread/pwrite for non-shmem backed obj

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-12 20:02:16 +00:00
Chris Wilson
2d08e9e9a1 igt/gem_concurrent_all: Expand testing to cover different memory regimes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-11 11:55:26 +00:00
Daniel Vetter
6672da5e8f Revert "igt: s/basic/sanitycheck/ on prior smoketesting"
This reverts commit 4f5efc5c844f6fe69209982463f9220f8f3951ed.

There was a bit a misunderstanding on IRC between Chris&me. We want
basic tests as sanity test to be run in the BAT CI. It's just unfortunate
that right now we have fairly limited ability to absorb new ones, both
because of a pile of existing bugs in the kernel and because the CI
infrastructure is still being scaled out.

The idea was just to remove the BAT tests added yesterday, not all of
the ones we've had for a while longer.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Grumpily-acked-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-10 12:45:20 +01:00
Chris Wilson
4f5efc5c84 igt: s/basic/sanitycheck/ on prior smoketesting
In times past, I added "basic" variants of tests just to ensure that the
general principle of operation was sound before proceeding on to the
main test (which typically looked at thrashing, i.e. were long and
tedious and pointless if the test didn't even work in the normal
situation). Since "basic" now collides with BAT, rename my trivial tests
to "sanitycheck".

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-10 10:05:20 +00:00
Chris Wilson
197db8607d igt/gem_concurrent_blit: Explicitly check for "missed interrupts"
As the concurrency tests are a good source of stress for
i915_wait_request() (the tests are primarily designed to ensure that GPU
activity of one form or another is completed before access by third
parties), one of the common form of errors we can detect are the
"missing interrupts" (i.e. where the waits do not terminate because of a
race between the interrupt and the seqno write). Add an explicit check
for this error and flag it as a definite fail - which also helps narrow
it down to certain subtests when run as a batch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-09 20:57:52 +00:00
Bob Paauwe
4cc40ad4fe igt/test/pm_rps: load GPU to force not-idle to idle transition.
When changing the sysfs GT min frequency, the kernel won't
automatcilly drop the GT frequency to idle unless the GPU
transitions from busy to idle.

Load the GPU after increasing the GT min frequency to force
a busy to idle transition. This matches the behavior when
decreasing the GT min frequency.

Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
2015-12-09 17:27:56 +02:00
Rodrigo Vivi
4aa1b99a12 kms_psr_sink_crc: Add BAT test for PSR active.
It takes from 2 to 5 seconds to run.

Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-12-09 07:23:50 -08:00
Rodrigo Vivi
4a004d9cb3 kms_psr_sink_crc: Reduce our time out for PSR active.
Using same timeout value as kms_fronbuffer_tracking and for
same reasons exposed at 'commit 83582f9b ("kms_frontbuffer_tracking:
 Increase the time we wait for PSR.")'

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-12-09 07:23:45 -08:00
Vinay Belgaumkar
be2d5188f6 tests/gem_softpin: New tests for softpin feature
These tests exercise the userptr ioctl to create shared buffers
between CPU and GPU. They contain error and normal usage scenarios.
They also contain a couple of stress tests which copy buffers between
CPU and GPU. These tests rely on the softpin patch in order to pin buffers
to a certain VA.

Caveat: These tests were designed to run on 64-bit system. Future work
includes adding logic to ensure these tests can run on 32-bit systems with
PPGTT support. Some tests are currently disabled for 32-bit systems for that
reason.

v2: Added cc and signed-off-by fields

v3: Fixed review comments, added helper functions. Removed userptr error
scenarios covered by existing userptr tests. Modified stress test to have
100K buffers, it now runs for ~30 mins, checks every element has been written
to correctly, and pins buffers at different VMAs.

v4: Changed name to gem_softpin

v5: More fixes. Removed the file based tests, will move them to userptr tests.
Added a function that validates appropriate PPGTT support before running tests.
Optimized stack space and memory footprint in stress test. Removed the eviction
test, will add it back after verifying proper functionality.

v6: Split basic test into userptr and bo
Fixed some coding style issues.

v7: Enhanced invalid vma pinning test to verify 32-bit PPGTT functionality.
Enabled the test for 32-bit PPGTT systems, and verify pinning fails above
32-bit addresses. Enhanced the high adress pinning test to ensure pinning
fails when EXEC_OBJECT_PINNED flag is not used. Some more cosmetic fixes to
close buffer handles. Changed userptr function to used synchronized operations.

v8: Minor change to high address pinning test as per comment.

v9: Skip the tests if softpin support is not present.

v10: Removed trailing white spaces.

v11: Keep alphabetical order in Makefile and gitignore; update error code
returned while trying to pin above the max vm size (EINVAL); test attempt
to pin above 4GB without the support 48b flag.

Cc: Michel Thierry <michel.thierry@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com> (v11)
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2015-12-09 10:27:12 +00:00
Chris Wilson
89bcdb9022 igt/gem_exec_nop: Remove nop latency measurements
Since commit c8beadb811bdc2b9c21f95144852f3e55867b546
Author: Derek Morton <derek.j.morton@intel.com>
Date:   Wed Nov 11 14:46:58 2015 +0000

    tests/gem_exec_nop: Improved test run time

the stablity of the measurement regressed and it is once again no longer
a reliable metric for detecting regressions. Give up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Derek Morton <derek.j.morton@intel.com>
2015-12-08 13:43:46 +00:00
Ville Syrjälä
870548b653 tests/kms_force_connector_basic: Add prune-stale-modes subtest
Add a new subtest that makes sure old stale modes get pruned from the
connector's mode list when the EDID changes.

v2: s/drmModeGetConnector/drmModeGetConnectorCurrent/ since
    kmstest_force_edid() already takes care of doing the heavier
    call for us (Daniel)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-08 15:23:10 +02:00
Ville Syrjälä
b0f4df31ba lib/kms: Turn base_edid into a template
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-12-08 15:21:59 +02:00
Rodrigo Vivi
7bd31d090e kms_psr_sink_crc: Add suspend/resume sub test.
Although kms_frontbuffer_tracking already has psr-suspend testcase
this one here can complement it by testing different combination
and mainly covering 2 different cases individually:

1. wait-for-psr, suspend-resume tehn run 1 operation.

2. suspend-resume, wait-for-psr then run 1 operation.

v2: Remove no-suspend option since this should be done with piglit
if necessary for now.

v3: argh! remove remaining no-suspend checks...

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-12-07 09:06:53 -08:00
Rodrigo Vivi
63980babcf kms_psr_sink_crc: Fix no-psr option.
commit 75b286e821 ("tests/kms_psr_sink_crc: test even
if PSR is disabled by default")' force PSR enabling without
respecting the no-psr (running-with-psr-disabled) option.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-12-07 09:06:42 -08:00
Rodrigo Vivi
e6848c5839 kms_frontbuffer_tracking: Skip on unreliable CRC.
Even with all sink crc re-works we still have platforms
where after 6 vblanks it is unable to calculate the
sink crc. But if we don't get the sink crc it isn't true
that test failed, but that we have no ways to say test
passed or failed.

So let's print a message and move forward in case sink crc
cannot help us to know if the screen has been updated.

v2: Also include a message on setup_sink_crc and also
only skip when it is mandatory, i.e. when running for PSR.

Acked-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-12-07 09:06:33 -08:00
Rodrigo Vivi
ea3806bade kms_frontbuffer_tracking: Make sink crc mandatory only for PSR.
Unfortunately Sink CRC is not 100% reliable for all platforms.
So we cannot block FBC tests nor skip them when we are getting
unreliable Sink CRC results, or not getting them at all.

Acked-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-12-07 09:06:20 -08:00
Rodrigo Vivi
d074b44ab6 kms_frontbuffer_tracking: Increase the time we wait for PSR.
With commit (drm/i915: Delay first PSR activation.) in kernel
PSR might take a bit longer to really activate after the modeset.
The first PSR activation after modeset is taking 5 times the panel
power cycle delay time, which is 600ms for our machines here.
So timeout here needs to be a minimum of 3s. However let's use
5s as the safe value in case we find machines with higher power
cycle delay.

Since we do a lot of assert(psr_disabled), this commit is increasing
the time it takes to run the whole set of PSR tests by a few minutes,
which had been reduced by commit f4db3b18841
("kms_frontbuffer_tracking: reduce the PSR wait timeout to 2s").

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-12-07 09:05:55 -08:00
Bob Paauwe
8b22e051e8 igt/pm_rps: current freq < user specified min is not a fail (v3)
Since commit

  commit aed242ff7ebb697e4dff912bd4dc7ec7192f7581
  Author: Chris Wilson <chris@chris-wilson.co.uk>
  Date:   Wed Mar 18 09:48:21 2015 +0000

      drm/i915: Relax RPS contraints to allows setting minfreq on idle

it is now possible that the current frequency will drop be the user
specified minimum frequency to the "idle" or RPn frequency. Update the
 pm_rps tests to reflect that droping below the user specified minimum
is no longer considered a failure.

v2: Add check RPn <= current freq. (Me)
v3: Use RPn instead of MIN frequency in idle check (Imre)
Signed-off-by: Bob Paauwe <bob.j.paauwe@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
2015-12-04 22:26:06 +02:00
Daniel Vetter
6cf72724e2 tests/drv_hangman: Open drm fd before doing anything
This way we correctly auto-skip instead of falling over the
lack of i915 debugfs files first and fail the testcase due to
that.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-04 16:35:31 +01:00
Daniel Vetter
ee0808982f tests/drm_lib.sh: Skip when i915 debugfs wasn't found
Instead of failing. We might want to move this into i915 tests
eventually, but this is good for now.

v2: Use the correct exit code (Derek) and use the new symbolic values
Thomas added.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-12-04 16:35:00 +01:00
Daniel Vetter
d8d1eab318 lib: igt_fork_hang_helper must be run in fixtures
Because it opens an intel-specific drm fd. Fixes crashes when running
igt on no-intel.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-12-04 16:33:58 +01:00
Chris Wilson
39e44dfa4c benchmarks/gem_exec_nop: Flush retirement lists before executing
wait-ioctl skips a couple of side-effects of retiring, so provoke them
using set-domain before we sleep.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-04 13:59:37 +00:00
Daniel Vetter
839a1426ce tests/kms_force_connector: Include in BAT set
Forcing connector state is a basic piece of our test infrastructure
that we use in all the kms_ tests. It allows us to run tests even if
no outputs are connected.

They're also really fast, so perfect candidates for inclusion into the
BAT set.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-12-04 10:50:50 +01:00