profile/extras/intel-gpu-tools.git
11 years agooverlay: Tweak label locations to include baseline offset.
Chris Wilson [Mon, 19 Aug 2013 07:20:15 +0000 (08:20 +0100)]
overlay: Tweak label locations to include baseline offset.

Still approximately, too lazy to query the metrics.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Add a X11 window backend
Chris Wilson [Sun, 18 Aug 2013 20:10:26 +0000 (21:10 +0100)]
overlay: Add a X11 window backend

Useful for remote hosts.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Tweak a couple of the fill colours to be slightly less horrid
Chris Wilson [Sun, 18 Aug 2013 18:20:24 +0000 (19:20 +0100)]
overlay: Tweak a couple of the fill colours to be slightly less horrid

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Don't smooth gpu freq
Chris Wilson [Sun, 18 Aug 2013 18:16:29 +0000 (19:16 +0100)]
overlay: Don't smooth gpu freq

This is supposed to be discrete jumps, so use straight lines to emphasis
this nature.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agotest/gem_dummy_reloc_loop: fix igt_require conversion
Daniel Vetter [Sun, 18 Aug 2013 17:58:28 +0000 (19:58 +0200)]
test/gem_dummy_reloc_loop: fix igt_require conversion

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68170
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agooverlay: Remove the double ':' from object comm names
Chris Wilson [Sun, 18 Aug 2013 17:54:04 +0000 (18:54 +0100)]
overlay: Remove the double ':' from object comm names

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Use a more compact 2x2 layout for the graphs
Chris Wilson [Sun, 18 Aug 2013 17:45:14 +0000 (18:45 +0100)]
overlay: Use a more compact 2x2 layout for the graphs

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Rearrange GUI state
Chris Wilson [Sun, 18 Aug 2013 17:40:03 +0000 (18:40 +0100)]
overlay: Rearrange GUI state

Planning a new layout...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Print min/max GPU frequencies.
Chris Wilson [Sun, 18 Aug 2013 17:27:47 +0000 (18:27 +0100)]
overlay: Print min/max GPU frequencies.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Convert gem objects to megabytes
Chris Wilson [Sun, 18 Aug 2013 17:24:43 +0000 (18:24 +0100)]
overlay: Convert gem objects to megabytes

Less confusing, I hope.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Parse gem objects
Chris Wilson [Sun, 18 Aug 2013 17:17:05 +0000 (18:17 +0100)]
overlay: Parse gem objects

Condense the information and begin graphing it. Remaining todo for
memory is to measure bind/evict flux, and perhaps clflush.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Add GPU frequency
Chris Wilson [Sun, 18 Aug 2013 15:42:25 +0000 (16:42 +0100)]
overlay: Add GPU frequency

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Include CPU usage in the overview chart
Chris Wilson [Sun, 18 Aug 2013 14:56:22 +0000 (15:56 +0100)]
overlay: Include CPU usage in the overview chart

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Count flips per plane
Chris Wilson [Sun, 18 Aug 2013 10:15:08 +0000 (11:15 +0100)]
overlay: Count flips per plane

Stop the misleading double-accounting of flips when we have multiple
displays active.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Improve the horizontal fit of the charts
Chris Wilson [Sat, 17 Aug 2013 22:50:21 +0000 (23:50 +0100)]
overlay: Improve the horizontal fit of the charts

Notably fix the fill boundary to not extend past the right hand side of
the chart.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Correct layout of ring/seqno in raw sample
Chris Wilson [Sat, 17 Aug 2013 22:07:01 +0000 (23:07 +0100)]
overlay: Correct layout of ring/seqno in raw sample

For seqno completion, the events are too coarse i.e. one event may
signal the completion of a few seqno. We will need to sort the events to
properly compute the busy times.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Accumulate busy times
Chris Wilson [Sat, 17 Aug 2013 21:33:35 +0000 (22:33 +0100)]
overlay: Accumulate busy times

Still a little too course as we add multiple overlapping seqnos and
waits.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Couple wait begin/end events together to fix accounting
Chris Wilson [Sat, 17 Aug 2013 21:22:21 +0000 (22:22 +0100)]
overlay: Couple wait begin/end events together to fix accounting

Since the events may be processed out of order (due to per-cpu
ringbuffers) we need to be careful to associated wait pairs in order to
compute the correct elapsed time.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Perf output redirection must be done after mmap()
Chris Wilson [Sat, 17 Aug 2013 21:07:49 +0000 (22:07 +0100)]
overlay: Perf output redirection must be done after mmap()

Effectively you choose to redirect the output of an event instead of
mmapping it directly - but the target must already be mmapped.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Show per-process wait times
Chris Wilson [Sat, 17 Aug 2013 20:14:10 +0000 (21:14 +0100)]
overlay: Show per-process wait times

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Graph per-process requests over time
Chris Wilson [Sat, 17 Aug 2013 19:32:58 +0000 (20:32 +0100)]
overlay: Graph per-process requests over time

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Track requests per-process
Chris Wilson [Sat, 17 Aug 2013 19:04:11 +0000 (20:04 +0100)]
overlay: Track requests per-process

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Drop unused mmap/comm events
Chris Wilson [Sat, 17 Aug 2013 17:48:28 +0000 (18:48 +0100)]
overlay: Drop unused mmap/comm events

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Constify perf ringbuffer
Chris Wilson [Sat, 17 Aug 2013 17:24:39 +0000 (18:24 +0100)]
overlay: Constify perf ringbuffer

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Fix wraparound handling of perf ringbuffer
Chris Wilson [Sat, 17 Aug 2013 17:09:40 +0000 (18:09 +0100)]
overlay: Fix wraparound handling of perf ringbuffer

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Primitive integration with perf
Chris Wilson [Sat, 17 Aug 2013 16:38:37 +0000 (17:38 +0100)]
overlay: Primitive integration with perf

We can now record when a pageflip occurs by listening for the flip
tracepoint. Merely proof of principle at this point.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agooverlay: Show GPU waits
Chris Wilson [Sat, 17 Aug 2013 11:32:17 +0000 (12:32 +0100)]
overlay: Show GPU waits

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agoIntroduce intel-gpu-overlay
Chris Wilson [Sat, 17 Aug 2013 10:12:07 +0000 (11:12 +0100)]
Introduce intel-gpu-overlay

A realtime display of GPU activity. Note, this is just at the point of
minimum usability...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agoquick_dump: add is_haswell()
Ben Widawsky [Fri, 16 Aug 2013 21:54:36 +0000 (14:54 -0700)]
quick_dump: add is_haswell()

This was missed beforehand.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
11 years agogem_concurrent_blit: Purge the child bufmgr's cache
Chris Wilson [Fri, 16 Aug 2013 11:07:56 +0000 (12:07 +0100)]
gem_concurrent_blit: Purge the child bufmgr's cache

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68169

11 years agodrmtest: Squelch the rude interrupter
Chris Wilson [Fri, 16 Aug 2013 11:15:00 +0000 (12:15 +0100)]
drmtest: Squelch the rude interrupter

Stop printing the debugging information of how many times we emitted a
signal.

11 years agogem_concurrent_blit: Fix the leak from the children.
Chris Wilson [Fri, 16 Aug 2013 10:23:22 +0000 (11:23 +0100)]
gem_concurrent_blit: Fix the leak from the children.

As the children use the parent's fd, the kernel only has a single filp
for everyone. Therefore we cannot rely on the process termination
reaping the buffers we allocate for the children.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68169

11 years agogem_concurrent_blit: Share total num_buffers between all children
Chris Wilson [Fri, 16 Aug 2013 08:44:13 +0000 (09:44 +0100)]
gem_concurrent_blit: Share total num_buffers between all children

Apparently not all machines have more than 4GiB of RAM available.
Spoilsports.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68169

11 years agoassembler: error for the wrong syntax of SEND instruction on GEN6+
Xiang, Haihao [Wed, 14 Aug 2013 21:21:16 +0000 (14:21 -0700)]
assembler: error for the wrong syntax of SEND instruction on GEN6+

   predicate SEND execsize dst sendleadreg payload directsrcoperand instoptions
   predicate SEND execsize dst sendleadreg payload imm32reg instoptions
   predicate SEND execsize dst sendleadreg payload sndopr imm32reg instoptions
   predicate SEND execsize dst sendleadreg payload exp directsrcoperand instoptions

The above four syntaxes are only used on legacy platforms which support implied move
from payload to dst.

Signed-off-by: Xiang, Haihao <haihao.xiang@intel.com>
Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
11 years agogem_ctx_basic: Fix misc warnings
Damien Lespiau [Thu, 15 Aug 2013 15:46:58 +0000 (16:46 +0100)]
gem_ctx_basic: Fix misc warnings

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agointel_infoframes: Dump 3D_Ext_Data when using Side-by-side (half)
Damien Lespiau [Thu, 15 Aug 2013 15:40:47 +0000 (16:40 +0100)]
intel_infoframes: Dump 3D_Ext_Data when using Side-by-side (half)

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
11 years agointel_infoframes: Add support for decoding HDMI VICs
Damien Lespiau [Sat, 10 Aug 2013 20:25:16 +0000 (21:25 +0100)]
intel_infoframes: Add support for decoding HDMI VICs

The HDMI vendor infoframe can contain a HDMI VIC (as of HDMI 1.4, only
used for 4k formats).

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
Reviewed-by: Simon Farnsworth <simon.farnsworth@onelan.co.uk>
11 years agotests/prime: test dma-buf llseek support
Daniel Vetter [Thu, 15 Aug 2013 12:00:23 +0000 (14:00 +0200)]
tests/prime: test dma-buf llseek support

This exercises a proposed patch from Christopher James Halse Rogers.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: Use igt_assert in the do_ioctl/do_or_die helpers
Daniel Vetter [Thu, 15 Aug 2013 09:55:32 +0000 (11:55 +0200)]
lib/drmtest: Use igt_assert in the do_ioctl/do_or_die helpers

abort results in "crash" test results in the piglit runner, igt gives
us neater output.

The downside is that we can now only use these in igt tests, but
that's already the case (and given their placement in drmtest.h their
intended use-case, too).

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_ctx_basic: Use igt_require
Daniel Vetter [Thu, 15 Aug 2013 11:47:15 +0000 (13:47 +0200)]
tests/gem_ctx_basic: Use igt_require

... instead of threading the 77 return value through threads. Even
better would be to check for requirements in the single-threaded setup
part of the test, since now it's done by multiple threads in parallel
and will result in interleaved and multiplied output on stdout.
Whatever.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agoAdd intel_framebuffer_dump
Chris Wilson [Thu, 15 Aug 2013 09:55:22 +0000 (10:55 +0100)]
Add intel_framebuffer_dump

A simple utility to capture the currently active framebuffers and record
them as a png.

11 years agolib/drmtest: fix subtest output when skipping all tests
Daniel Vetter [Wed, 14 Aug 2013 20:13:38 +0000 (22:13 +0200)]
lib/drmtest: fix subtest output when skipping all tests

(null) isn't too nice ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/prime_nv_api: fixup conversion goof-up
Daniel Vetter [Wed, 14 Aug 2013 20:24:43 +0000 (22:24 +0200)]
tests/prime_nv_api: fixup conversion goof-up

Oops.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/primve_nv_test: use igt_assert for checking
Daniel Vetter [Wed, 14 Aug 2013 20:15:04 +0000 (22:15 +0200)]
tests/primve_nv_test: use igt_assert for checking

... and drop the int return argument of the tests.

Also:
- make nv_write_i915_cpu_mmap_read functional again by dropping the
  goto.
- add checks to i915_import_pread_pwrite

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: documentation for igt_fixture
Daniel Vetter [Wed, 14 Aug 2013 16:30:03 +0000 (18:30 +0200)]
lib/drmtest: documentation for igt_fixture

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: add igt_subtest_name and use it in kms_flip
Daniel Vetter [Wed, 14 Aug 2013 16:03:09 +0000 (18:03 +0200)]
lib/drmtest: add igt_subtest_name and use it in kms_flip

Useful when the testname is constructed with igt_subtest_f.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: roll out igt_fixture
Daniel Vetter [Wed, 14 Aug 2013 16:02:46 +0000 (18:02 +0200)]
tests: roll out igt_fixture

Also sprinkle igt_assert and igt_require over the setup code to clean
up code while at it. To avoid gcc getting upset about unitialized
variables just move them out of main as global data (where they always
get initialized to 0) - gcc can't see through our igt_fixture and
igt_subtest maze properly.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_ctx_bad_exec: add subtest for vebox
Daniel Vetter [Wed, 14 Aug 2013 15:11:49 +0000 (17:11 +0200)]
tests/gem_ctx_bad_exec: add subtest for vebox

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: Introduce igt_fixture
Daniel Vetter [Wed, 14 Aug 2013 13:48:54 +0000 (15:48 +0200)]
tests: Introduce igt_fixture

Just a tiny wrapper to protect global test setup/teardown code when
just listing subtests. Rolling this out over all tests with subtests
should allow us to generate the testlist with piglit as an
unpriviledged user on a non-intel system.

The aim here is to make our QA team happy who currently suffers from
this. Even more so for the prime tests since you need a system with
intel _and_ nouveau gpus to just be able to list tests.

Exemplary conversion with gem_concurrent_blt.c

Fixture is the same name other test suites like googletest use for
setup/teardown code used by multiple tests.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: sprinkle documentation over igt_skip|fail|success|exit
Daniel Vetter [Wed, 14 Aug 2013 14:51:26 +0000 (16:51 +0200)]
lib/drmtest: sprinkle documentation over igt_skip|fail|success|exit

And make the behaviour of igt_exit() a bit saner.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: use igt_exit() consistently with subtests
Daniel Vetter [Wed, 14 Aug 2013 14:02:24 +0000 (16:02 +0200)]
tests: use igt_exit() consistently with subtests

This is mostly important to get the SKIP reporting right, but I've
found a few stragglers that wanted to get converted over to the igt
result reporting completely.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_concurrent_blt: extract run wrappers
Daniel Vetter [Wed, 14 Aug 2013 13:18:37 +0000 (15:18 +0200)]
tests/gem_concurrent_blt: extract run wrappers

Functional programming ftw!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_concurrent_blt: use the test helpers in the forked tests
Daniel Vetter [Wed, 14 Aug 2013 13:10:52 +0000 (15:10 +0200)]
tests/gem_concurrent_blt: use the test helpers in the forked tests

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_concurrent_blt: refactor basic run modes a bit
Daniel Vetter [Wed, 14 Aug 2013 13:08:05 +0000 (15:08 +0200)]
tests/gem_concurrent_blt: refactor basic run modes a bit

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: merge gem_*_concurrent_blt together
Daniel Vetter [Wed, 14 Aug 2013 12:50:50 +0000 (14:50 +0200)]
tests: merge gem_*_concurrent_blt together

Too much copy&pasting isn't good.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: Don't spoil stdout when listing tests
Daniel Vetter [Wed, 14 Aug 2013 11:48:10 +0000 (13:48 +0200)]
lib/drmtest: Don't spoil stdout when listing tests

Oops.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: add igt_subtest_f for snprintf'ing testnames
Daniel Vetter [Wed, 14 Aug 2013 11:47:47 +0000 (13:47 +0200)]
tests: add igt_subtest_f for snprintf'ing testnames

Useful when stitching together combinatorial testnames.

v2:
- ## rules are just fun. We need 2 indirections to actually get
  __LINE__ to properly expand.
- Kill stray ; which botched the logic.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_dummy_reloc_loop: use igt_skip
Daniel Vetter [Wed, 14 Aug 2013 10:13:28 +0000 (12:13 +0200)]
tests/gem_dummy_reloc_loop: use igt_skip

For tests with subtest we should use igt_skip to ensure that subtests
are always properly enumerated.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_write_read_ring_switch: use igt_exit and friends
Daniel Vetter [Wed, 14 Aug 2013 10:07:44 +0000 (12:07 +0200)]
tests/gem_write_read_ring_switch: use igt_exit and friends

And consolidate the gem_require_ring check a bit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agogem_(cpu|prw)_concurrent_blit: Add contending processes
Chris Wilson [Wed, 14 Aug 2013 10:03:34 +0000 (11:03 +0100)]
gem_(cpu|prw)_concurrent_blit: Add contending processes

Blindly fixed conflicts:
tests/gem_cpu_concurrent_blit.c
tests/gem_prw_concurrent_blit.c

11 years agogem_write_read_ring_switch: Copy the missing igt_require
Chris Wilson [Wed, 14 Aug 2013 07:17:22 +0000 (08:17 +0100)]
gem_write_read_ring_switch: Copy the missing igt_require

An oversight in the mass conversion to the new framework as the test was
called from two locations.

Ideally, the checks could be moved back to the caller and the framework
still work. This is just the patch of least resistence.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68091

11 years agogem_exec_lut_handle: Use linear regression analysis
Chris Wilson [Tue, 13 Aug 2013 22:51:09 +0000 (23:51 +0100)]
gem_exec_lut_handle: Use linear regression analysis

Simultaneously make the results more robust and compact by performing a
linear regression to compute the amount of time required to perform the
exec array walk and the relocations.

11 years agolib/drmtest: Don't run the rude interruptor when just listing subtests
Daniel Vetter [Tue, 13 Aug 2013 21:05:51 +0000 (23:05 +0200)]
lib/drmtest: Don't run the rude interruptor when just listing subtests

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agoconfigure: require libdrm 2.4.45
Daniel Vetter [Tue, 13 Aug 2013 18:07:32 +0000 (20:07 +0200)]
configure: require libdrm 2.4.45

We've started to use the VEBOX defines.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: introduce igt_require
Daniel Vetter [Tue, 13 Aug 2013 11:20:58 +0000 (13:20 +0200)]
tests: introduce igt_require

Since igt_skip has funny control flow we can abuse it and make it work
like a special kind of assert which automatically skips tests if a
requirement fails.

Note that in places where we have a less strict test which should
always succeed (e.g. ioctl works or isn't available) the igt_assert
should be place before the igt_require with the more strict
requirements. Otherwise we'll skip a test instead of properly failing
it.

Convert a few users of igt_skip over to igt_require to showcase its
use.

v2: s/gem_check_/gem_require_/ so that we consistently use "require"
to indicate magic check that can call igt_skip. Imo hiding the
igt_require for feature checks is ok, but for more traditional assert
like use cases an explicit igt_require might be better.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: use igt_fail instead of exit(param != 0)
Daniel Vetter [Tue, 13 Aug 2013 10:56:06 +0000 (12:56 +0200)]
tests: use igt_fail instead of exit(param != 0)

Mostly a sed job with too manual fixups:
- one case of using _exit instead of exit
- and one case which under some conditions use 77, so convert that
  check to an igt_skip.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: s/exit(77)/igt_skip()/
Daniel Vetter [Tue, 13 Aug 2013 10:51:35 +0000 (12:51 +0200)]
tests: s/exit(77)/igt_skip()/

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: s/exit(EXIT_SUCCESS)/igt_success()/
Daniel Vetter [Tue, 13 Aug 2013 10:50:39 +0000 (12:50 +0200)]
tests: s/exit(EXIT_SUCCESS)/igt_success()/

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: s/exit(EXIT_FAILURE)/igt_fail(1)/
Daniel Vetter [Tue, 13 Aug 2013 10:49:46 +0000 (12:49 +0200)]
tests: s/exit(EXIT_FAILURE)/igt_fail(1)/

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_readwrite: convert to subtests
Daniel Vetter [Tue, 13 Aug 2013 10:45:14 +0000 (12:45 +0200)]
tests/gem_readwrite: convert to subtests

A bit lazy since the read/write tests are all smashed together. But
since we have really evil partial write/read tests for coherency
checking that doesn't matter that much really.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_ctx_bad_exec: convert to subtests
Daniel Vetter [Tue, 13 Aug 2013 10:41:20 +0000 (12:41 +0200)]
tests/gem_ctx_bad_exec: convert to subtests

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: s/assert/igt_assert
Daniel Vetter [Tue, 13 Aug 2013 10:35:58 +0000 (12:35 +0200)]
tests: s/assert/igt_assert

Just a wholesale rollout for now, we can refine later on.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: roll out igt_assert
Daniel Vetter [Tue, 13 Aug 2013 09:56:24 +0000 (11:56 +0200)]
lib/drmtest: roll out igt_assert

I've left the asserts as-is where they check for tests that use the
infrastructure in drmtest.c incorrectly. That way piglit's
differentiation between a failed testcase and a crashing testcase
should be more useful.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: add igt_assert as a replacement for assert
Daniel Vetter [Tue, 13 Aug 2013 09:52:01 +0000 (11:52 +0200)]
lib/drmtest: add igt_assert as a replacement for assert

The aim is that we keep on running subtests even when a not-too-lethal
assert failed in a subtest. To make that useful also print per-subtest
test results from igt_skip|fail|success functions.

If required we can always go googletest-nuts with different types of
asserts later on, but I think for now we're good with what we have
here.

v2: Also print out proper SKIP message when skipping all subsequent
tests since a global (i.e. outside of a subtest) init step failed and
resulted in an igt_skip call.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: fixup igt_fail for the list-only case
Daniel Vetter [Tue, 13 Aug 2013 09:40:57 +0000 (11:40 +0200)]
lib/drmtest: fixup igt_fail for the list-only case

Oops.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: add drm_get_client_auth
Daniel Vetter [Thu, 8 Aug 2013 07:32:05 +0000 (09:32 +0200)]
tests: add drm_get_client_auth

To check we don't break the magic authentication check libva does.

Ugh.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: scrap old automake based kernel test runner
Daniel Vetter [Mon, 12 Aug 2013 12:02:03 +0000 (14:02 +0200)]
tests: scrap old automake based kernel test runner

Upstream broke our dynamic creation of the testlist, and I think
adding stupid .tests suffixes everywhere just to appease upstream
autohell tools isn't that great. So scrap it, we can use piglit
instead.

References: https://lists.gnu.org/archive/html/help-debbugs/2013-06/msg00000.html
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: s/return igt_retval();/igt_exit();/
Daniel Vetter [Mon, 12 Aug 2013 10:26:35 +0000 (12:26 +0200)]
tests: s/return igt_retval();/igt_exit();/

Requested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agos/drmtest_/igt_/
Daniel Vetter [Mon, 12 Aug 2013 10:17:35 +0000 (12:17 +0200)]
s/drmtest_/igt_/

Requested-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agos/drmtest_subtest_block/drmtest_subtest/
Daniel Vetter [Mon, 12 Aug 2013 10:15:16 +0000 (12:15 +0200)]
s/drmtest_subtest_block/drmtest_subtest/

The _block postfix meant to convey that a C statement/block must
follow can be misread as the verb to block. So drop it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: __ prefix for drmtest_run_subtest
Daniel Vetter [Mon, 12 Aug 2013 09:57:32 +0000 (11:57 +0200)]
lib/drmtest: __ prefix for drmtest_run_subtest

Now that callers must setup the longjmp target (we can't do that in
run_subtest itself since that callframe won't survive) tests shouldn't
call this function directly any more.

Make this clear by adding a __ prefix.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/intel_mmio: Remove unused label
Daniel Vetter [Mon, 12 Aug 2013 08:46:55 +0000 (10:46 +0200)]
lib/intel_mmio: Remove unused label

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: use drmtest_skip to check for rings
Daniel Vetter [Mon, 12 Aug 2013 09:03:29 +0000 (11:03 +0200)]
tests: use drmtest_skip to check for rings

To simplify things add a set of gem_check_<ring> functions which take
care of this. Since I've opted for static inlines drmtest.h grew a few
more header includes which was a neat opportunity to dump a few redundant
#defines.

This kills all the skipped_all hand-rolled logic we have.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: use drmtest_skip() in caching ioctl helpers
Daniel Vetter [Mon, 12 Aug 2013 08:43:59 +0000 (10:43 +0200)]
tests: use drmtest_skip() in caching ioctl helpers

This way we can rip out all the skip handling from the test control flow,
and additionally (by using drmtest_retval()) even get correct exit codes.

The only tricky part is that when we only want ot skip parts of a test
(like for gem_pread and gem_pwrite) we need to split out those parts as
subtests. But no addition of control-flow is required, the set/longjmp
magic in the helpers all makes it happen.

Also we make extensive use of the behaviour of drmtest_skip to skip
all subsequent subtests if it is called outside of a subtest. This allows
us to re-flatten the control flow a lot.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: make signal process cleanup more robust
Daniel Vetter [Mon, 12 Aug 2013 08:39:33 +0000 (10:39 +0200)]
lib/drmtest: make signal process cleanup more robust

If we skip a test and and fail somewhere the parent might die before the
child. So add some cleanup to handle this case. Also make sure that the
parent indeed waits for the child to die.

This is required to make the latest version of the piglit runner happy,
it tends to wait for all zombies to disappear.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_caching: convert to use drmtest retval infrastructure
Daniel Vetter [Mon, 12 Aug 2013 07:49:25 +0000 (09:49 +0200)]
tests/gem_caching: convert to use drmtest retval infrastructure

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: skip/fail handling
Daniel Vetter [Mon, 12 Aug 2013 07:31:55 +0000 (09:31 +0200)]
lib/drmtest: skip/fail handling

Exitcode handling in igt testcases has too ugly facets in combination
with subtests:

- When individual subtest needed to be skipped for different reasons
  we need to painstakingly thread this information through the test to
  make sure that we still succeed if just one testcase worked (for
  running it with the simple automake test runner in igt). But it also
  needs to correctly report the skip exit value if only this one
  skipped testcase has been run (e.g. when run with piglit or in QA's
  test infrastructure).

- We'd prefer to easily skip (and also fail) subtests without
  hampering other subtests. Again threading the return value of each
  subtest through the code is cumbersome.

To simplify test case writing use longjmps to be able to get out of
subcases easily. But since longjmps are funny things thug it all away
into the newly added drmtest_subtest_block macro.

Note that if drmtest_skip is called outside of a subtest, but in a
testcase with subtests all subsequent subtests will be automatically
skipped.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agolib/drmtest: Add drmtest_subtest_block macro
Daniel Vetter [Mon, 12 Aug 2013 07:04:24 +0000 (09:04 +0200)]
lib/drmtest: Add drmtest_subtest_block macro

Doesn't do more than an if (drmtest_run_test(name)) right now, but
as soon as we get a bit of infrastructure to handle test failures and
skipping, this will get more interesting.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: s/cacheing/caching
Daniel Vetter [Mon, 12 Aug 2013 06:41:05 +0000 (08:41 +0200)]
tests: s/cacheing/caching

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agogem_pwrite: Print the cache name not the number
Chris Wilson [Mon, 12 Aug 2013 07:39:26 +0000 (08:39 +0100)]
gem_pwrite: Print the cache name not the number

Bugzilla: https://bugzilla.freedesktop.org/show_bug.cgi?id=68003

11 years agoExpand gem_set_cacheing testing to handle the proposed DISPLAY domain
Chris Wilson [Sat, 10 Aug 2013 14:49:33 +0000 (15:49 +0100)]
Expand gem_set_cacheing testing to handle the proposed DISPLAY domain

11 years agointel_error_decode: First try /sys/drm/card0/error for the error-state
Chris Wilson [Wed, 7 Aug 2013 22:41:54 +0000 (23:41 +0100)]
intel_error_decode: First try /sys/drm/card0/error for the error-state

As the sysfs is almost always mounted and readable, we have a higher
success rate checking for our error state there than in debugfs.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
11 years agotests/prime_self_import: fix comment
Daniel Vetter [Wed, 7 Aug 2013 12:54:00 +0000 (14:54 +0200)]
tests/prime_self_import: fix comment

11 years agotests/prime_self_import: Fixup previuos test
Daniel Vetter [Wed, 7 Aug 2013 16:36:31 +0000 (18:36 +0200)]
tests/prime_self_import: Fixup previuos test

... not a great display of my prowess here.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/prime_self_import: Add a flink/dma-buf self-import test
Daniel Vetter [Wed, 7 Aug 2013 16:12:20 +0000 (18:12 +0200)]
tests/prime_self_import: Add a flink/dma-buf self-import test

This checks that we really always fill the dma-buf export cache. Which
sometimes we don't.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: update .gitignore
Daniel Vetter [Wed, 7 Aug 2013 10:01:35 +0000 (12:01 +0200)]
tests: update .gitignore

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_pwrite_pread: subtest annotation
Daniel Vetter [Wed, 7 Aug 2013 09:59:05 +0000 (11:59 +0200)]
tests/gem_pwrite_pread: subtest annotation

This testcase mixes correctnes tests with performance tests, so it's
good to track the different correctness test separate for QA.

Together with pread_after_blt the pwrite->blt tests here exercise the
full cache coherency lifecycle of both snooped and uncached objects.

/me is happy

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests: add gem_prw_concurrent_blt
Daniel Vetter [Tue, 6 Aug 2013 20:27:37 +0000 (22:27 +0200)]
tests: add gem_prw_concurrent_blt

New testcase to check that pwrite/pread correctly synchronize with
oustanding rendering. Just to catch regressions when we change
something.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/prime_self_import: Add racing handle2fd testcase
Daniel Vetter [Thu, 25 Jul 2013 19:09:43 +0000 (21:09 +0200)]
tests/prime_self_import: Add racing handle2fd testcase

Similar to how we test flink races. Note that on unfixed kernels this
oopses, and with my current set of patches it still leaks like mad.

v2: Only close the prime fd if we've successfully created it.

v3: Add a reimport test to check whether we don't race when reaping
the obj->dma_buf link.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
11 years agotests/gem_flink_race: Kill duplicate drm_open_any
Daniel Vetter [Thu, 25 Jul 2013 20:10:51 +0000 (22:10 +0200)]
tests/gem_flink_race: Kill duplicate drm_open_any

Leak test that leaks ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>