3208 Commits

Author SHA1 Message Date
Gaurav K Singh
525044ba32 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>
2014-08-01 17:48:48 +01:00
Thomas Wood
ff6b068ecd 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>
2014-07-31 16:30:01 +01:00
Chris Wilson
de1e877be5 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>
2014-07-30 12:04:46 +01:00
Thomas Wood
9b500dbf6b Update .gitignore files
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-30 11:16:09 +01:00
Thomas Wood
bb48429a6c 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>
2014-07-30 11:13:13 +01:00
Thomas Wood
c3ba7740c1 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>
2014-07-30 11:13:13 +01:00
Thomas Wood
fc5e25750f 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>
2014-07-30 11:13:13 +01:00
Thomas Wood
8fc4107c91 testdisplay: set a non-zero exit code if getopt detected an error
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-30 11:13:13 +01:00
Ben Widawsky
2fae99bf2c 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>
2014-07-29 17:00:28 -07:00
Daniel Vetter
21e9422b01 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>
2014-07-29 18:46:09 +02:00
Damien Lespiau
660a7ffdba testdisplay: Destroy the cairo context once the fb is painted
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Damien Lespiau
0db75bb3f9 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>
2014-07-29 12:13:41 +01:00
Damien Lespiau
72357f3de0 lib: NULLify ->cairo_surface once unmapped
Just a matter of not leaving dangling pointers around.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Damien Lespiau
4aadbc817b 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>
2014-07-29 12:13:41 +01:00
Damien Lespiau
f5959af8a5 lib: Remove unused field from struct igt_fb
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29 12:13:41 +01:00
Chris Wilson
e48c495572 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>
2014-07-27 15:39:58 +01:00
Chris Wilson
a6e6c5bdcf 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>
2014-07-25 17:38:19 +01:00
Thomas Wood
fcbc5028ae 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>
2014-07-25 14:46:51 +01:00
Tim Gore
57bd86068a 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>
2014-07-25 14:46:51 +01:00
Thomas Wood
8408e00e62 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>
2014-07-25 14:46:51 +01:00
Chris Wilson
b9e7637542 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>
2014-07-25 14:39:18 +01:00
Chris Wilson
e0dffbdeda core: Improve phrasing for test requirements
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-25 14:39:18 +01:00
Tim Gore
72b1263649 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>
2014-07-25 09:36:10 +02:00
Daniel Vetter
93d07ab898 NEWS: Don't forget new universal plane commit for igt_kms
Suggest by Matt Roper.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-25 09:29:35 +02:00
Chris Wilson
52915fc88a 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>
2014-07-24 14:54:30 +01:00
Chris Wilson
66e46630f8 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>
2014-07-24 12:02:36 +01:00
Chris Wilson
745945546f 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>
2014-07-24 11:52:37 +01:00
Chris Wilson
bd3cf81e98 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>
2014-07-24 11:50:00 +01:00
Tvrtko Ursulin
8b3ded404c 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>
2014-07-24 09:31:31 +01:00
Tvrtko Ursulin
700bdf1401 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>
2014-07-24 08:46:38 +01:00
Daniel Vetter
bffef22bfd NEWS: Updates 2014-07-23 22:32:09 +02:00
Daniel Vetter
3efcb8c8ee 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>
2014-07-23 21:41:18 +02:00
Daniel Vetter
556ebc7a7c 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>
2014-07-23 21:03:07 +02:00
Daniel Vetter
91f536dc42 tests: Move root check to lib/drm_lib.sh
All tests want that anyway.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-23 21:03:07 +02:00
Chris Wilson
8cb89f7c4c 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>
2014-07-23 18:36:10 +01:00
Thomas Wood
743dc7997a 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>
2014-07-23 16:43:05 +01:00
Thomas Wood
784344ef88 lib: add an exit code to use when invalid options are specified
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-23 16:43:05 +01:00
Thomas Wood
561d519e67 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>
2014-07-23 15:23:54 +01:00
Thomas Wood
c584d5c671 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>
2014-07-23 15:23:54 +01:00
Thomas Wood
80d2c9bf82 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>
2014-07-23 15:23:54 +01:00
Thomas Wood
82b424a419 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>
2014-07-23 15:23:54 +01:00
Thomas Wood
e2cef00896 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>
2014-07-23 15:23:53 +01:00
Thomas Wood
94ac74ebb8 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>
2014-07-23 15:23:53 +01:00
Thomas Wood
e73008bae3 tests: remove unused getopt header includes
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-23 15:23:53 +01:00
Thomas Wood
e057b86109 lib: warn when attempting to run an unknown subtest
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-23 15:23:53 +01:00
Tvrtko Ursulin
bf57e93f50 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>
2014-07-23 14:52:31 +02:00
Chris Wilson
70e6ed92ab linux: Flush page/buffer cache before querying available memory
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-21 16:32:42 +01:00
Chris Wilson
784b77257b 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>
2014-07-21 16:32:42 +01:00
Chris Wilson
acca724b42 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>
2014-07-21 16:32:42 +01:00
Chris Wilson
4f7d4dcae5 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>
2014-07-21 16:32:42 +01:00