summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2014-08-29igt: Tweak the igt_assert_cmpint macroChris Wilson
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>
2014-08-29lib/batchbuffer: Guard intel_blt_copy with even more assertsChris Wilson
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>
2014-08-29lib/batchbuffer: Store the gen in a local variableChris Wilson
Reduce lookups and improve code clarity. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29igt: Prettify igt_assert_eq() failure messagesChris Wilson
This just improves the language about the exact failure to reduce confusion. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-26lib: Use igt macros moreDaniel Vetter
Stragglers. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-26lib/igt_* Use igt macros in igt libariesDaniel Vetter
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>
2014-08-26lib/intel_* Use igt checks and macrosDaniel Vetter
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>
2014-08-26lib/rendercopy*: Use igt_assertDaniel Vetter
2014-08-21lib/fb: Assert, instead of silently failing, when creating fbsDamien Lespiau
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>
2014-08-21lib/fb: Replace straight igt_fail() by asserts with debug messagesDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-08-21lib: Change the fb creation functions to take fully qualified tiling formatsDamien Lespiau
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>
2014-08-14lib: add igt_restore_vt_modeThomas Wood
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>
2014-08-12lib/igt_kms: doc for the remaining kmstest_ functionsDaniel Vetter
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>
2014-08-12lib/igt_kms: Simplify return value of kmstest_get_connector_configDaniel Vetter
A plain bool is enough. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: Simplify return value of kmstest_get_connector_default_modeDaniel Vetter
A plain bool is good enough, no need for fancy negative error values. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: Shuffle kmtests_ functionsDaniel Vetter
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>
2014-08-12lib/igt_kms: set_vt_graphics_mode is a low-level helperDaniel Vetter
So give it a kmstest_ prefix and shuffle it around a bit. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: doc for type2str functionsDaniel Vetter
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>
2014-08-12lib/igt_kms: Clean up the other _name functions/macrosDaniel Vetter
And remove sprite_name, redundant and won't work due to lack of dev_priv. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-12lib/igt_kms: Unify pipe name helpersDaniel Vetter
And add api doc while at it. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-08-07igt_kms: add kmstest_unset_all_crtcs()Paulo Zanoni
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>
2014-08-07igt_kms: document and export kmstest_get_property()Paulo Zanoni
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>
2014-08-07igt_kms: optionally return the property from get_propertyPaulo Zanoni
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>
2014-08-07igt_kms: pass drm_fd instead of igt_display_t on some functionsPaulo Zanoni
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>
2014-08-07igt_kms: don't get drmModeRes just to free it laterPaulo Zanoni
Stress testing malloc is not our goal :) Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-08-06lib/chv: CHV media pipeline command sequenceSean V Kelley
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>
2014-07-30core: Add all kernel log levelsChris Wilson
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-30lib: don't abort if forcing the connector state failsThomas Wood
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-30lib: check test options for conflictsThomas Wood
Check any test specific options for conflicts with the standard set of options. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-30lib: avoid getopt value conflicts with testsThomas Wood
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-29lib: Add ndebug to the headersBen Widawsky
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-29lib: Don't take a reference to the surface in get_cairo_surface()Damien Lespiau
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-29lib: NULLify ->cairo_surface once unmappedDamien Lespiau
Just a matter of not leaving dangling pointers around. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-29lib: Split the GTT mapping out of get_cairo_surface()Damien Lespiau
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-29lib: Remove unused field from struct igt_fbDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-25drmtest: First check that driver is i915Chris Wilson
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-25intel-gpu-tools: fix version.h creation in androidTim Gore
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-25core: Inject program name into dmesgChris Wilson
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-25core: Improve phrasing for test requirementsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-24core: Inject subtest message into dmesgChris Wilson
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-24igt_core: Read manpages more carefully for WNOHANGChris Wilson
/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-24igt_core: Refactor igt_stop_helper() to use igt_wait_helper()Chris Wilson
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-24core: Only use signalsafe functions inside signal handlersChris Wilson
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-23linux: placate drop_caches and pass it a '\n'Chris Wilson
Apparently it doesn't have much effect without the newline. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-23build: improve version.h generationThomas Wood
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-23lib: add an exit code to use when invalid options are specifiedThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-23lib: add a command line option to enable debug output in testsThomas Wood
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-23lib: always warn about unknown optionsThomas Wood
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-23tests: convert simple tests to use igt_simple_init_parse_optsThomas Wood
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-23lib: don't ignore unknown options in multi-testsThomas Wood
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>