profile/extras/intel-gpu-tools.git
10 years agokms_cursor_crc: Add background picture
Antti Koskipaa [Thu, 10 Apr 2014 12:08:12 +0000 (15:08 +0300)]
kms_cursor_crc: Add background picture

This gives the cursor something to be on, instead of just a black
background. Slows the test down only one second over six minutes.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
10 years agokms_cursor_crc: Add random cursor placement test
Antti Koskipaa [Thu, 10 Apr 2014 12:08:11 +0000 (15:08 +0300)]
kms_cursor_crc: Add random cursor placement test

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
10 years agokms_cursor_crc: Add moving cursor test
Antti Koskipaa [Thu, 10 Apr 2014 12:08:10 +0000 (15:08 +0300)]
kms_cursor_crc: Add moving cursor test

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
10 years agokms_cursor_crc: Add reference software rendering
Antti Koskipaa [Thu, 10 Apr 2014 12:08:09 +0000 (15:08 +0300)]
kms_cursor_crc: Add reference software rendering

This patch first render the cursor with hardware rendering and
then with software, acquiring the CRC in both cases so they can be
properly compared. Say goodbye to crc_must_match variable.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
10 years agokms_cursor_crc: Separate onscreen and offscreen tests
Antti Koskipaa [Thu, 10 Apr 2014 12:08:08 +0000 (15:08 +0300)]
kms_cursor_crc: Separate onscreen and offscreen tests

Also remove onscreen boolean from parameter list. All test-related
data should be put into test_data from now.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
10 years agokms_cursor_crc: Use a function pointer to call test
Antti Koskipaa [Thu, 10 Apr 2014 12:08:07 +0000 (15:08 +0300)]
kms_cursor_crc: Use a function pointer to call test

More tests are coming, and this allows us to not repeat the boilerplate
code in run_test() for each subtest.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
10 years agokms_cursor_crc: Move cursor enable and disable calls where they belong
Antti Koskipaa [Thu, 10 Apr 2014 12:08:06 +0000 (15:08 +0300)]
kms_cursor_crc: Move cursor enable and disable calls where they belong

We can't have the hw cursor enabled during software render tests.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
[vsyrjala: collect the crc before disalbing the cursor]
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
10 years agokms_cursor_crc: Remove some test cases and change cursor to color
Antti Koskipaa [Thu, 10 Apr 2014 12:08:05 +0000 (15:08 +0300)]
kms_cursor_crc: Remove some test cases and change cursor to color

Currently this test is quite useless, since it only checks for valid CRCs when
the correct output from a test is a completely black screen (invisible or visible
but black cursor, or cursor is offscreen) and disables the check when anything
visible is onscreen.

This patch changes the cursor to a colorful one and removes the test cases
that become redundant because of this change. The cursor is designed to be
asymmetrical such that future tests involving rotation, mirroring, etc. produce
different CRCs and failures can be detected.

This (temporarily) disables CRC testing until the next patch which will add
software rendering of the cursor and the CRC generation.

Signed-off-by: Antti Koskipaa <antti.koskipaa@linux.intel.com>
10 years agoReset errno to 0 after success
Chris Wilson [Fri, 25 Apr 2014 06:40:34 +0000 (07:40 +0100)]
Reset errno to 0 after success

errno is only valid after a syscall wrapper (e.g. ioctl()) reports an
error. However, we report the last errno value as a part of the
igt_assert() output and so we display spurious values such as:

Test requirement not met in function gem_require_ring, file ioctl_wrappers.c:802:
Last errno: 11, Resource temporarily unavailable
Test requirement: (!((((intel_get_drm_devid(fd)) == 0x0102 || ...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agobenchmarks: Build them on Android.
Tvrtko Ursulin [Wed, 23 Apr 2014 16:03:23 +0000 (17:03 +0100)]
benchmarks: Build them on Android.

They build fine so give them some exposure.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agotests: Extract ALIGN macro into a common header
Tvrtko Ursulin [Wed, 23 Apr 2014 15:07:55 +0000 (16:07 +0100)]
tests: Extract ALIGN macro into a common header

Makes for a little bit less code duplication, especially since
it will be used from more callers in the future.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agotests: Skip building kms_flip_tiling on Android
Tvrtko Ursulin [Wed, 23 Apr 2014 15:02:47 +0000 (16:02 +0100)]
tests: Skip building kms_flip_tiling on Android

Dependencies are not available at the moment so it does not build.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agotests/gem_exec_params: Fix rel-constants-invalid subtest
Daniel Vetter [Thu, 24 Apr 2014 08:43:38 +0000 (10:43 +0200)]
tests/gem_exec_params: Fix rel-constants-invalid subtest

Reported by Ville and Zhao Yakui.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_dummy_reloc_loop: Add one subtest based on multi drm_fd to test CPU<->GPU...
Zhao Yakui [Thu, 24 Apr 2014 02:15:45 +0000 (10:15 +0800)]
tests/gem_dummy_reloc_loop: Add one subtest based on multi drm_fd to test CPU<->GPU sync under multi BSD rings

The Broadwell GT3 machine has two independent BSD rings in kernel driver while
it is transparent to the user-space driver. In such case it needs to check
the CPU<->GPU sync for the second BSD ring.

V1->V2: Follow Daniel's comment to add one subtext instead of one individual
test case, which is used to test the CPU<->GPU sync under multi BSD rings.

V2->V3: Follow Imre's comment to remove the unnecessary initialization and
use igt_assert_f instead of igt_assert

Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests: Add one ring sync case based on multi drm_fd to test ring semaphore sync under...
Zhao Yakui [Thu, 24 Apr 2014 02:15:44 +0000 (10:15 +0800)]
tests: Add one ring sync case based on multi drm_fd to test ring semaphore sync under multi BSD rings

The Broadwell GT3 machine has two independent BSD rings in kernel driver while
it is transparent to the user-space driver. In such case it needs to check
the ring sync between the two BSD rings. At the same time it also needs to
check the sync among the second BSD ring and the other rings.

V2->V3: Follow Imre's comment to remove the unnecessary initialization and
use igt_assert_f instead of igt_assert.

V3->V4: Add gem_multi_bsd_sync_loop.c into the tests/.gitignore

Reviewed-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests: Add gem_exec_params
Daniel Vetter [Wed, 23 Apr 2014 18:23:28 +0000 (20:23 +0200)]
tests: Add gem_exec_params

This fills all the gaps we've had in our execbuf testing. Overflow
testing of the various arrays is already done by gem_reloc_overflow.

Also add kms_flip_tiling to .gitignore.

This will cause a bunch of failures since current kernels don't catch
all fallout.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoAdd gem_render_copy_redux
Chris Wilson [Thu, 24 Apr 2014 06:58:09 +0000 (07:58 +0100)]
Add gem_render_copy_redux

This is an "advanced" form of the the simple gem_render_copy test.
Instead of aiming for maximal simplicity to aide debugging of new
rendercopy backends, this test aims to exercise the execbuf interface
using the render ring.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agolib: Fix potential out of bounds access in ring stop code
Ville Syrjälä [Wed, 16 Apr 2014 14:05:43 +0000 (17:05 +0300)]
lib: Fix potential out of bounds access in ring stop code

The subsequet code expects the read() to not have filled the entire
buffer, and yet we allow it to do so. Reduce the size passed to read()
by 1 to make the code sane.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
10 years agolib: Fix assert failure in ring stop code
Ville Syrjälä [Wed, 16 Apr 2014 14:07:07 +0000 (17:07 +0300)]
lib: Fix assert failure in ring stop code

The assert in igt_set_stop_rings() is a bit bogus. Suppsoedly it was
meant to assure that the caller always restores the rings to running
state after stopping them. But in its current form it will trigger
any time someone calls the function and the rings were already stopped.
So you can't even restore the rings to running state w/o the assert
triggering.

Fix it up so that it'll ignore the current ring state when we're trying
to restore the rings back to running state.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
10 years agotests: Compile all the tests
Ville Syrjälä [Mon, 14 Apr 2014 13:23:18 +0000 (16:23 +0300)]
tests: Compile all the tests

A bunch of the tests aren't being built due to a missing '\'. Fix it.

The problem was introduced here:
 commit ddf8cc107e3b78e4c8200b083ed298c24eec1f03
 Author: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
 Date:   Wed Apr 2 15:31:38 2014 +0300

    test: Add test for checking if page flip changes tiling

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
10 years agotests/kms_flip_tiling: Fixes
Daniel Vetter [Fri, 11 Apr 2014 14:16:31 +0000 (16:16 +0200)]
tests/kms_flip_tiling: Fixes

- Wrap up testcase correctly into the magic code block.
- Put local variables out of the longjmp danger zone.

Cc: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotest: Add test for checking if page flip changes tiling
Ander Conselvan de Oliveira [Wed, 2 Apr 2014 12:31:38 +0000 (15:31 +0300)]
test: Add test for checking if page flip changes tiling

Test that a page flip from a tiled buffer to a linear one works
correctly. First, it sets the crtc with the linear buffer andr
generate a reference crc for the pipe. Then, the crtc is set with
the tiled one and page flip to the linear one issued. A new crc is
generated and compared to the rerence one.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
10 years agolib/kmstest: Fix up tiled buffer creation
Daniel Vetter [Tue, 11 Mar 2014 15:14:33 +0000 (16:14 +0100)]
lib/kmstest: Fix up tiled buffer creation

When extracting a raw __gem_set_tiling helper I've fumbled this in

commit 590f6101402b51bca54f69c002380bda967484ea
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Wed Oct 9 20:50:50 2013 +0200

    lib/drmtest: extract rawer __gem_set_tiling

Fix things up so that we properly propaget the error again.

Now to make this all properly work we also need to make kms_flip a
notch more robust against such failures ...

This only blows up on gen2/3 with the pan tests which want a too wide
framebuffer for tiling.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_reset_stats: fix length check in inject_hang
Mika Kuoppala [Thu, 10 Apr 2014 14:51:39 +0000 (17:51 +0300)]
tests/gem_reset_stats: fix length check in inject_hang

To avoid writing past the batch end.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
10 years agotests/gem_reset_stats: check gpu state before each subtest
Mika Kuoppala [Fri, 28 Mar 2014 13:12:14 +0000 (15:12 +0200)]
tests/gem_reset_stats: check gpu state before each subtest

Some tests, namely the close pending variety, tries to
carefully drop all handles to gpu when hang is intruduced,
to expose bugs in reset handling without any clients.

Add guards after and before tests to really know if
the gpu is still alive as the particular test might
report success and then gpu dies few seconds after.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
10 years agolib/drmtest: don't dup quiescent fd
Mika Kuoppala [Fri, 28 Mar 2014 08:52:46 +0000 (10:52 +0200)]
lib/drmtest: don't dup quiescent fd

If we dup the fd, we are in mercy of the context banning
of the test application. Better to have our own to guarantee
that gem_quiescent_gpu won't find itself banned on exit.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
10 years agotests: use lib igt_[get|set]_stop_rings()
Mika Kuoppala [Tue, 25 Mar 2014 10:52:19 +0000 (12:52 +0200)]
tests: use lib igt_[get|set]_stop_rings()

on gem_reset_stats, kms_flip and pm_rps.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=75876
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
10 years agolib: add igt_get_stop_rings and igt_set_stop_rings
Mika Kuoppala [Tue, 25 Mar 2014 10:21:44 +0000 (12:21 +0200)]
lib: add igt_get_stop_rings and igt_set_stop_rings

Multiple tests are introducing hangs by fidding with i915_ring_stop
debugfs entry.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
10 years agotests/gem_reset_stats: end hanging batch properly
Mika Kuoppala [Thu, 10 Apr 2014 13:06:27 +0000 (16:06 +0300)]
tests/gem_reset_stats: end hanging batch properly

As we use chained batch into itself to hang the gpu, there
was no need to end the batchbuffer with BATCH_BUFFER_END.

With the introduction of command parser, the batch
need to have proper BATCH_BUFFER_END in it or it
will be rejected.

While at it, shift the upper half of batch gtt_offset
accordingly with gen8+

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
10 years agotests/gem_exec_parse: Test for OACONTROL tracking
Brad Volkin [Thu, 27 Mar 2014 18:44:45 +0000 (11:44 -0700)]
tests/gem_exec_parse: Test for OACONTROL tracking

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agogem_tiled_swapping: Test using all available fences
Chris Wilson [Mon, 7 Apr 2014 12:10:41 +0000 (13:10 +0100)]
gem_tiled_swapping: Test using all available fences

Use extra threads to cause extra memory pressure and stress upon the
relevant code. Limit the number of threads to available fences to avoid
falling off the fence cliff.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agogem_tiled_swapping: Purge all page/swap caches first
Chris Wilson [Mon, 7 Apr 2014 12:09:46 +0000 (13:09 +0100)]
gem_tiled_swapping: Purge all page/swap caches first

Reset the system to a vanilla state before we query how much RAM/swap
space is available for our testing.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-gpu-overlay: Update debugfs path for min/max frequency
Chris Wilson [Mon, 7 Apr 2014 11:07:14 +0000 (12:07 +0100)]
intel-gpu-overlay: Update debugfs path for min/max frequency

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotools/intel_reg_dumper: use haswell_debug_regs on BDW too
Paulo Zanoni [Fri, 4 Apr 2014 16:24:53 +0000 (13:24 -0300)]
tools/intel_reg_dumper: use haswell_debug_regs on BDW too

Instead of using an older set of registers.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agotests/pm_pc8: skip tests when no screens are connected
Paulo Zanoni [Fri, 4 Apr 2014 16:22:56 +0000 (13:22 -0300)]
tests/pm_pc8: skip tests when no screens are connected

Instead of failing, just skip the tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73642
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agotests/pm_pc8: add missing newline
Paulo Zanoni [Mon, 31 Mar 2014 20:01:59 +0000 (17:01 -0300)]
tests/pm_pc8: add missing newline

Otherwise the output will get even more confusing.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agotests/gem_cmd_parse: restrict to gen7
Daniel Vetter [Thu, 3 Apr 2014 16:03:21 +0000 (18:03 +0200)]
tests/gem_cmd_parse: restrict to gen7

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76982
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agogem_tiled_swapping: Limit to available memory
Chris Wilson [Thu, 3 Apr 2014 08:43:58 +0000 (09:43 +0100)]
gem_tiled_swapping: Limit to available memory

If there is not enough free RAM+swap for us to execute our test, we will
hit OOM, so check first.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agolib/rendercopy: fix alloc len for gen7_bind_buf
Mika Kuoppala [Wed, 2 Apr 2014 12:13:21 +0000 (15:13 +0300)]
lib/rendercopy: fix alloc len for gen7_bind_buf

Fortunately saved by the alignment.

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
10 years agotests: create files that list the available tests
Thomas Wood [Wed, 2 Apr 2014 10:41:43 +0000 (11:41 +0100)]
tests: create files that list the available tests

Add Makefile targets to create two text files containing the list of
available single and multi-test programs. This enables the tests to be
enumerated without requiring the build system.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agointel-gpu-tools: avoid include of cairo.h on Android builds
tgore [Mon, 31 Mar 2014 10:55:40 +0000 (11:55 +0100)]
intel-gpu-tools: avoid include of cairo.h on Android builds

A recent commit means igt_debugfs.c now needs to include igt_kms.h,
which in turn includes igt_fb.h and hence cairo.h.
We need to avoid this inclusion of cairo.h when building for Android,
(until we have a cairo port) so I have added a #ifndef around it.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotools/quick_dump: Fix make distcheck
Daniel Vetter [Fri, 28 Mar 2014 16:54:58 +0000 (17:54 +0100)]
tools/quick_dump: Fix make distcheck

Someone really needs to fix this Makefile ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agointel-gpu-tools: fix some include path problems on android builds
tgore [Fri, 28 Mar 2014 12:54:59 +0000 (12:54 +0000)]
intel-gpu-tools: fix some include path problems on android builds

When building within the android tree (specifically in /external)
the compilation fails due to the wrong versions of some header files
getting picked up. This commit adds some include paths to ensure the
correct headers are found

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agointel-gpu-tools: fix problem with redefinition of mmap64
tgore [Fri, 28 Mar 2014 12:54:58 +0000 (12:54 +0000)]
intel-gpu-tools: fix problem with redefinition of mmap64

In android builds there is no reliable way to determine if mmap64 is defined
or not, and this sometimes leads to a compile error due to its re-defnition.
So this commit avoids its use altogether in intel-gpu-tools for Android builds,
unless the HAVE_MMAP64 macro is defined.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoREADME: update piglit cmd
Daniel Vetter [Thu, 27 Mar 2014 22:04:02 +0000 (23:04 +0100)]
README: update piglit cmd

Pointed out by Jesse.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agointel_infoframes: remove bogus "being transmitted" check from VLV
Jesse Barnes [Thu, 27 Mar 2014 18:10:18 +0000 (11:10 -0700)]
intel_infoframes: remove bogus "being transmitted" check from VLV

This bit is reserved on VLV.

10 years agointel_infoframes: add VLV support
Jesse Barnes [Thu, 27 Mar 2014 18:01:06 +0000 (11:01 -0700)]
intel_infoframes: add VLV support

Different reg offsets and such.

10 years agoquick_dump: Put the cairo cflags with the other cflags.
Ben Widawsky [Thu, 27 Mar 2014 16:56:59 +0000 (09:56 -0700)]
quick_dump: Put the cairo cflags with the other cflags.

I had been hoping we can avoid linking against cairo, but alas it was
not meant to be.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
10 years agotools/quick_dump: re-apply ducttape
Daniel Vetter [Wed, 26 Mar 2014 21:57:52 +0000 (22:57 +0100)]
tools/quick_dump: re-apply ducttape

Someone with actual automake-fu really needs to fix this up for real
since compiling a bunch of source files again, with broken dep
tracking even just because we can't link against a .la somehow really
isn't too awesome.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/pm_rps: Add a new testcase to provoke the "stuck at max" bug
Daniel Vetter [Wed, 26 Mar 2014 21:15:12 +0000 (22:15 +0100)]
tests/pm_rps: Add a new testcase to provoke the "stuck at max" bug

Note that the sleep(5); to fully idle the gpu is _really_ important.
Without it the bug is not exhibited.

The issue at hand is that after gem_quiescent_gpu we are at max
(expected, since the blocking waits peg to max), but then we never go
down to a lower freq again until we're fully idle. The tiny load is
sufficient to keep the gpu at max. I've played around with this a bit
and even ridiculously low loads (like one MI_STORE per 50ms) are
enough to keep the gpu at max freq.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/pm_rps: quiescent harder
Daniel Vetter [Wed, 26 Mar 2014 20:30:17 +0000 (21:30 +0100)]
tests/pm_rps: quiescent harder

Apparently some rps chips are prone to stick to max once you're there.
And all the synchronous waits in gem_quiescent_gpu are _really_ good
at forcing the kernel to go full throttle.

And even a positively tiny load (one MI_STORE_IMM per 50 ms) is enough
to eternally keeep it there, which means the first idle measurement of
the freqs before we do the reset it completely busted.

Just add a wait before the tricky test and call it a day.

Option b) would have been to now have this tiny load, but I think a
good reminder how quirky rps is is always welcome. Just in case we
start sleeping too easy at night.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=74956
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agorendercopy/gen8: Remove a hole in struct gen8_blend_state
Damien Lespiau [Mon, 24 Mar 2014 18:42:39 +0000 (18:42 +0000)]
rendercopy/gen8: Remove a hole in struct gen8_blend_state

Using uint64_t in that second member makes it aligned to 64bits, while
the first member is only 32bits. We then had a 32bits hole in there!

Found-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ben Widawsky <benjamin.widawsky@intel.com>
Cc: Rafael Barbalho <rafael.barbalho@intel.com>
Tested-by: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agotestdisplay: make termio unbuffered
Jesse Barnes [Wed, 26 Mar 2014 18:02:48 +0000 (11:02 -0700)]
testdisplay: make termio unbuffered

So hotkeys take effect immediately.

10 years agolib/igt_fb: api documentation
Daniel Vetter [Wed, 26 Mar 2014 15:37:15 +0000 (16:37 +0100)]
lib/igt_fb: api documentation

Also realign function parameters and replace abort() with igt_fail()
while at it.

v2: Forgotten to add a nice intro.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_fb: setup font in igt_get_cairo_ctx
Daniel Vetter [Wed, 26 Mar 2014 15:36:46 +0000 (16:36 +0100)]
lib/igt_fb: setup font in igt_get_cairo_ctx

We always want the same boring one, so extract it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_fb: drop kmstest_ prefix from static functions
Daniel Vetter [Wed, 26 Mar 2014 15:09:27 +0000 (16:09 +0100)]
lib/igt_fb: drop kmstest_ prefix from static functions

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_kms/bf: doc skeleton
Daniel Vetter [Wed, 26 Mar 2014 14:15:49 +0000 (15:15 +0100)]
lib/igt_kms/bf: doc skeleton

igt_kms docs are just skeleton and also added igt_fb to make sure the
linking works correctly.

Next up: Actually documenting igt_fb.

Also fix that depency spelling fumble I've copied around to a few too
many places.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: fold igt_display into igt_kms
Daniel Vetter [Wed, 26 Mar 2014 09:19:42 +0000 (10:19 +0100)]
lib: fold igt_display into igt_kms

For 1 function and 2 types we kinda don't need separate files.
Especially now that igt_kms is much more focused on the actual modeset
stuff with all the framebuffer helpers extracted to igt_fb.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_fb: switch to igt_ prefix from kmstest_
Daniel Vetter [Wed, 26 Mar 2014 08:18:11 +0000 (09:18 +0100)]
lib/igt_fb: switch to igt_ prefix from kmstest_

Shorter and more in line with our general igt_ prefix for everything
which isn't somehow intel or i915-gem or otherwise hw specific - these
helpers here are all fully generic framebuffer handling functions
based on kms + cairo.

Well, the actual buffer alloc is done with i915 gem, but meh ;-)

Two special cases:
- bpp_depth_to_drm_format and drm_format_to_bpp completely lacked
  prefixes, so just add igt_.
- write_fb was a bit misleading given that we have gem_write for
  uploading to buffers. Rename that to write_fb_to_png to make it
  crystal clear what this thing does even without looking at docs.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: extract igt_fb library
Daniel Vetter [Wed, 26 Mar 2014 08:06:11 +0000 (09:06 +0100)]
lib: extract igt_fb library

Stuff all the framebuffer creation, cairo and drm fourcc format
handling in there. This gives us a very clear cut in the headers where
igt_fb.c only needs to include igt_fb.h, and igt_kms.c includes both
(well igt_kms.h pulls in igt_fb.h since we always need this).

The aim here is to add api docs for igt_fb since that part of the kms
library seems fairly stable already, while all the mode setting and
iteration is still a bit in flux.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agogitignore: Add logfiles from make check
Daniel Vetter [Sun, 23 Mar 2014 15:53:49 +0000 (16:53 +0100)]
gitignore: Add logfiles from make check

A bit annoying to see this stuff around in git status, so exclude it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_kms: make kmstest_get_cairo_surface static
Daniel Vetter [Sun, 23 Mar 2014 15:53:14 +0000 (16:53 +0100)]
lib/igt_kms: make kmstest_get_cairo_surface static

Only used internally in igt_kms.c.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_kms: s/kmstest_create_fb2/kmstest_create_fb/
Daniel Vetter [Sun, 23 Mar 2014 15:52:49 +0000 (16:52 +0100)]
lib/igt_kms: s/kmstest_create_fb2/kmstest_create_fb/

Simplify the name since the old _fb function is now gone.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: remove kmstest_create_fb
Daniel Vetter [Sun, 23 Mar 2014 15:36:40 +0000 (16:36 +0100)]
lib: remove kmstest_create_fb

Use the new-style function using drm fourcc codes instead everywhere.

To easily use thew fourcc based interface also expose
bpp_depth_to_drm_format from the library. Finally include drm_fourcc.h
from the igt_kms.h header since pretty much everyone needs this now.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_aux: Lost doc polish hunk.
Daniel Vetter [Sun, 23 Mar 2014 15:24:38 +0000 (16:24 +0100)]
lib/igt_aux: Lost doc polish hunk.

Oops.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoquick_dump: Fix the danvet fallout.
Ben Widawsky [Tue, 25 Mar 2014 18:35:23 +0000 (11:35 -0700)]
quick_dump: Fix the danvet fallout.

quick_dump built fine, but it could actually run, since a lot of the
linking happens at run time. There is one hack where we redefine the
environment stuff, since depending on igt_aux means we have to pull in
libdrm, which I do not want to do.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
10 years agolib/intel_batchbuffer fix OUT_RELOC doc tag
Mika Kuoppala [Wed, 26 Mar 2014 15:24:43 +0000 (17:24 +0200)]
lib/intel_batchbuffer fix OUT_RELOC doc tag

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
10 years agolib/igt_core: fix igt_skip_on_simulation regression
Daniel Vetter [Wed, 26 Mar 2014 14:09:23 +0000 (15:09 +0100)]
lib/igt_core: fix igt_skip_on_simulation regression

I've forgotten that we might want to call this from within specific
subtests (or special helpers like the autoresume one).

Also props for being competent enough to write a testcase, but
incompetent enough to botch the job up.

Fix both things and remove a leftover debug printf while at it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoREADME: document quirks for regenerating gtk-doc
Daniel Vetter [Tue, 25 Mar 2014 16:46:32 +0000 (17:46 +0100)]
README: document quirks for regenerating gtk-doc

It sucks a bit atm :(

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_exec_parse: fixups for the recent massive refactoring
Daniel Vetter [Tue, 25 Mar 2014 13:23:20 +0000 (14:23 +0100)]
tests/gem_exec_parse: fixups for the recent massive refactoring

I think we might have some use for a do_ioctl_expected_errno or some
such thing. But that's for later.

Cc: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_exec_parse: Test a command crossing a page boundary
Brad Volkin [Wed, 29 Jan 2014 21:58:30 +0000 (13:58 -0800)]
tests/gem_exec_parse: Test a command crossing a page boundary

This is a speculative test in that it's not particularly relevant
today, but is important if we switch the parser implementation to
use kmap_atomic instead of vmap.

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_exec_parse: Test for batches w/o MI_BATCH_BUFFER_END
Brad Volkin [Wed, 29 Jan 2014 21:58:29 +0000 (13:58 -0800)]
tests/gem_exec_parse: Test for batches w/o MI_BATCH_BUFFER_END

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_exec_parse: Add tests for bitmask checks
Brad Volkin [Wed, 29 Jan 2014 21:58:28 +0000 (13:58 -0800)]
tests/gem_exec_parse: Add tests for bitmask checks

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_exec_parse: Add tests for register whitelist
Brad Volkin [Wed, 29 Jan 2014 21:58:27 +0000 (13:58 -0800)]
tests/gem_exec_parse: Add tests for register whitelist

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_exec_parse: Add tests for rejected commands
Brad Volkin [Wed, 29 Jan 2014 21:58:26 +0000 (13:58 -0800)]
tests/gem_exec_parse: Add tests for rejected commands

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests: Add a test for the command parser
Brad Volkin [Wed, 29 Jan 2014 21:58:25 +0000 (13:58 -0800)]
tests: Add a test for the command parser

Start with a simple testcase that should pass.

v2: Switch to I915_PARAM_CMD_PARSER_VERSION

Signed-off-by: Brad Volkin <bradley.d.volkin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_reset_stats: run non hw context tests also on older gens
Mika Kuoppala [Mon, 17 Mar 2014 17:09:23 +0000 (19:09 +0200)]
tests/gem_reset_stats: run non hw context tests also on older gens

To gain more coverage on interface, default context and banning.
As there is no proper reset support for gen <= 3, we only
do limited interface testing on those.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/pm_rps: fixup the blt copy load helper changes
Daniel Vetter [Fri, 14 Mar 2014 15:47:50 +0000 (16:47 +0100)]
tests/pm_rps: fixup the blt copy load helper changes

All suggested by Jeff McGee.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/intel_batchbuffer: document header dependencies
Daniel Vetter [Sun, 23 Mar 2014 14:14:16 +0000 (15:14 +0100)]
lib/intel_batchbuffer: document header dependencies

At least with the core library headers the situation is now fairly
sane. There's still fun stuff going on around *_reg.h and most of the
source files just have a cargo-culted list of headers ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/drmtest: api documentation
Daniel Vetter [Sun, 23 Mar 2014 14:03:14 +0000 (15:03 +0100)]
lib/drmtest: api documentation

Also rename the arguments of do_ioctl a bit for better clarity.

I haven't figured out a way to reference other section headers, hence
the links to igt_core and intel_batchbuffer are a bit fragile
unfortunately. It gets the job done though.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: Use @include tag for include files
Daniel Vetter [Sun, 23 Mar 2014 13:45:13 +0000 (14:45 +0100)]
lib: Use @include tag for include files

Occasionally useful to read documentation ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: s/igt_env_set/igt_check_boolean_env_var
Daniel Vetter [Sun, 23 Mar 2014 13:38:17 +0000 (14:38 +0100)]
lib: s/igt_env_set/igt_check_boolean_env_var

So I wasn't really happy with env_set since it's way too close to
setenv(), whic actually _sets_ and environment variable. So use check
instead of set as the verb (well adjective for env_set).

Also sprinkle in some hints that we talk about a boolean setting here.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_aux: api documentation
Daniel Vetter [Sun, 23 Mar 2014 13:18:23 +0000 (14:18 +0100)]
lib/igt_aux: api documentation

I'm not really happy with the name of the igt_env_set function, I'll
follow up with a patch to change it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: extract igt_aux.[hc]
Daniel Vetter [Sun, 23 Mar 2014 12:35:09 +0000 (13:35 +0100)]
lib: extract igt_aux.[hc]

And shovel all the various helpers in there.

Also move igt_set_vt_graphics_mode to igt_kms.h since the function is
implemented in igt_kms.c. And it fits better. I kinda missed this in
the prep work.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: s/drmtest_dumb_aub/igt_aub_dump_enabled/
Daniel Vetter [Sat, 22 Mar 2014 21:42:35 +0000 (22:42 +0100)]
lib: s/drmtest_dumb_aub/igt_aub_dump_enabled/

This is prep work to extract a new igt aux library with all kinds
of random stuff. Also give it a bit a more suitable name to
indicate that this is just a flag and doesn't do the aub dumping
itself.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/intel_io: api documentation
Daniel Vetter [Sat, 22 Mar 2014 21:41:28 +0000 (22:41 +0100)]
lib/intel_io: api documentation

As usual de-inline functions for gtkdoc to see them.

I've decided to exclude the register map stuff since that's not
terribly interesting.

Aside: gtkdoc falls over when the title of a section contains a slash,
hence why it reads "IO" instead of "I/O". The fun ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/intel_io: rename mmio setup functions
Daniel Vetter [Sat, 22 Mar 2014 21:23:04 +0000 (22:23 +0100)]
lib/intel_io: rename mmio setup functions

Makes their intent a bit clearer.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: rename intel_gpu_tools.h to intel_io.h
Daniel Vetter [Sat, 22 Mar 2014 20:34:29 +0000 (21:34 +0100)]
lib: rename intel_gpu_tools.h to intel_io.h

With the header cleanup we can now give this header a suitable name,
since it now really only contains register access and other I/O
functions and assorted definitions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: unnecessary header removal for drmtest.h, part 2
Daniel Vetter [Sat, 22 Mar 2014 20:29:01 +0000 (21:29 +0100)]
lib: unnecessary header removal for drmtest.h, part 2

I've left unistd.h in it - it's not strictly required but most users
of drmtest.h want it for the open helpers, and then you kinda need to
close that file descriptor again ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: unnecessary header removal for drmtest.h, part 1
Daniel Vetter [Sat, 22 Mar 2014 20:07:37 +0000 (21:07 +0100)]
lib: unnecessary header removal for drmtest.h, part 1

Brought a few missing headers to light in ioctl_wrappers.h, too.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: more unecessary header removal
Daniel Vetter [Sat, 22 Mar 2014 19:18:51 +0000 (20:18 +0100)]
lib: more unecessary header removal

This time big with media_fill.h

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: remove uncessary #includes from headers
Daniel Vetter [Sat, 22 Mar 2014 19:07:35 +0000 (20:07 +0100)]
lib: remove uncessary #includes from headers

Only include what the header itself needs. The big fish here is
intel-gpu-tools.h. More will follow.

One ugly thing removed here is the duplicated GEN6_TD_CTL #define, one
of which was broken.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: add #include "foo.h" lines like in manpages
Daniel Vetter [Sat, 22 Mar 2014 18:35:40 +0000 (19:35 +0100)]
lib: add #include "foo.h" lines like in manpages

Should help in alleviating the header mess we have atm.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests|lib: remove assert.h includes
Daniel Vetter [Sat, 22 Mar 2014 18:27:04 +0000 (19:27 +0100)]
tests|lib: remove assert.h includes

Only the igt core and non-test tools should have asserts to catch
internal errors, tests and helper libraries should all user igt_asert
instead.

Fix things up where assert instead of igt_assert was used.

One tiny step towards header sanity.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: Move non-register things out of intel-gpu-tools.h
Daniel Vetter [Sat, 22 Mar 2014 18:21:26 +0000 (19:21 +0100)]
lib: Move non-register things out of intel-gpu-tools.h

Right now almost everything in there concerns itself with register
access. Move everything else out (into drmtest.h for lack of better
place) to prepare for api documentation.

Also rename intel_drm.c to intel_os.c since it contains OS, not
drm abstractions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/intel_batchbuffer: api documentation for render copy/media fill
Daniel Vetter [Sat, 22 Mar 2014 17:16:30 +0000 (18:16 +0100)]
lib/intel_batchbuffer: api documentation for render copy/media fill

Also fix a fumble in the documentation for intel_blt_copy. One thing
we might want to do is unify the parameter ordering here a bit ...

Again gtkdoc fails to pick up the documentation for struct igt_buf :(

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/intel_batchbuffer: drop cpu_mapping from igt_buf
Daniel Vetter [Sat, 22 Mar 2014 17:04:52 +0000 (18:04 +0100)]
lib/intel_batchbuffer: drop cpu_mapping from igt_buf

It's unused. There's still num_tiles getting in the way of things,
but that is used by gem_stress a bit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/intel_batchbuffer: igt_ prefix for rendercopy/mediafill funcs
Daniel Vetter [Sat, 22 Mar 2014 14:49:02 +0000 (15:49 +0100)]
lib/intel_batchbuffer: igt_ prefix for rendercopy/mediafill funcs

Now everything is prepared to pour some neat api docs over this all.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/intel_batchbuffer: igt_ namespace for the buffer structure
Daniel Vetter [Sat, 22 Mar 2014 14:44:48 +0000 (15:44 +0100)]
lib/intel_batchbuffer: igt_ namespace for the buffer structure

Step one to properly namespace the rendercpy/mediafill functions. Als
give the buf_height/width helpers a proper igt_ prefix.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/intel_batchbuffer: un-inline buf_height/width
Daniel Vetter [Sat, 22 Mar 2014 14:41:42 +0000 (15:41 +0100)]
lib/intel_batchbuffer: un-inline buf_height/width

gtkdoc won't pick them up otherwise.

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