summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
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>
2014-07-23lib: add igt_simple_init_parse_optsThomas Wood
This function allows simple tests to register additional command line options. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-23lib: move option parsing into common_initThomas Wood
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-23tests: remove unused getopt header includesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-23lib: warn when attempting to run an unknown subtestThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-21linux: Flush page/buffer cache before querying available memoryChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-21Quieten valgrindChris Wilson
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-21Use SIGTERM in replace of SIGQUITChris Wilson
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-17core: increase the exit handler limitThomas Wood
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>
2014-07-15lib/igt.cocci: Add s/assert/igt_assert/Daniel Vetter
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>
2014-07-14lib/igt_core: Fixup gtkdoc for logging functionsDaniel Vetter
Without the () gtkdoc won't recognize them as function references. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-14lib: Add argc/argv to igt_simple_initDaniel Vetter
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>
2014-07-11lib/igt.cocci: Add stanza for for_each_pipeDaniel Vetter
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>
2014-07-11lib: Extract gem_get_tiling() from a couple of tests.Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11igt_kms: Introduce a for_each_pipe() macroDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11igt_kms: Add support for setting plane rotationDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11igt_kms: Add a way to query of the plane supports rotationDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11igt_kms: Provide a get_plane_property() shorthandDamien Lespiau
So one doesn't have to write the plane type all the time. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11igt_kms: Factor out a generic get_property() out of get_drm_plane_type()Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-11lib/igt_core: Don't log when listing subtestsDaniel Vetter
I've noticed some spam in the userptr list ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-11lib: allow the edid to be resetThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-11lib: add igt_enable_connectors and igt_reset_connectorsThomas Wood
igt_enable_connectors forces connectors to be enabled where doing so is known to work well. igt_reset_connectors resets the force state on all connectors.
2014-07-11lib: add the ability to set an EDID data block on a connectorThomas Wood
Add a function to set an EDID data block on a connector and include a set of generic EDID blocks for testing. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-11lib: add function to change connector statesThomas Wood
Add an API function and a test program to force a particular state on a connector. v2: mask the correct part of the minor number to get the card number (Chris Wilson) Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-07-11Wait for any pid in order to reap failure quickerChris Wilson
When waiting for the forked tests, we can respond quicker to a failure (such as oom) by waiting for any child to exit rather than waiting for each child in order. Then when we see that a test failed, we can kill all other children before aborting. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-07-10core: Apply the same treatment to the in errno message in __igt_fail_assert()Damien Lespiau
Just like the it was done for the requirement message, display the errno message only if errno is set, and display it at the end of the assert message. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-10core: Only display the errno message if errno is setDamien Lespiau
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-10core: Put the requirement failure messages togetherDamien Lespiau
The errno message was a bit in the middle here, it makes more sense to group the messages about why the test requirement wasn't met together. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-10lib/gen6_render: removed duplicate definesMika Kuoppala
Textually the same so no harm was done and no warnings from compiler either. Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2014-07-07kms_plane: Add panning test for primary planeYi Sun
Get CRCs of a full red and a full blue surface as reference. Create a big framebuffer that is twice width and twice height as the current display mode. Fill the top left quarter with red, bottom right quarter with blue Check the scanned out image with the CRTC at position (0, 0) of the framebuffer and it should be the same CRC as the full red fb Check the scanned out image with the CRTC at position (hdisplay, vdisplay) and it should be the same CRC as the full blue fb v2: Fix a few things here and there (Damien) Cc: Lei Liu <lei.a.liu@intel.com> Cc: Yi Sun <yi.sun@intel.com> Signed-off-by: Lei Liu <lei.a.liu@intel.com> Signed-off-by: Yi Sun <yi.sun@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07pipe_crc: Make collect_crc() ensure the CRC looks somewhat validDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07pipe_crc: Warn if the CRC values is 0xffffffffDamien Lespiau
This is what we read when the CRC logic in in a powered down well. We really don't want that to happen. In theory, it's possible 0xffffffff to be a valid CRC value, so I don't assert here. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07lib: Reset 'position_changed' after a drmModeSetCrtc()Damien Lespiau
So the next commit won't trigger a drmModeSetCrtc() if the primary plane doesn't have any update needing it. This shouldn't be a problem at the moment as we don't allow the primary plane to be of a different size than the CRTC viewport, but it will most likely change in the future and we don't want to have that bug there. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-07lib/kms: Provide universal plane #define'sMatt Roper
There hasn't been a libdrm release containing the universal plane definitions yet, so add them to igt_kms to allow compilation to succeed in the meantime. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-07-04lib/kms: Drop primary plane windowing test from igt_plane_set_position()Matt Roper
None of our hardware can support this today, but we'd like to be able to write tests that check that the kernel returns the proper error code when userspace tries it anyway. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04lib/kms: Add universal plane support (v2)Matt Roper
Add support for universal planes. This involves revamping the existing plane handling a bit to allow primary & cursor planes to come from the DRM plane list, rather than always being manually added. v2: Don't drop fixed ordering of internal plane list. Primary will always be index 0, cursor will always be last in internal plane list. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04lib/kms: Add igt_display_try_commit2()Matt Roper
Add a new public API that will attempt a display commit, but will return an error code upon failure rather than failing the IGT test. This is intended to allow igt tests to verify that the expected error codes are returned to userspace when invalid requests are issued. Note that with non-atomic programming, a single commit operation has several potential failure points internally; the first non-zero error code encountered will be returned immediately and no further programming will be performed by the commit. It is the caller's responsibility to return to a sane state. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04lib/kms: Add igt_display_commit2()Matt Roper
Add a new commit interface, igt_display_commit2(), that allows tests to specify which programming API should be used to perform hardware updates. COMMIT_LEGACY is the only option for now, but universal and atomic interfaces will be added as additional options in the future. igt_display_commit() remains unchanged for existing tests that wish to place the hardware in a specific state, but that don't care which API is used to achieve that state. The legacy API will be used by default for now, but in the future we may decide to make the default API configurable via an environment variable. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04lib/kms: Track need for vblank wait locallyMatt Roper
The need to wait for a vblank after programming is due to the way we actually program the hardware. Move need_wait_for_vblank out of the pipe and into a local variable in preparation for future programming styles (e.g., atomic pageflip) that will need different logic. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-07-04lib/kms: Drop igt_pipe->need_set_{crtc, cursor}Matt Roper
The "need" flags on igt_pipe simply mirror the fb_changed field of the primary/cursor planes. Drop them and just use fb_changed instead. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2014-06-17Paritially revert "lib: add missing includes to headers"Daniel Vetter
This reinstates the #includes for lib/debug.h since without that the shader debugger fails to build. You need to manually enable it with ./autogen.sh --enable-shader-debugger and the fail only happens when running a clean build with $ git clean -dfx && ./autogen.sh --enable-shader-debugger && make I have no idea what breaks, but this restores the build. Reported by Ben Widawsky. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-16lib: add missing includes to headersThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-16lib: ensure igt_display_init clears the memory for the display structThomas Wood
Add the call to memset that was accidentally removed in: commit 1e9e1baba389fe498be12390ceeeacb1d141a5cf Author: Daniel Vetter <daniel.vetter@ffwll.ch> Date: Thu Mar 13 17:20:05 2014 +0100 lib/igt_kms: rip out custom verbose loggin support Instead just piggy-pack on top of igt_log. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-06-13tools/intel_display_poller: Add a new tool that will poll various display ↵Ville Syrjälä
registers intel_poller can be used to poll various display registers (IIR,scanline/pixel/flip/frame counter, live address, etc.). It can be used to determine eg. at which scanline or pixel count certain events occur. v2: s/intel_poller/intel_display_poller/ Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-06-13tools: Add intel_iosf_sb_{read,write} toolsVille Syrjälä
Add generic tools to poke at IOSF sideband. The user needs to manually specify SB port as well as the register. TODO: Maybe add symbolic names for the units? Would avoid having to trawl the docs for the magic hex value. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>