4208 Commits

Author SHA1 Message Date
Michel Thierry
7cb3510964 tests/gem_softpin: Use offset addresses in canonical form
i915 validates that requested offset is in canonical form, so tests need
to convert the offsets as required.

Also add test to verify non-canonical 48-bit address will be rejected.

v2: Use sign_extend64 for converting to canonical form (Tvrtko)

Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Signed-off-by: Michel Thierry <michel.thierry@intel.com>
2016-01-08 09:40:56 +00:00
Chris Wilson
fca862cdd3 igt/gem_mmap_gtt: Add a test to exercise coherency between GTT/CPU
This checks whether a write through the GTT is immediately visible to
the CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-07 11:31:28 +00:00
Derek Morton
8528b484e8 igt_core: Fix logging to display extended line
line[strlen(line)] will always evaluate to NULL so line_continuation
was always true. That prevented the program name, pid and log level
ever being printed.
Changed to [strlen(line) - 1] so the last character before the null
terminator is compared with '\n' to determine line_continuation.

Signed-off-by: Derek Morton <derek.j.morton@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-01-06 15:17:53 +01:00
Chris Wilson
51bb53663e benchmarks/gem_latency: Allow setting an infinite time
Well, 24000 years.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-06 10:21:40 +00:00
Maarten Lankhorst
3c1362f0a6 tests: Bump pageflip wait timeout to 50 ms.
The default is too low for panels that are 30 fps or lower.
Bump the timeout to 50 ms to prevent spurious errors on those
displays.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-01-05 15:22:30 +01:00
Chris Wilson
1d6e5d3197 igt/gem_concurrent_all: Preparatory work for testing different create flags
In order to do concurrency checks using different allocation functions,
we need to hook those functions up to gem_concurrent_all. So let's add
another layer of combinations! The actual enabling for create2-ioctl
will come in the future.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-03 14:22:24 +00:00
Chris Wilson
e21368c53a benchmarks/gem_mmap: Convert to run over a fixed period
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-02 16:31:05 +00:00
Chris Wilson
9b90234414 benchmarks/gem_exec_nop: Convert to running for a fixed time
Like the previous patch to gem_exec_ctx, retrict gem_exec_nop to running
for a fixed length of time, rather than over a range of different
execution counts. In order to retain some measurement of that range,
allow measuring individual execution versus continuous dispatch.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-02 15:43:52 +00:00
Chris Wilson
6953899beb benchmarks/gem_exec_ctx: Run for a fixed time
Rather than investigate the curve for dispatch latency, just run for a
fixed time and report an average latency. Instead offer two modes,
average single dispatch latency, average continuous dispatch latency.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-02 12:31:51 +00:00
Chris Wilson
276fb3d3f4 benchmarks/gem_exec_ctx: Fix fd switching between default contexts
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-01 14:38:07 +00:00
Chris Wilson
bb35716d25 intel_error_decode: Update address parsing for 64bit offsets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31 22:10:11 +00:00
Chris Wilson
8f9df28a82 intel_error_decode: Fix decode headers for HW context
As we didn't recognise the different buffer type, we confused it with
whatever we last decoded (i.e. the render ring buffer).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31 22:10:11 +00:00
Chris Wilson
d4c3cd4d04 intel_error_decode: Inflate compressed error state
Recent kernels compress the active objects using zlib + ascii85
encoding. This adapts the tool to decompress those inplace.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31 22:10:11 +00:00
Chris Wilson
3d5b50b4f0 benchmarks/gem_blt: Estimate memory bandwidth to improve test runtime
If we autotune the workload to only take 0.1s and then repeat the
measurements over 2s, we can bound the benchmark runtime. (Roughly of
course! Sometimes the dispartity between main memory CPU bandwidth, and
GPU execution bandwidth throws off the runtime, but that's the purpose
of the benchmark!)

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-12-31 22:10:11 +00:00
Jani Nikula
9764247dc5 intel_bios_reader: add dumping of i2c element in mipi sequence
Due to the clever way the whole sequence block is specified without
forward compatibility, it's not possible to dump most blocks without
this.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Jani Nikula
cb89add979 intel_bios_reader: improve element dumpers
Try to print something useful and helpful for the user.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Jani Nikula
9c4aa072f0 intel_bios_reader: rewrite the mipi sequence block dumping
Simplify things a lot, make it correct, don't pass random pointers to
free() on errors, etc.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Jani Nikula
68cfe4ba57 intel_bios_reader: check mipi sequence block version
Bail out on v3+, we don't support that just yet.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
Jani Nikula
bdf7b1c0eb intel_opregion_decode: add new ASLE fields
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-12-22 14:21:22 +02:00
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