platform/upstream/intel-gpu-tools.git
10 years agoigt/gem_seqno_wrap: Use debugfs singleton
Chris Wilson [Fri, 29 Aug 2014 20:25:14 +0000 (21:25 +0100)]
igt/gem_seqno_wrap: Use debugfs singleton

This has the added advantage of automounting debugfs for us.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoPrepare for 64bit relocation addresses
Chris Wilson [Fri, 29 Aug 2014 14:19:57 +0000 (15:19 +0100)]
Prepare for 64bit relocation addresses

This reveal that quite a few locations were writing relocation offsets
but only allowing for 32 bit addresses. To reveal such places in active
tests, we also now double check that we do not use more batch space than
declared.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_concurrent_blit: Apply some fence pressure as well
Chris Wilson [Fri, 29 Aug 2014 16:36:29 +0000 (17:36 +0100)]
igt/gem_concurrent_blit: Apply some fence pressure as well

As before, we also want to race against access through the fence
registers. This overlaps slightly with gem_set_tiling_vs_blt, but the
different access pattern should make it useful.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt: Tweak the igt_assert_cmpint macro
Chris Wilson [Fri, 29 Aug 2014 16:30:40 +0000 (17:30 +0100)]
igt: Tweak the igt_assert_cmpint macro

Minor tweak to embed the constant format string rather than passing it
to the vararg printf.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agolib/batchbuffer: Guard intel_blt_copy with even more asserts
Chris Wilson [Fri, 29 Aug 2014 18:28:34 +0000 (19:28 +0100)]
lib/batchbuffer: Guard intel_blt_copy with even more asserts

Assert that the source/destination bounds are within the pitch and size
of the associated bo.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agolib/batchbuffer: Store the gen in a local variable
Chris Wilson [Fri, 29 Aug 2014 13:49:59 +0000 (14:49 +0100)]
lib/batchbuffer: Store the gen in a local variable

Reduce lookups and improve code clarity.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoscripts: Add capability to resume interrupted run-tests.sh session
Mike Mason [Tue, 26 Aug 2014 20:31:27 +0000 (13:31 -0700)]
scripts: Add capability to resume interrupted run-tests.sh session

Piglit provides a 'resume' feature that can restart an interrupted
test run at the point where it stopped. This patch adds that
feature to run_tests.sh.

Signed-off-by: Mike Mason <michael.w.mason@intel.com>
[Thomas: remove additional new line from end of file]
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agoigt/gem_concurrent_blit: Add ring race checks
Chris Wilson [Fri, 29 Aug 2014 12:11:37 +0000 (13:11 +0100)]
igt/gem_concurrent_blit: Add ring race checks

Similar to the previous commit, we also want to check that every
pipeline is serialised correctly. This extends the test to include
render copies as well as blits.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_concurrent_blit: Add GPU-vs-GPU checks
Chris Wilson [Fri, 29 Aug 2014 12:11:37 +0000 (13:11 +0100)]
igt/gem_concurrent_blit: Add GPU-vs-GPU checks

In future, we may allow reordering of GPU batches. This implements a
simple race detector by extending the current CPU-vs-GPU checks.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt: Prettify igt_assert_eq() failure messages
Chris Wilson [Fri, 29 Aug 2014 12:11:40 +0000 (13:11 +0100)]
igt: Prettify igt_assert_eq() failure messages

This just improves the language about the exact failure to reduce
confusion.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_workarounds: igt to test workaround registers
Arun Siluvery [Tue, 26 Aug 2014 13:50:28 +0000 (14:50 +0100)]
igt/gem_workarounds: igt to test workaround registers

Some of the workarounds are lost followed by a gpu reset, suspend/resume;
this patch adds a test which compares register state before and after
the test scenario.

This test currently verifies only bdw workarounds.

v2: address patch cleanup comments (ThomasW)
 Add binary to ignore list and use igt_debugfs helper fns
 to read debugfs file and igt_info for printing debug info.

v2.1: address minor comments from Daniel
 use igt_main as opposed to normal main

Signed-off-by: Arun Siluvery <arun.siluvery@linux.intel.com>
[danvet: Drop igt_exit, it's already in igt_main.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoshader-debugger: Force file/stdout IO as UTF-8
Rémi Cardona [Sun, 17 Aug 2014 23:09:15 +0000 (01:09 +0200)]
shader-debugger: Force file/stdout IO as UTF-8

Not all locales on linux are UTF-8, the most notable being the C locale.
Python will use the ASCII codec for stream IO in this case and will barf
on the Copyright sign at the top of .g4a files.

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=519434
Signed-off-by: Rémi Cardona <remi@gentoo.org>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Use igt macros more
Daniel Vetter [Tue, 26 Aug 2014 13:26:34 +0000 (15:26 +0200)]
lib: Use igt macros more

Stragglers.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_* Use igt macros in igt libaries
Daniel Vetter [Tue, 26 Aug 2014 13:26:21 +0000 (15:26 +0200)]
lib/igt_* Use igt macros in igt libaries

Except in igt_core since that would lead to some hilarious recursions.

v2: Don't fflush any more, spotted by Chris.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/intel_* Use igt checks and macros
Daniel Vetter [Tue, 26 Aug 2014 13:13:06 +0000 (15:13 +0200)]
lib/intel_* Use igt checks and macros

Various stuff all over. Most done with the igt.cocci spatch, but
with a few fixups by hand. And add igt_core.h includes where needed.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/rendercopy*: Use igt_assert
Daniel Vetter [Tue, 26 Aug 2014 13:03:40 +0000 (15:03 +0200)]
lib/rendercopy*: Use igt_assert

10 years agokms_rotation_crc: Calling commit2 instead of legacy commit
Sonika Jindal [Tue, 19 Aug 2014 06:31:25 +0000 (12:01 +0530)]
kms_rotation_crc: Calling commit2 instead of legacy commit

Since planes are universal now, using commit2 so that drmModeSetPlane can be
called for primary plane as well instead of drmModeSetCrtc. drmModeSetPlane will
update the x,y,w,h for the plane.

Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Sonika Jindal <sonika.jindal@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoMerge two subtests for pm_rc6_residency IGT case
Wendy Wang [Tue, 26 Aug 2014 06:38:49 +0000 (14:38 +0800)]
Merge two subtests for pm_rc6_residency IGT case

Combine two subtests(rc6_residency_check and rc6_residency_counter)
 into one subtest(residency_accuracy)

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/fb: Assert, instead of silently failing, when creating fbs
Damien Lespiau [Tue, 19 Aug 2014 10:55:22 +0000 (11:55 +0100)]
lib/fb: Assert, instead of silently failing, when creating fbs

We were either returning 0, or a negative value cast to an unsigned int
for errors and the clients of that API weren't exactly checking
anything.

We're in luck, we can take shortcuts in a testing library to just assert
when an expected error occurs.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib/fb: Replace straight igt_fail() by asserts with debug messages
Damien Lespiau [Tue, 19 Aug 2014 10:40:07 +0000 (11:40 +0100)]
lib/fb: Replace straight igt_fail() by asserts with debug messages

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agotestdisplay: Make the desired tiling mode an unsigned int
Damien Lespiau [Fri, 20 Jun 2014 11:02:09 +0000 (12:02 +0100)]
testdisplay: Make the desired tiling mode an unsigned int

We may be able to scan out more tiling formats in the future.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agopm_rpm: Adjust to the new igt_create*fb() API
Damien Lespiau [Mon, 18 Aug 2014 15:55:57 +0000 (16:55 +0100)]
pm_rpm: Adjust to the new igt_create*fb() API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agopm_lpsp: Adjust to the new igt_create.*fb() API
Damien Lespiau [Mon, 23 Jun 2014 14:28:07 +0000 (15:28 +0100)]
pm_lpsp: Adjust to the new igt_create.*fb() API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_sink_crc_basic: Adjust to the new igt_create.*fb() API
Damien Lespiau [Mon, 23 Jun 2014 14:27:17 +0000 (15:27 +0100)]
kms_sink_crc_basic: Adjust to the new igt_create.*fb() API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_setmode: Adjust to the igt_create.*fb() API
Damien Lespiau [Mon, 23 Jun 2014 14:26:34 +0000 (15:26 +0100)]
kms_setmode: Adjust to the igt_create.*fb() API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_render: Adjust to the new igt_create.*fb() API
Damien Lespiau [Mon, 23 Jun 2014 14:25:39 +0000 (15:25 +0100)]
kms_render: Adjust to the new igt_create.*fb() API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_psr_sink_crc: Adjust to the new igt_create.*fb() API
Damien Lespiau [Mon, 23 Jun 2014 14:24:49 +0000 (15:24 +0100)]
kms_psr_sink_crc: Adjust to the new igt_create.*fb() API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_plane: Adjust to the new igt_create.*fb() API
Damien Lespiau [Mon, 18 Aug 2014 15:50:07 +0000 (16:50 +0100)]
kms_plane: Adjust to the new igt_create.*fb() API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_pipe_crc_basic: Adjust to the new igt_create.*fb() API
Damien Lespiau [Mon, 23 Jun 2014 14:21:21 +0000 (15:21 +0100)]
kms_pipe_crc_basic: Adjust to the new igt_create.*fb() API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_mmio_vs_cs_flip: Adjust to the new igt_create_.*fb() API
Damien Lespiau [Mon, 23 Jun 2014 14:19:25 +0000 (15:19 +0100)]
kms_mmio_vs_cs_flip: Adjust to the new igt_create_.*fb() API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_flip_tiling: Adjust to the new igt_create_.*fb() API
Damien Lespiau [Mon, 23 Jun 2014 14:18:00 +0000 (15:18 +0100)]
kms_flip_tiling: Adjust to the new igt_create_.*fb() API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_flip: Adjust to the new igt_create_fb*() API
Damien Lespiau [Mon, 23 Jun 2014 14:16:54 +0000 (15:16 +0100)]
kms_flip: Adjust to the new igt_create_fb*() API

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_fence_pin_leak: Use I915_TILING_X to create fbs
Damien Lespiau [Mon, 23 Jun 2014 14:13:46 +0000 (15:13 +0100)]
kms_fence_pin_leak: Use I915_TILING_X to create fbs

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_fbc_crc: Use I915_TILING_X to create fbs
Damien Lespiau [Mon, 23 Jun 2014 14:12:48 +0000 (15:12 +0100)]
kms_fbc_crc: Use I915_TILING_X to create fbs

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_cursor_crc: Use I915_TILING_NONE to create fbs
Damien Lespiau [Mon, 23 Jun 2014 14:11:12 +0000 (15:11 +0100)]
kms_cursor_crc: Use I915_TILING_NONE to create fbs

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Change the fb creation functions to take fully qualified tiling formats
Damien Lespiau [Mon, 23 Jun 2014 13:53:24 +0000 (14:53 +0100)]
lib: Change the fb creation functions to take fully qualified tiling formats

In the future, we'll need more than X tiling here. So give a full enum
instead of bool meaning X-tiled.

It's fine to do this change without updating the users just yet as
'true' happens to be I915_TILING_X.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agotests: Fix seg fault when gem_mmap is run without specifying a subtest
Mike Mason [Mon, 18 Aug 2014 17:43:49 +0000 (10:43 -0700)]
tests: Fix seg fault when gem_mmap is run without specifying a subtest

gem_mmap seg faults when all tests are run together. This occurs because
the new-object subtest closes the gem object, but short-mmap assumes
it still exists. Thus gem_mmap__cpu() returns nil for addr and memset()
seg faults. This patch makes new-object and short-mmap create and
close their own gem objects.

Signed-off-by: Mike Mason <michael.w.mason@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agoscripts: Allow multiple -t and -x regular expressions for run-tests.sh
Mike Mason [Mon, 18 Aug 2014 17:43:09 +0000 (10:43 -0700)]
scripts: Allow multiple -t and -x regular expressions for run-tests.sh

Piglit allows multiple -t and -x regular expressions to be
given on the command line. This patch enables run-tests.sh to
support that as well.

Signed-off-by: Mike Mason <michael.w.mason@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agointel-gpu-tools: skip kms_flip_event_leak unless we have cairo
Tim Gore [Mon, 18 Aug 2014 13:56:43 +0000 (14:56 +0100)]
intel-gpu-tools: skip kms_flip_event_leak unless we have cairo

kms_flip_event_leak depends on cairo, so add it to the
list of tests to skip (in Android.mk) if ANDROID_HAS_CAIRO
is not set to 1.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agoAdd kms_flip_event_leak to .gitignore
Mike Mason [Fri, 15 Aug 2014 19:14:12 +0000 (19:14 +0000)]
Add kms_flip_event_leak to .gitignore

This patch just adds kms_flip_event_leak to tests/.gitignore.

Signed-off-by: Mike Mason <michael.w.mason@intel.com>
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agotests: check plane rotation is reset after the VT mode is restored
Thomas Wood [Thu, 14 Aug 2014 13:06:37 +0000 (14:06 +0100)]
tests: check plane rotation is reset after the VT mode is restored

Make sure the rotation is reset after the VT mode is restored by
collecting the unrotated CRC and comparing with the CRC value after VT mode
has been restored. The CRC is used to ensure the hardware state is checked,
rather than any software state.

References: https://bugs.freedesktop.org/show_bug.cgi?id=82236
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: add igt_restore_vt_mode
Thomas Wood [Thu, 14 Aug 2014 12:59:02 +0000 (13:59 +0100)]
lib: add igt_restore_vt_mode

Add a function to restore the previous VT mode after
igt_set_vt_graphics_mode is called.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib/igt_kms: doc for the remaining kmstest_ functions
Daniel Vetter [Tue, 12 Aug 2014 10:10:20 +0000 (12:10 +0200)]
lib/igt_kms: doc for the remaining kmstest_ functions

Plus a bit an overview section explaining the split in the library - a
few people (everyone except me it seems) didn't really understand it.

v2: Fix typo'ed s/kmstest_set_vt_graphics_mode/kmstest_get_pipe_from_crtc_id/
in a doc comment spotted by Imre.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_kms: Simplify return value of kmstest_get_connector_config
Daniel Vetter [Tue, 12 Aug 2014 09:57:32 +0000 (11:57 +0200)]
lib/igt_kms: Simplify return value of kmstest_get_connector_config

A plain bool is enough.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_kms: Simplify return value of kmstest_get_connector_default_mode
Daniel Vetter [Tue, 12 Aug 2014 09:56:41 +0000 (11:56 +0200)]
lib/igt_kms: Simplify return value of kmstest_get_connector_default_mode

A plain bool is good enough, no need for fancy negative error values.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_kms: Shuffle kmtests_ functions
Daniel Vetter [Tue, 12 Aug 2014 09:31:44 +0000 (11:31 +0200)]
lib/igt_kms: Shuffle kmtests_ functions

Group them a bit both in the header and .c file, and make sure they
appear in the same order in both.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_kms: set_vt_graphics_mode is a low-level helper
Daniel Vetter [Tue, 12 Aug 2014 09:23:09 +0000 (11:23 +0200)]
lib/igt_kms: set_vt_graphics_mode is a low-level helper

So give it a kmstest_ prefix and shuffle it around a bit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_kms: doc for type2str functions
Daniel Vetter [Tue, 12 Aug 2014 09:13:03 +0000 (11:13 +0200)]
lib/igt_kms: doc for type2str functions

Also shuffle things around a bit to make sure the order in the header
matches the order in the .c file.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_kms: Clean up the other _name functions/macros
Daniel Vetter [Tue, 12 Aug 2014 09:04:49 +0000 (11:04 +0200)]
lib/igt_kms: Clean up the other _name functions/macros

And remove sprite_name, redundant and won't work due to lack of
dev_priv.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_kms: Unify pipe name helpers
Daniel Vetter [Tue, 12 Aug 2014 09:00:37 +0000 (11:00 +0200)]
lib/igt_kms: Unify pipe name helpers

And add api doc while at it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/kms_cursor_crc: Align opening {
Daniel Vetter [Tue, 12 Aug 2014 08:32:41 +0000 (10:32 +0200)]
tests/kms_cursor_crc: Align opening {

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoigt/gem_cpu_reloc: Update the memory requirements
Chris Wilson [Tue, 12 Aug 2014 14:29:25 +0000 (15:29 +0100)]
igt/gem_cpu_reloc: Update the memory requirements

Use intel_check_memory() for accuracy and beautification

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotests: Add kms_flip_event_leak test
Ville Syrjälä [Tue, 5 Aug 2014 20:06:04 +0000 (23:06 +0300)]
tests: Add kms_flip_event_leak test

kms_flip_event_leak will issue a page flip and close the file
descriptor before the flip has finished. This may cause the kernel
to leak the page flip event. The test itself won't actually fail but
if the kernel notices the leak and WARNs piglit will report a failure.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
10 years agotests/pm_rpm: refactor the modesetting code
Paulo Zanoni [Fri, 8 Aug 2014 14:24:34 +0000 (11:24 -0300)]
tests/pm_rpm: refactor the modesetting code

Refactor the code so the params for the modesets are always stored and
don't have to be recomputed every time. With this, we can get rid of
our FB caching structures, and we now also allow the subtests that do
special modesets to reuse the parameters used on the default modesets,
just changing whatever they want.

The biggest win here is that the test case subfunctions get smaller
and simpler to read and write.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agotests/pm_rpm: add disable_or_dpms_all_screens()
Paulo Zanoni [Thu, 7 Aug 2014 19:36:04 +0000 (16:36 -0300)]
tests/pm_rpm: add disable_or_dpms_all_screens()

And its and_wait() version. The goal is to extract common code
patterns into functions/macros, so the code for the test cases gets
easier to read and write.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agotests/pm_rpm: add macros to disable/enable screens and wait
Paulo Zanoni [Fri, 8 Aug 2014 14:12:42 +0000 (11:12 -0300)]
tests/pm_rpm: add macros to disable/enable screens and wait

This should make the test case functions better to read and write.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agotests/pm_rpm: add wait_for_suspended() calls to test_one_plane
Paulo Zanoni [Thu, 7 Aug 2014 19:03:08 +0000 (16:03 -0300)]
tests/pm_rpm: add wait_for_suspended() calls to test_one_plane

Make sure we do all operations while really runtime suspended, so we
can actually test things.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agotests/pm_rpm: add subtests for fences
Paulo Zanoni [Wed, 6 Aug 2014 21:50:57 +0000 (18:50 -0300)]
tests/pm_rpm: add subtests for fences

Daniel thought fences were not surviving runtime PM on DPMS, so we
wrote this test to check. The good news is that the test passed, so
there's no need for a Kernel patch, at least on the Kernel I tested.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agoigt_kms: add kmstest_unset_all_crtcs()
Paulo Zanoni [Wed, 6 Aug 2014 17:31:53 +0000 (14:31 -0300)]
igt_kms: add kmstest_unset_all_crtcs()

Both pm_rpm.c and pm_lpsp.c call it "disable_all_screens", but let's
give it a name that better describes what the implementation does.

v2: Rename to kmstest_unset_all_crtcs (Daniel).

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agotests/pm_rpm: use kmstest_get_property()
Paulo Zanoni [Wed, 6 Aug 2014 15:33:48 +0000 (12:33 -0300)]
tests/pm_rpm: use kmstest_get_property()

So we can reduce the code size.

v2: Rebase after the rename to kmstest_get_property.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agoigt_kms: document and export kmstest_get_property()
Paulo Zanoni [Wed, 6 Aug 2014 15:14:56 +0000 (12:14 -0300)]
igt_kms: document and export kmstest_get_property()

So we can use it on pm_rpm.c.

v2: Rename to kmstest_get_property (Daniel)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agoigt_kms: optionally return the property from get_property
Paulo Zanoni [Wed, 6 Aug 2014 15:03:57 +0000 (12:03 -0300)]
igt_kms: optionally return the property from get_property

So we can use this function on places that also need the property
pointer, without having to call drmModeGetProperty() again with the
returned id.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agoigt_kms: pass drm_fd instead of igt_display_t on some functions
Paulo Zanoni [Wed, 6 Aug 2014 14:48:56 +0000 (11:48 -0300)]
igt_kms: pass drm_fd instead of igt_display_t on some functions

Since these functions only really use the drm_fd. The goal is to be
able to reuse these functions on programs that don't use the
igt_display_t structure.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agoigt_kms: don't get drmModeRes just to free it later
Paulo Zanoni [Tue, 5 Aug 2014 21:44:47 +0000 (18:44 -0300)]
igt_kms: don't get drmModeRes just to free it later

Stress testing malloc is not our goal :)

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agotests/pm_rpm: add subtests for planes and cursors
Paulo Zanoni [Wed, 6 Aug 2014 17:55:33 +0000 (14:55 -0300)]
tests/pm_rpm: add subtests for planes and cursors

These tests should trigger WARNs on Kernels that don't have the most
recent fixes.

v2: - Merge both the cursor and planes patches into one so it's easier
      to update them.
    - Extend the tests a little bit to exercise fences.
    - Fix bug found by Matt to enable the test to run on older Kernels

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agolib/chv: CHV media pipeline command sequence
Sean V Kelley [Tue, 5 Aug 2014 20:53:49 +0000 (13:53 -0700)]
lib/chv: CHV media pipeline command sequence

Enable gem_media_fill test for CHV platform.  In addition to differences in
media IP blocks from Broadwell, the command sequence also differs for
programming the media pipeline, e.g., should not send a MEDIA_STATE_FLUSH
right before the MI_BATCH_BUFFER_END of batch buffers using MEDIA_OBJECT.
Uses explicit IS_BROADWELL / IS_CHERRYVIEW to distinguish in gen8 media
fill handling.

Signed-off-by: Sean V Kelley <sean.v.kelley@intel.com>
Reviewed-by: Xiang, Haihao <haihao.xiang@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agointel_bios_reader: Add support to dump MIPI Sequence block #53
Gaurav K Singh [Wed, 16 Jul 2014 14:09:33 +0000 (19:39 +0530)]
intel_bios_reader: Add support to dump MIPI Sequence block #53

Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agointel_bios_reader: Add support to dump MIPI Configuration Block #52
Gaurav K Singh [Wed, 16 Jul 2014 14:09:32 +0000 (19:39 +0530)]
intel_bios_reader: Add support to dump MIPI Configuration Block #52

Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agotestdisplay: ignore invalid subtest options
Thomas Wood [Thu, 31 Jul 2014 15:26:55 +0000 (16:26 +0100)]
testdisplay: ignore invalid subtest options

testdisplay does not have any subtests and should therefore exit with
the appropriate exit code if the --list-subtests or --run-subtest
options are used.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agocore: Add all kernel log levels
Chris Wilson [Mon, 28 Jul 2014 07:58:32 +0000 (08:58 +0100)]
core: Add all kernel log levels

And notice that INFO is 6 not 5. This is because I had intended to use
KERN_NOTICE anyway...

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoUpdate .gitignore files
Thomas Wood [Mon, 28 Jul 2014 15:43:19 +0000 (16:43 +0100)]
Update .gitignore files

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: don't abort if forcing the connector state fails
Thomas Wood [Mon, 28 Jul 2014 15:01:27 +0000 (16:01 +0100)]
lib: don't abort if forcing the connector state fails

Ensure tests using igt_enable_connectors can still run even if the
relevant debugfs files are not available.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: check test options for conflicts
Thomas Wood [Mon, 28 Jul 2014 14:37:16 +0000 (15:37 +0100)]
lib: check test options for conflicts

Check any test specific options for conflicts with the standard set of
options.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: avoid getopt value conflicts with tests
Thomas Wood [Fri, 25 Jul 2014 15:54:41 +0000 (16:54 +0100)]
lib: avoid getopt value conflicts with tests

Most tests use a printable character as the value for getopt to return,
so avoid conflicts by using non-printing values for the standard options.

v2: fix "-h" short option

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agotestdisplay: set a non-zero exit code if getopt detected an error
Thomas Wood [Fri, 25 Jul 2014 14:35:36 +0000 (15:35 +0100)]
testdisplay: set a non-zero exit code if getopt detected an error

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: Add ndebug to the headers
Ben Widawsky [Tue, 29 Jul 2014 23:54:48 +0000 (16:54 -0700)]
lib: Add ndebug to the headers

If you don't do this, it is excluded from the tarball generated by make
distcheck.

1.6 and 1.7 both are not buildable as a result.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
10 years agotests/gem_ringfill: add interruptible mode
Daniel Vetter [Tue, 29 Jul 2014 16:46:09 +0000 (18:46 +0200)]
tests/gem_ringfill: add interruptible mode

Should be useful to test intel_ring_begin restart behaviour a bit.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotestdisplay: Destroy the cairo context once the fb is painted
Damien Lespiau [Mon, 30 Jun 2014 15:19:05 +0000 (16:19 +0100)]
testdisplay: Destroy the cairo context once the fb is painted

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Don't take a reference to the surface in get_cairo_surface()
Damien Lespiau [Mon, 30 Jun 2014 15:34:20 +0000 (16:34 +0100)]
lib: Don't take a reference to the surface in get_cairo_surface()

We don't need to keep a reference to the surface, the cairo context will
keep a reference to it until we destroy it.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: NULLify ->cairo_surface once unmapped
Damien Lespiau [Fri, 11 Jul 2014 13:45:37 +0000 (14:45 +0100)]
lib: NULLify ->cairo_surface once unmapped

Just a matter of not leaving dangling pointers around.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Split the GTT mapping out of get_cairo_surface()
Damien Lespiau [Mon, 23 Jun 2014 15:41:43 +0000 (16:41 +0100)]
lib: Split the GTT mapping out of get_cairo_surface()

This is preparation work for when we need a different way to get a
linear buffer we can use with cairo.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Remove unused field from struct igt_fb
Damien Lespiau [Mon, 23 Jun 2014 18:47:19 +0000 (19:47 +0100)]
lib: Remove unused field from struct igt_fb

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agoigt/pm_rps: Fix assertion in load_helper_stop
Chris Wilson [Sun, 27 Jul 2014 14:39:58 +0000 (15:39 +0100)]
igt/pm_rps: Fix assertion in load_helper_stop

The load_helper isn't killed by the signal, but it exits gracefully. So
update the assertion to check for the successful exit.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agodrmtest: First check that driver is i915
Chris Wilson [Fri, 25 Jul 2014 16:34:06 +0000 (17:34 +0100)]
drmtest: First check that driver is i915

Before issuing any i915 specific ioctls, check the driver is i915
otherwise we make other drivers emit nasty errors at the start of every
test.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoquick_dump: fix distcheck
Thomas Wood [Fri, 25 Jul 2014 12:53:12 +0000 (13:53 +0100)]
quick_dump: fix distcheck

version.h is now generated in the libs directory, so make sure it is
correctly included in the compiler flags.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agointel-gpu-tools: fix version.h creation in android
Tim Gore [Thu, 24 Jul 2014 16:38:22 +0000 (17:38 +0100)]
intel-gpu-tools: fix version.h creation in android

commit 743dc7997aa9f5210055896940d87c88983dcda6
breaks the build under Android because version.h
is not created. This happens because the android
make executes from the ANDROID_BUILD_TOP directory
rather than from the directory containing the source
files, so we need to differentiate between Android
and linux builds. This is V2 of this patch based on
Thomas Wood's suggestion.

Signed-off-by: Tim Gore <tim.gore@intel.com>
[Thomas: Fix distcheck issues]
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agotestdisplay: only set terminal attributes when in foreground process group
Thomas Wood [Thu, 24 Jul 2014 16:45:48 +0000 (17:45 +0100)]
testdisplay: only set terminal attributes when in foreground process group

The Piglit test runner for intel-gpu-tools creates a new process group
for the test processes, so attempting to set terminal attributes causes
the process to receive SIGTTOU and be stopped. Since the test is not run
interactively in this case, the issue can be avoided by not setting
terminal attributes if the process is not in the foreground process
group.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agocore: Inject program name into dmesg
Chris Wilson [Fri, 25 Jul 2014 13:29:47 +0000 (14:29 +0100)]
core: Inject program name into dmesg

Write the program name if !list_only so that we associate oops with
simple tests.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agocore: Improve phrasing for test requirements
Chris Wilson [Fri, 25 Jul 2014 13:28:51 +0000 (14:28 +0100)]
core: Improve phrasing for test requirements

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agointel-gpu-tools: add sys/wait.h to pm_rps.c
Tim Gore [Thu, 24 Jul 2014 13:54:27 +0000 (14:54 +0100)]
intel-gpu-tools: add sys/wait.h to pm_rps.c

commit 745945546f7366a413a3a51a37f90caa3a227b1d
breaks the build under Android because some of the
macros used in pm_rps.c are defined in sys/wait.h
which is not included.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoNEWS: Don't forget new universal plane commit for igt_kms
Daniel Vetter [Fri, 25 Jul 2014 07:28:56 +0000 (09:28 +0200)]
NEWS: Don't forget new universal plane commit for igt_kms

Suggest by Matt Roper.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agocore: Inject subtest message into dmesg
Chris Wilson [Thu, 24 Jul 2014 11:46:00 +0000 (12:46 +0100)]
core: Inject subtest message into dmesg

One of the side-effects we test for are kernel oops and knowing the
guilty subtest can help speed up debugging. We can write to /dev/kmsg to
inject messages into dmesg, so let's do so before the start of every
test.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt_core: Read manpages more carefully for WNOHANG
Chris Wilson [Thu, 24 Jul 2014 11:00:57 +0000 (12:00 +0100)]
igt_core: Read manpages more carefully  for WNOHANG

/me hides

I thought it said it would not return for a signal and stopped thinking.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt_core: Refactor igt_stop_helper() to use igt_wait_helper()
Chris Wilson [Thu, 24 Jul 2014 10:44:45 +0000 (11:44 +0100)]
igt_core: Refactor igt_stop_helper() to use igt_wait_helper()

Reduce code duplication as the igt_stop_helper can reuse
igt_wait_helper() to replace its own waiting routine.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agocore: Only use signalsafe functions inside signal handlers
Chris Wilson [Thu, 24 Jul 2014 10:41:59 +0000 (11:41 +0100)]
core: Only use signalsafe functions inside signal handlers

The atexit() and signal() callbacks both need to only use signalsafe
functions - that excludes the use of assert. So simplify
fork_helper_exit_handler() and children_exit_handler().

__lll_lock_wait_private () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:95
0x00007fd630883d2b in _L_lock_13840 () from /lib/x86_64-linux-gnu/libc.so.6
0x00007fd630881df8 in __GI___libc_realloc (oldmem=0xfcb010, bytes=88) at malloc.c:3025
0x00007fd63087111b in _IO_vasprintf (result_ptr=0x7fff35dc4780, format=<optimised out>, args=args@entry=0x7fff35dc4658) at vasprintf.c:84
0x00007fd630852907 in ___asprintf (string_ptr=string_ptr@entry=0x7fff35dc4780, format=format@entry=0x7fd63097f718 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n") at asprintf.c:35
0x00007fd63082dd92 in __assert_fail_base (fmt=0x7fd63097f718 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x40cff5 "ret == 0", file=file@entry=0x4108d1 "igt_core.c", line=line@entry=872, function=function@entry=0x410ea0 <__PRETTY_FUNCTION__.8052> "children_exit_handler") at assert.c:57
0x00007fd63082dee2 in __GI___assert_fail (assertion=assertion@entry=0x40cff5 "ret == 0", file=file@entry=0x4108d1 "igt_core.c", line=line@entry=872, function=function@entry=0x410ea0 <__PRETTY_FUNCTION__.8052> "children_exit_handler") at assert.c:101
0x000000000040b03f in children_exit_handler (sig=<optimised out>) at igt_core.c:872
0x000000000040b089 in call_exit_handlers (sig=2) at igt_core.c:1029 fatal_sig_handler (sig=2) at igt_core.c:1053 <signal handler called>
0x00007fd6308bfe63 in __libc_fork () at ../nptl/sysdeps/unix/sysv/linux/x86_64/../fork.c:130
0x00007fd630bd6045 in __fork () at ../nptl/sysdeps/unix/sysv/linux/pt-fork.c:25
0x000000000040c51a in __igt_fork () at igt_core.c:900
0x00000000004036c2 in forking_evictions (ops=0x614360 <fault_ops>, surface_size=1048576, flags=5, trash_surfaces=<optimised out>, working_surfaces=338, fd=4) at eviction_common.c:203
test_forking_evictions (size=1048576, flags=5, count=338, fd=4) at gem_userptr_blits.c:1086
main (argc=1, argv=0x7fff35dc5328) at gem_userptr_blits.c:1478

Reported-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_userptr_blits: Fix multi-threaded mm stress tester
Tvrtko Ursulin [Tue, 22 Jul 2014 10:14:51 +0000 (11:14 +0100)]
igt/gem_userptr_blits: Fix multi-threaded mm stress tester

Two parts to the fix:
  1. Do not use pthread_cancel since not available on Android.
  2. Do not assert in the thread since that does not get propagated
     to the process. Rather pass out any failures so we know test
     did not work as expected.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Tim Gore <tim.gore@intel.com>
Reviewed-by: Tim Gore <tim.gore@intel.com>
10 years agoigt/gem_userptr_blits: Fix forked access test
Tvrtko Ursulin [Tue, 22 Jul 2014 11:33:49 +0000 (12:33 +0100)]
igt/gem_userptr_blits: Fix forked access test

copy() blit helper assumes a certain object size much larger than a page size.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoNEWS: Updates
Daniel Vetter [Wed, 23 Jul 2014 20:32:09 +0000 (22:32 +0200)]
NEWS: Updates

10 years agotests/pm_rpm: Convert to new optparsing
Daniel Vetter [Wed, 23 Jul 2014 19:14:24 +0000 (21:14 +0200)]
tests/pm_rpm: Convert to new optparsing

Thomas missed the add-hoc parameter parsing in here, which did break
things for Paulo since the core now fails for unknown options.

Convert them over to the new infrastructure, which has the nice upside
that we can remove the comments and put them into the usage available
with --help.

Cc: Thomas Wood <thomas.wood@intel.com>
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Tested-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/drm_lib.sh: Bare-bones long option parsing
Daniel Vetter [Wed, 23 Jul 2014 12:35:22 +0000 (14:35 +0200)]
lib/drm_lib.sh: Bare-bones long option parsing

Just enough to stay compatible with simple subtests.

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