platform/upstream/intel-gpu-tools.git
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>
10 years agotests: Move root check to lib/drm_lib.sh
Daniel Vetter [Wed, 23 Jul 2014 12:21:27 +0000 (14:21 +0200)]
tests: Move root check to lib/drm_lib.sh

All tests want that anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolinux: placate drop_caches and pass it a '\n'
Chris Wilson [Wed, 23 Jul 2014 17:35:02 +0000 (18:35 +0100)]
linux: placate drop_caches and pass it a '\n'

Apparently it doesn't have much effect without the newline.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agobuild: improve version.h generation
Thomas Wood [Tue, 22 Jul 2014 13:53:18 +0000 (14:53 +0100)]
build: improve version.h generation

Move version.h generation into lib/Makefile.sources so that it can be
shared between the Autotools and Android build systems. Also make sure the
"updating version.h" message is only displayed when version.h actually
changes and remove unnecessary includes of version.h.

This also includes changes from Tvrtko Ursulin to prevent a build from
within the git repository failing when git is not available.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
10 years agolib: add an exit code to use when invalid options are specified
Thomas Wood [Wed, 23 Jul 2014 15:29:39 +0000 (16:29 +0100)]
lib: add an exit code to use when invalid options are specified

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: add a command line option to enable debug output in tests
Thomas Wood [Wed, 23 Jul 2014 09:38:24 +0000 (10:38 +0100)]
lib: add a command line option to enable debug output in tests

Add --debug as a common command line option for all tests to enable
debug output.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: always warn about unknown options
Thomas Wood [Mon, 21 Jul 2014 15:17:06 +0000 (16:17 +0100)]
lib: always warn about unknown options

All tests can now register extra options, so there should not be any
unknown options.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agotests: convert simple tests to use igt_simple_init_parse_opts
Thomas Wood [Mon, 21 Jul 2014 14:57:16 +0000 (15:57 +0100)]
tests: convert simple tests to use igt_simple_init_parse_opts

Convert simple tests to use igt_simple_init_parse_opts if they require
extra options.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: don't ignore unknown options in multi-tests
Thomas Wood [Fri, 18 Jul 2014 16:17:34 +0000 (17:17 +0100)]
lib: don't ignore unknown options in multi-tests

None of the current tests have additional options that might make use of
any unknown options and igt_subtest_init_parse_opts is available that
integrates additional option parsing.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: add igt_simple_init_parse_opts
Thomas Wood [Fri, 18 Jul 2014 15:49:07 +0000 (16:49 +0100)]
lib: add igt_simple_init_parse_opts

This function allows simple tests to register additional command line
options.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: move option parsing into common_init
Thomas Wood [Fri, 18 Jul 2014 15:24:34 +0000 (16:24 +0100)]
lib: move option parsing into common_init

Move option parsing into common_init so it can be shared between simple
tests and tests with subtests. This allows for more common command line
behaviour across all tests.

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agotests: remove unused getopt header includes
Thomas Wood [Fri, 18 Jul 2014 13:17:35 +0000 (14:17 +0100)]
tests: remove unused getopt header includes

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib: warn when attempting to run an unknown subtest
Thomas Wood [Fri, 18 Jul 2014 13:10:27 +0000 (14:10 +0100)]
lib: warn when attempting to run an unknown subtest

Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agoigt/gem_userptr_benchmark: Fix for upstream ioctl number
Tvrtko Ursulin [Wed, 23 Jul 2014 12:33:18 +0000 (13:33 +0100)]
igt/gem_userptr_benchmark: Fix for upstream ioctl number

Hardcoding has upsides and downsides.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolinux: Flush page/buffer cache before querying available memory
Chris Wilson [Mon, 21 Jul 2014 15:15:24 +0000 (16:15 +0100)]
linux: Flush page/buffer cache before querying available memory

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_userptr_blits: New tests, old issues
Chris Wilson [Mon, 21 Jul 2014 08:12:43 +0000 (09:12 +0100)]
igt/gem_userptr_blits: New tests, old issues

Introduce a new test to keep that we clean up on process exit (if the
userptr is busy or it has been gtt mmapped). This revealed a few bugs in
the existing tests so clean those up.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoQuieten valgrind
Chris Wilson [Mon, 21 Jul 2014 06:57:25 +0000 (07:57 +0100)]
Quieten valgrind

Clear all the ioctl structs to zero before use as valgrind does not our
ioctls and so complains about undefined bytes being passed to syscalls.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoUse SIGTERM in replace of SIGQUIT
Chris Wilson [Mon, 21 Jul 2014 06:54:29 +0000 (07:54 +0100)]
Use SIGTERM in replace of SIGQUIT

SIGTERM is the normal signal to use when instructing a process to exit.
The only difference is that an unhandled SIGQUIT is meant to generate a
coredump, which is not what we want, but in practice I encountered an
issue where SIGTERM seemed to be deliverable more reliably than SIGQUIT
(in tests using multiple signal helpers).

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/kms_flip: Skip if headless
Chris Wilson [Sat, 19 Jul 2014 10:59:42 +0000 (11:59 +0100)]
igt/kms_flip: Skip if headless

If there are no connectors, we cannot perform any pageflips and so we
have nothing to test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73640&list_id=446828
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agotests/pm_rpm: add dpms-mode-unset{,-non}-lpsp subtests
Paulo Zanoni [Wed, 16 Jul 2014 19:10:30 +0000 (16:10 -0300)]
tests/pm_rpm: add dpms-mode-unset{,-non}-lpsp subtests

These tests currently trigger WARNs on our Kernel. Let's make sure we
fix the bug and it never comes back.

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
10 years agocore: increase the exit handler limit
Thomas Wood [Thu, 17 Jul 2014 10:19:04 +0000 (11:19 +0100)]
core: increase the exit handler limit

Increase the maximum number of exit handlers since some tests now
require more that the previous limit.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=81320
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
10 years agolib/igt.cocci: Add s/assert/igt_assert/
Daniel Vetter [Tue, 15 Jul 2014 08:21:37 +0000 (10:21 +0200)]
lib/igt.cocci: Add s/assert/igt_assert/

People use it way too often, and it upsets the test library. The only
valid places to use this is of igt infrastructure self-tests where you
need to check something _without_ all the other abi use checks
igt_fail and friends do. For those tests just #define an internal
assert to hide it.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_userptr_blits: Polish
Daniel Vetter [Tue, 15 Jul 2014 08:12:55 +0000 (10:12 +0200)]
tests/gem_userptr_blits: Polish

- Drop return values for test functions - we rely on the implicit
  control flow from igt_ checks.
- Don't use assert directly, this upsets the test flow logic (and
  results in a CRASH result instead of FAIL).

Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests/gem_userptr_blits: Race between object creation and multi-threaded mm ops
Tvrtko Ursulin [Mon, 14 Jul 2014 13:19:17 +0000 (14:19 +0100)]
tests/gem_userptr_blits: Race between object creation and multi-threaded mm ops

Userptr v23 was not thread safe against memory map operations and object
creation from separate threads. MMU notifier callback would get triggered
on a partially constructed object causing a NULL pointer dereference.

This test excercises that path a bit. In my testing it would trigger it
every time and easily, but unfortunately a test pass here does not guarantee
the absence of the race.

v2: Added explicit cancellation point and removed the stop flag.
    Use only igt_assert().

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib/igt_core: Fixup gtkdoc for logging functions
Daniel Vetter [Mon, 14 Jul 2014 21:02:18 +0000 (23:02 +0200)]
lib/igt_core: Fixup gtkdoc for logging functions

Without the () gtkdoc won't recognize them as function references.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agotests: Move gem_render_copy_redux to the list of multi-subtests tests
Damien Lespiau [Mon, 14 Jul 2014 17:01:05 +0000 (18:01 +0100)]
tests: Move gem_render_copy_redux to the list of multi-subtests tests

Can we find a way to fix those for good? My preference goes to not
having that single/multi split but always have a test being a list of
one or more subtests.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agolib: Add argc/argv to igt_simple_init
Daniel Vetter [Mon, 14 Jul 2014 12:42:23 +0000 (14:42 +0200)]
lib: Add argc/argv to igt_simple_init

There's a pile of ideas around to add generally useful options like
--debug to all igt tests. Or unify the runtime behaviour between
simple and subtest tests a bit more.

The first step to get there is to add argc/argv to igt_simple_init so
that we can get at the argument list.

Cc: Tim Gore <tim.gore@intel.com>
Cc: Thomas Wood <thomas.wood@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agointel-gpu-tools: Dont build kms_force_connector if no cairo
Tim Gore [Fri, 11 Jul 2014 14:31:39 +0000 (15:31 +0100)]
intel-gpu-tools: Dont build kms_force_connector if no cairo

kms_force_connector is a new test that requires cairo.
I have added it to the list of tests not to build on
Android unless ANDROID_HAS_CAIRO is set.

Signed-off-by: Tim Gore <tim.gore@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agoigt/gem_userptr_blits: Add missing RAM check before coherency tests
Chris Wilson [Mon, 14 Jul 2014 09:30:36 +0000 (10:30 +0100)]
igt/gem_userptr_blits: Add missing RAM check before coherency tests

-ENOCOFFE.

References: https://bugs.freedesktop.org/show_bug.cgi?id=79237
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_userptr_blits: Add missing RAM check before coherency tests
Chris Wilson [Mon, 14 Jul 2014 09:30:36 +0000 (10:30 +0100)]
igt/gem_userptr_blits: Add missing RAM check before coherency tests

References: https://bugs.freedesktop.org/show_bug.cgi?id=79237
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_close_race: Increase GPU load
Chris Wilson [Sat, 12 Jul 2014 08:06:39 +0000 (09:06 +0100)]
igt/gem_close_race: Increase GPU load

Increate the GPU load slightly, but mitigate the CPU overhead from
clflushing by keeping the object alive using flink. This has also the
side-effect of magnifying the desired busy-close race.

References: https://bugs.freedesktop.org/show_bug.cgi?id=71029
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agooverlay: Baytrail needs a custom GPU frequency parser
Chris Wilson [Thu, 3 Jul 2014 10:18:02 +0000 (11:18 +0100)]
overlay: Baytrail needs a custom GPU frequency parser

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_close_race: Trim object size
Chris Wilson [Fri, 11 Jul 2014 22:36:15 +0000 (23:36 +0100)]
igt/gem_close_race: Trim object size

The challenge here is to race GPU activity versus the gem_close. Using a
large objects makes the window of GPU activity larger - except on !llc
systems we then incur massive overhead from clflush, likely destroying
any race (due to mutex contention). And that mutex contention is
amplified by the number of cores - bad news for Baytrail.

Give up and make the objects smaller and hope that the test is run
frequently enough to catch the race.

References: https://bugs.freedesktop.org/show_bug.cgi?id=71029
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoigt/gem_tiled_swapping: Speed up slightly
Chris Wilson [Fri, 11 Jul 2014 19:38:38 +0000 (20:38 +0100)]
igt/gem_tiled_swapping: Speed up slightly

The exercise is moving tiled objects in and out of swap. They are moved
en-block and we test them all, therefore we can randomly test different
bytes from each buffer to have reasonable coverage of all tiles. This
shifts the bulk of the work from checking the tiled bo to kswapd.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agoconfigure: Only build overlay if dri2proto is present
Chris Wilson [Fri, 11 Jul 2014 19:38:30 +0000 (20:38 +0100)]
configure: Only build overlay if dri2proto is present

Instead of making dri2proto mandatory, disable intel-gpu-overlay if it
is not installed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
10 years agolib/igt.cocci: Add stanza for for_each_pipe
Daniel Vetter [Fri, 11 Jul 2014 15:41:27 +0000 (17:41 +0200)]
lib/igt.cocci: Add stanza for for_each_pipe

Damien dodged this ...

Also run the script while at it.

v2: Don't just capture identifiers for pipe, but also expressions.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
10 years agolib: Extract gem_get_tiling() from a couple of tests.
Damien Lespiau [Thu, 19 Jun 2014 23:14:52 +0000 (00:14 +0100)]
lib: Extract gem_get_tiling() from a couple of tests.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Use the igt_kms enum to encode the plane rotation
Damien Lespiau [Thu, 10 Jul 2014 17:39:17 +0000 (18:39 +0100)]
kms_rotation_crc: Use the igt_kms enum to encode the plane rotation

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Remove unnecessary includes
Damien Lespiau [Thu, 10 Jul 2014 17:37:36 +0000 (18:37 +0100)]
kms_rotation_crc: Remove unnecessary includes

Turns out we didn't need most of them.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Always use the primary plane to compute the reference CRC
Damien Lespiau [Wed, 9 Jul 2014 13:00:59 +0000 (14:00 +0100)]
kms_rotation_crc: Always use the primary plane to compute the reference CRC

Trying to disable the primary planes isn't exactly working at the
moment. W/A it until it works.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Document the two steps in prepare_crtc()
Damien Lespiau [Thu, 10 Jul 2014 16:44:28 +0000 (17:44 +0100)]
kms_rotation_crc: Document the two steps in prepare_crtc()

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Don't compile the test on Android with no cairo support
Damien Lespiau [Wed, 9 Jul 2014 20:24:26 +0000 (21:24 +0100)]
kms_rotation_crc: Don't compile the test on Android with no cairo support

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Add the test to .gitignore
Damien Lespiau [Wed, 9 Jul 2014 20:23:27 +0000 (21:23 +0100)]
kms_rotation_crc: Add the test to .gitignore

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Properly paint the whole frame buffer
Damien Lespiau [Wed, 9 Jul 2014 11:03:50 +0000 (12:03 +0100)]
kms_rotation_crc: Properly paint the whole frame buffer

The -1 meant we weren't properly filling the whole fb.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Don't commit with no fb set up
Damien Lespiau [Tue, 8 Jul 2014 18:27:39 +0000 (19:27 +0100)]
kms_rotation_crc: Don't commit with no fb set up

prepare_crtc() was trying to commit a display state without any fb to
scan out...

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Allow the sprite test to run even without universal planes
Damien Lespiau [Tue, 8 Jul 2014 18:24:24 +0000 (19:24 +0100)]
kms_rotation_crc: Allow the sprite test to run even without universal planes

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: No need to test for NULL before freeing the pipe CRC object
Damien Lespiau [Tue, 8 Jul 2014 17:56:15 +0000 (18:56 +0100)]
kms_rotation_crc: No need to test for NULL before freeing the pipe CRC object

igt_pipe_crc_free() does that check already.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Remove plane from the state
Damien Lespiau [Tue, 8 Jul 2014 17:51:25 +0000 (18:51 +0100)]
kms_rotation_crc: Remove plane from the state

having everythin in the data_t structure makes it hard to understand
what should be set when. Replace that by explicit function parameters.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Remove the sleep(2)
Damien Lespiau [Tue, 8 Jul 2014 17:48:35 +0000 (18:48 +0100)]
kms_rotation_crc: Remove the sleep(2)

One can inspect the output of the igt_kms API by setting
IGT_DISPLAY_WAIT_AT_COMMIT=1.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
10 years agokms_rotation_crc: Remove 'output' from the state
Damien Lespiau [Tue, 8 Jul 2014 17:46:57 +0000 (18:46 +0100)]
kms_rotation_crc: Remove 'output' from the state

This restore the balance between prepare_crtc() and cleanup_crtc(), both
now taking the output as a parameter.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>