700 Commits

Author SHA1 Message Date
Ville Syrjälä
aba3582bb4 lib/igt_debugfs: Don't fail if debugfs is already mounted
Remove the igt_assert() from the debugfs mount. It will fail if debugfs
is already mounted. With the assert in place it's very annying to use
igt without i915 loaded (eg. to dump BIOS configured registers).

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-06-13 20:28:20 +03:00
Daniel Vetter
87042d671f NEWS: Mention igt.cocci
And also pimp the spatch file itself with usage hints.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:14:13 +02:00
Daniel Vetter
2347e6d21e lib: Introduce igt_fail_on/_f
I've yet again totally screwed things up (this time automated with
cocci even, but not yet pushed luckily). So finally add a new version
for easier conversion and adjust the cocci script.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:14:13 +02:00
Daniel Vetter
46811c849a lib/igt.cocci: Also add rule to use igt_warn_on_f
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:12:42 +02:00
Daniel Vetter
9eb9345f99 lib/igt.cocci: Convert abort() to igt_fail
abort should only be used for internal library checks - using
abort() we get a "crash" result, using igt_fail we get "fail"
in piglit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:12:42 +02:00
Daniel Vetter
bde52d1a08 lib/igt.cocci: Conversion to igt logging
Also update old hunks to match on igt logging instead of fprintf.

v2: Don't forget about perror.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:12:36 +02:00
Daniel Vetter
6b73a9a288 tests: Don't use stderr for informational messages
These should go to stdout instead. The next patch will clean this up
with cocci, so no change from fprintf(stdout, to printf( here.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 18:09:05 +02:00
Daniel Vetter
66b31b6e19 lib: add igt.cocci
Small start but useful to collect refactorings/simplifications for
common igt patterns. Please add more if you stumble over some so that
we can occasionally run this to clean up the tests.

I haven't figured out yet how to do the assert_cmpint->assert_eq
transformation.

Run this with

spatch --sp-file lib/igt.cocci --in-place tests/*.c

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 11:17:22 +02:00
Daniel Vetter
3448b5ad4b lib/igt_core: Add igt_assert_eq
Suggested by Chris Wilson. Not yet rolled out since I'm trying to use
cocci for this.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13 11:17:04 +02:00
Thomas Wood
52a3a2e205 lib: various documentation fixes
Fix some documentation comments and mark some struct members private.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-06-12 10:12:13 +01:00
Thomas Wood
1e5c8780d0 lib: remove /** from comments that are not API documentation
These comments are not gtk-doc comments, so replacing /** with /*
prevents any gtk-doc warnings.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-06-12 10:12:13 +01:00
Daniel Vetter
618aca1fb9 lib/intel_os: Spelling fix
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-12 09:04:45 +02:00
Chris Wilson
210d20f413 API docs for intel_check_memory()
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-10 14:29:27 +01:00
Rodrigo Vivi
82ad15fd10 Fix make distclean by fixing includes of version.h
Actually only the igt_core was breaking the make distcheck,
but let's make it consistent and let the code cleaner.

Credits-to: Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
2014-06-09 11:17:20 -07:00
Chris Wilson
b428f24f7c lib: Add debug to memory limits checks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-06-05 13:34:02 +01:00
Daniel Vetter
5141b21f91 lib/igt_debugfs: Fix spelling docs
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-05 10:29:17 +02:00
Kenneth Graunke
badb026ae0 rendercopy/gen8: Also emit 3DSTATE_WM_DEPTH_STENCIL.
rendercopy was failing to emit 3DSTATE_WM_DEPTH_STENCIL, which is a new
packet on Broadwell.  Mesa emits this packet.

This appears to fix various tests on a fresh boot, when Mesa has never
run.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78890
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78891
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78935
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78936
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78937
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78938
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
Tested-by: Guo Jinxian <jinxianx.guo@intel.com>
Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
2014-06-04 10:54:38 -07:00
Ville Syrjälä
0f906083f2 lib/intel_iosf: add second phy support
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
2014-06-03 22:19:42 +03:00
Mika Kuoppala
d60d4c80e5 tools/null_state_gen: generate null render state
Generate valid (null) render state for each gen. Output
it as a c source file with batch and relocations.

v2: noinst and vs_start fixed for BDW GT3 (Damien Lespiau)

Acked-by: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-06-03 13:49:23 +03:00
Chris Wilson
321273ff76 Factor in kernel object overhead when checking available memory for tests
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-05-28 09:05:57 +01:00
Imre Deak
a6eaa29271 igt/quickdump: vlv: dump FLISDSI regs too
Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-05-19 20:13:15 +03:00
Imre Deak
ad08999794 igt/intel_iosf: rename IOSF sideband opcodes according to the spec
These opcodes are not specific for an endpoint, but are the same for all
endpoints. So rename them accordingly, using the name the VLV2 sideband
HAS uses. Also move the macros to the .c file, since they aren't used
anywhere else.

Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-05-19 20:13:15 +03:00
Oscar Mateo
5bdd4d9b5e lib/igt_fb: igt_create_fb_with_bo_size
Useful for testing bigger/smaller fb-wrapped buffer objects.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-05-16 17:45:14 +03:00
Daniel Vetter
bd521b493e lib/igt_aux: Extract runtime pm helpers from pm_pc8
I want to use them elsewhere ...

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-15 14:25:47 +02:00
Daniel Vetter
831eb21197 lib/igt_core: Fixup docs with symbolic exit codes
Conflict between me and Thomas pushing patches in parallel.

Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-14 15:34:00 +02:00
Thomas Wood
17eb062661 lib: add exit status defines
Add defines for success, skip and timeout exit statuses.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-05-14 12:33:02 +01:00
Thomas Wood
c03d58595e lib: set a timeout when reading crc values
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
2014-05-14 12:33:02 +01:00
Thomas Wood
d8e5313a27 lib: add igt_set_timeout
Add a function to stop and fail a test after the specified number of
seconds have elapsed.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Acked-by: Damien Lespiau <damien.lespiau@intel.com>
2014-05-14 12:33:01 +01:00
Daniel Vetter
126b8ba72f lib/igt_core: Fix type on igt_log doc
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-13 12:28:26 +02:00
Daniel Vetter
1503d17cc5 lib/igt_core: Document testrunner interface a bit
Also fix up one gtkdoc fumble in igt_fb. We should use symbolic
defines if possible instead of just listening the magic 0, 77, 78
values for exit codes, but that's a separate patch.

Cc: tim.gore@intel.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-13 11:29:34 +02:00
Tim Gore
41cbe36bba intel-gpu-tools: Build tests needing cairo if ANDROID_HAS_CAIRO=1
Until now the tests that depended on libcairo were simply
skipped in the android build. Now that I have a cairo port
working, build these cairo dependent tests if ANDROID_HAS_CAIRO
is set to 1 in the environment.
For information on building cairo for IGT on Android see the
wiki at:

https://securewiki.ith.intel.com/display/GFXCore/IGT+Test+Suite+on+Android

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-05-12 18:56:31 +02:00
Chris Wilson
4bd9fe6e34 gem_alive: A utility to see if the driver or GPU has hung 2014-05-05 11:09:30 +01:00
Daniel Vetter
29ee36f259 lib: extract kmstest_set_connector_dpms
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-30 18:07:58 +02:00
Ville Syrjälä
a40f091d81 Add Cherryview PCI IDs
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-04-29 18:39:12 +03:00
Daniel Vetter
e36c896a71 test: Fixup for the previous patch
Oops, failed to git add.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-04-25 17:57:22 +02:00
Chris Wilson
b918a3ba15 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>
2014-04-25 07:45:56 +01:00
Tvrtko Ursulin
dc14bf455d 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>
2014-04-24 13:49:19 +01:00
Ville Syrjälä
78e4c2b449 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>
2014-04-16 19:21:17 +03:00
Ville Syrjälä
4aa2c102b9 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>
2014-04-16 19:21:17 +03:00
Daniel Vetter
cc730c418f 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>
2014-04-13 19:08:17 +02:00
Mika Kuoppala
2f2c491cf3 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>
2014-04-10 17:50:49 +03:00
Mika Kuoppala
bfa6fa9a4b 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>
2014-04-10 17:40:48 +03:00
Chris Wilson
ff7806e52c 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>
2014-04-07 13:12:29 +01:00
Chris Wilson
e8869c4bc4 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>
2014-04-03 09:45:55 +01:00
Mika Kuoppala
b8afe98004 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>
2014-04-02 15:38:55 +03:00
tgore
22bc1a287e 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>
2014-03-31 14:09:29 +02:00
tgore
a96c634076 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>
2014-03-28 17:50:41 +01:00
Damien Lespiau
896b550984 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>
2014-03-26 19:07:02 +00:00
Daniel Vetter
3d9e63f2ad 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>
2014-03-26 18:50:28 +01:00
Daniel Vetter
7568edf4b1 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>
2014-03-26 18:50:28 +01:00