platform/upstream/intel-gpu-tools.git
10 years agooverlay: Fix counting fail
Chris Wilson [Tue, 20 Aug 2013 09:58:02 +0000 (10:58 +0100)]
overlay: Fix counting fail

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agooverlay: Add graph for GPU power consumption
Chris Wilson [Tue, 20 Aug 2013 09:04:23 +0000 (10:04 +0100)]
overlay: Add graph for GPU power consumption

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agooverlay: Add rc6 residency
Chris Wilson [Tue, 20 Aug 2013 08:27:34 +0000 (09:27 +0100)]
overlay: Add rc6 residency

Not much point at the moment since we use forcewake to continuously
probe the GPU busyness. But that will eventually change to a more
power-efficient in-kernel.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotests/gem_concurrent_blit: Fix segmentation fault
Daniel Vetter [Tue, 20 Aug 2013 04:39:43 +0000 (06:39 +0200)]
tests/gem_concurrent_blit: Fix segmentation fault

Apparently the simple changes introduced in

commit 78865847f9fae7e590960f9836f2ec8b611a190e
Author:     Daniel Vetter <daniel.vetter@ffwll.ch>
AuthorDate: Mon Aug 19 07:23:49 2013 +0200
Commit:     Daniel Vetter <daniel.vetter@ffwll.ch>
CommitDate: Mon Aug 19 08:09:25 2013 +0200

    lib/drmtest: skip fixtures after an igt_skip

pushed the stack space requirement for run_modes over some magic limit
(I guess where the strack grow logic starts to fail, but I didn't
check). Fix this by moving the data into .bss.

Also add some asserts to check that fixtures aren't abused while at
it (i.e. the useful parts of my debug printf/assert craze).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68299
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agooverlay: Wrap the colour index around the rgba array
Chris Wilson [Mon, 19 Aug 2013 22:29:08 +0000 (23:29 +0100)]
overlay: Wrap the colour index around the rgba array

And stop assigning colours beyond the end of the array. Still needs a
better method for colour assignment, big list of good colours & ida?

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agooverlay: Add missing include "debugfs.h"
Chris Wilson [Mon, 19 Aug 2013 21:26:01 +0000 (22:26 +0100)]
overlay: Add missing include "debugfs.h"

Later versions of gcc are apparently stricter.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agooverlay: Auatomatically mount debugfs
Chris Wilson [Mon, 19 Aug 2013 17:15:04 +0000 (18:15 +0100)]
overlay: Auatomatically mount debugfs

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoquick_dump/bdw: use hex() to convert devid to hex string in error message
Mengdong Lin [Mon, 19 Aug 2013 00:36:03 +0000 (20:36 -0400)]
quick_dump/bdw: use hex() to convert devid to hex string in error message

This patch is to avoid the error on device auto-detection failure
"TypeError: Can't convert 'int' object to str implicitly".

Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
10 years agotests: add kms_setmode
Imre Deak [Wed, 31 Jul 2013 08:59:38 +0000 (11:59 +0300)]
tests: add kms_setmode

Iterate through all valid/invalid crtc/connector combinations. At the
moment only clone configurations are tested as the single output cases
are tested already by testdisplay. Also from combinations where all
connectors are on the same crtc (clone-single-crtc) only those are
tested that are invalid, as I haven't found any machine that supports
these (have to be GT2 with dvo and vga output).

For configurations with one crtc per connector the FBs are per-crtc atm.

Signed-off-by: Imre Deak <imre.deak@intel.com>
10 years agolib: add subtest extra command line option handling
Imre Deak [Fri, 2 Aug 2013 23:10:11 +0000 (02:10 +0300)]
lib: add subtest extra command line option handling

At the moment any command line option handling done by tests will
interfere with the option handling of the subtest interface. To fix this
add a new version of the subtest_init function accepting optional short
and long command line options. Merge these together with the subtest
interface's own long options and handle both together in the same
getopt_long call.

Signed-off-by: Imre Deak <imre.deak@intel.com>
10 years agolib: handle SIGSEGV similarly to other error signals
Imre Deak [Fri, 2 Aug 2013 14:13:37 +0000 (17:13 +0300)]
lib: handle SIGSEGV similarly to other error signals

Signed-off-by: Imre Deak <imre.deak@intel.com>
10 years agolib: shorten DP/eDP connector names
Imre Deak [Fri, 2 Aug 2013 14:13:21 +0000 (17:13 +0300)]
lib: shorten DP/eDP connector names

Signed-off-by: Imre Deak <imre.deak@intel.com>
10 years agolib: export kmstest_get_connector_default_mode
Imre Deak [Thu, 1 Aug 2013 12:08:19 +0000 (15:08 +0300)]
lib: export kmstest_get_connector_default_mode

Signed-off-by: Imre Deak <imre.deak@intel.com>
10 years agolib/drmtest: igt_skip when drm_get_card fails
Daniel Vetter [Mon, 19 Aug 2013 09:09:25 +0000 (11:09 +0200)]
lib/drmtest: igt_skip when drm_get_card fails

Also add printf support to igt_skip to make sure there's always a
reason why we fail a testcase.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/drmtest: extract gem_create_context
Daniel Vetter [Mon, 19 Aug 2013 08:55:28 +0000 (10:55 +0200)]
lib/drmtest: extract gem_create_context

libdrm requirements are now up to it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests: roll out igt_require some more
Daniel Vetter [Mon, 19 Aug 2013 08:47:53 +0000 (10:47 +0200)]
tests: roll out igt_require some more

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/drmtest: rip out drm_open_any_master
Daniel Vetter [Mon, 19 Aug 2013 08:34:34 +0000 (10:34 +0200)]
lib/drmtest: rip out drm_open_any_master

It's unused. Also most of our tests failed to ask for the right type
of drm fd anyway. So it's imo better to just let them fall over when
they don't get master but want it, like they already do today.

This also allows us to garbage-collect the master parameter to
drm_get_card and associated code.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/drmtest: Properly skip if no intel gfx supported
Daniel Vetter [Mon, 19 Aug 2013 05:57:03 +0000 (07:57 +0200)]
lib/drmtest: Properly skip if no intel gfx supported

drm/* kernel test nirvana!

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/drmtest: make igt_fail work outside of subtests
Daniel Vetter [Mon, 19 Aug 2013 05:28:42 +0000 (07:28 +0200)]
lib/drmtest: make igt_fail work outside of subtests

With the abortable fixtures we can now correctly fail all subsequent
sutbests if we hit upon an igt_assert outside of a subtest.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/drmtest: skip fixtures after an igt_skip
Daniel Vetter [Mon, 19 Aug 2013 05:23:49 +0000 (07:23 +0200)]
lib/drmtest: skip fixtures after an igt_skip

This way we can just enclose all igt_skip/igt_require calls into
fixtures even when we have subtests, and still output correct SKIP
message for all of them. Wohoo, magic!

The only thing which doesn't work yet is enumerating failed subtests,
but I think that should work out on top of this.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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.

10 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

10 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

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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.

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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

10 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

10 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.

10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>
10 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>