summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)AuthorFilesLines
2015-05-28lib/igt_core.c: Flag the test as failing after a segfaultDerek Morton1-1/+8
fatal_signal_handler() was trapping fatal errors but not flagging the test as failing or setting an exit code. The result was that the test would return Ok or Skipped depending on what the other subtests did even though one of the subtests had segfaulted. Signed-off-by: Derek Morton <derek.j.morton@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-27lib: Enable building unit tests on androidDerek Morton2-1/+44
Add a make file for android so the unit tests can be built. Enabled asserts for the library code so the unit test behaviour is correct. Signed-off-by: Derek Morton <derek.j.morton@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-18lib/bxt: Update the Broxton PCI IDsDamien Lespiau1-5/+3
Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-15lib: Add a user data pointer to the argument parsing functionsDamien Lespiau2-13/+24
It can be useful to have one of those to carry state between the handler parsing the options and the rest of the test. Right now the only thing we can do is to use global variables for that. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-14igt.cocci: don't use igt_assert_neq to compare pointersThomas Wood1-1/+1
igt_assert_neq can only compare integers, not pointers. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-14docs: various documentation fixesThomas Wood3-5/+19
Fix various typos, add missing parameter documentation, include the igt_draw section and update the list of ignored headers. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-14lib/debugfs: wait_for_keypress("crc") when collecting CRCPaulo Zanoni1-0/+6
Let's just steal the "crc" namespace and add this by default to igt_pipe_crc_collect_crc() instead of adding more calls to other tests. If tests want special waits on just some of their collect_crc() calls, they can use another name instead of "crc". This is very useful when developing, especially when the CRC we get is wrong: we want to look at the screen to see what's going on before we can think about how to fix the problem. So let's add this to the lib instead of adding this to every single test I need to debug. v2: Add some documentation (Daniel). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-12igt_kms: Do not reset plane position on assigning a fbTvrtko Ursulin1-3/+1
commit a26f9f9ad0e679c7ce413a25d34f6914e1174151 Author: chandra konduru <chandra.konduru@intel.com> Date: Mon Mar 30 13:52:04 2015 -0700 i-g-t: Adding plane scaling test case Started doing this and broke kms_rotation_crc. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: chandra konduru <chandra.konduru@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-12igt_kms: Merge condition in igt_plane_set_fbTvrtko Ursulin1-8/+3
There were two paths for fb and !fb. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: chandra konduru <chandra.konduru@intel.com> Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-12igt_kms: Avoid NULL ptr deref when commiting disabled planesTvrtko Ursulin1-1/+1
I think; commit a26f9f9ad0e679c7ce413a25d34f6914e1174151 Author: chandra konduru <chandra.konduru@intel.com> Date: Mon Mar 30 13:52:04 2015 -0700 i-g-t: Adding plane scaling test case introduced a condition where it attempts to update a disabled plane because of the newly introduced size_changed flag which is set for disabled frame buffers. Result is a NULL ptr deref in igt_drm_plane_commit (plane->fb->src_x). Start recognising this case as disabled plane and act accordingly. v2: Split out igt_plane_set_fb cleanup. (Thomas Wood) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: chandra konduru <chandra.konduru@intel.com> Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-11lib: Add missing '\n' to error messageDamien Lespiau1-4/+8
Those messages where missing a new line at the end. Take the opportunity to re-format the messages to fit in the 80 chars limit. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-10lib/core: Limit fatal signal CRASH reporting to the fatal signalsChris Wilson1-1/+13
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-08lib: Teach igt to handle signal failures gracefullyChris Wilson2-7/+9
If we see a fatal signal in a subtest, fail. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-05-07lib: add igt_drawPaulo Zanoni3-0/+629
For all those IGT tests that need an easy way to draw rectangles on buffers using different methods. Current planned users: FBC and PSR CRC tests. There is also a tests/kms_draw_crc program to check if the library is sane. v2: - Move the test from lib/tests to tests/ (Daniel). - Add igt_require() to filter out the swizzling/tiling methods we don't support (Daniel). - Simplify reloc handling on the BLT case (Daniel). - Document enum igt_draw_method (Daniel). - Document igt_draw_get_method_name() (Paulo). v3: - Add IGT_DRAW_MMAP_WC (Chris). - Implement the other trivial swizzling methods (Chris). - Remove the gem_sync() calls (Chris). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-06lib/mmio: One more s/OUTRET/OUTREG/Daniel Vetter1-1/+1
A those typos ... Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-05-05lib/batchbuffer: Fix COLOR_BLIT_COPY_BATCH_STARTDaniel Vetter1-0/+1
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-05-05lib: add igt_wait()Paulo Zanoni2-17/+44
Just a little helper for code that needs to wait for a certain condition to happen. It has the nice advantage that it can survive the signal helper. Despite the callers added in this patch, there is another that will go in a separate patch, and another in a new IGT test file that I plan to push later. v2: Check COND again before returning in case we hit the timeout. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-05rename global mmio variable to igt_global_mmioJani Nikula2-30/+29
Global variable names should reflect the fact that they are indeed global, and at the very least they should not be as short as just "mmio". Rename mmio to igt_global_mmio. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-05lib: add 16 and 8 bit versions of INREG and OUTREGJani Nikula2-5/+76
Add INREG8, INREG16, OUTREG8, and OUTREG16. While at it, cleanup doc comments of INREG and OUTREG. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2015-05-01igt_fb: Close the image file when we are done with itTvrtko Ursulin1-0/+2
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-05-01lib/igt_core.c : only disable low mem killer onceTim Gore1-4/+9
The call to low_mem_killer_disable(true) was being done from within function oom_adjust_for_doom. However, oom_adjust_for_doom gets called from 3 places. We only want the call to low_mem_killer_disable(true) to happen during common_init, so call it from here instead of from oom_adjust_for_doom. v2:Thomas Wood pointed out that the initial call to disable the low_mem_killer does not get made when we are just listing subtests; so I have qualified the call from the exit handler, which re-enables the low_mem_killer, with if (!igt_only_list_subtests()). For belt and braces I have also made low_mem_killer_disable idempotent, so multiple calls to disable or re-enable are safe. Signed-off-by: Tim Gore <tim.gore@intel.com> [Thomas: small coding style fix] Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-29igt_fb: Transfer existing content to Cairo surface for Y/Yf frame buffersTvrtko Ursulin1-16/+40
Rendering into Y and Yf tiled frame buffers with Cairo was losing the previous content ie. was starting from black. This is different than the behaviour with linear and X tiled so make it the same by blitting the initial content when creating the rendering context. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-04-27igt/gem_exec_big: Check 64bit relocation valuesChris Wilson2-4/+4
On gen8, we should check that the full 64bit relocation value is correct, and we should be sure to poison the relocation offset between runs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-26lib: Fix types for gem_mmap*Chris Wilson2-6/+6
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-26lib: Cache static queriesChris Wilson3-44/+89
We frequently check for device capabilities, for which we can safely assume that there is but one on a system and so cache the first query value and return it for all future queries. The benefit is to reduce dmesg debug spam which helps when either bringing up a test or trying to track down why a test fails. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-26lib: Fix types for gem_create()Chris Wilson2-2/+2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-22lib/igt_kms: Let set_property return the resultSonika Jindal1-3/+4
Return the return value of the set_property ioctl and add check for the failure. Signed-off-by: Sonika Jindal <sonika.jindal@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-22lib/drmtest.h : fix mmap64 againTim Gore1-1/+1
In android mmap64 was redirected to mmap2 because mmap64 was not alway available. But now mmap2 has been removed from 64 bit android builds (and mmap64 is available), so update preprocessor conditional to check for __x86_64__. Signed-off-by: Tim Gore <tim.gore@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-21docs: avoid escaping characters in documentation commentsThomas Wood3-5/+5
Avoid having to escape certain characters in documentation comments by not allowing docbook markup tags. Markdown formatting in documentation comments is still supported. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-16lib/igt_aux: Introduce igt_interactive_debug_manual_check.Rodrigo Vivi2-0/+51
This is an extention of igt_debug_wait_for_keypress that also can have customized message and return key pressed. v2: This is actualy a v2. V1 was an extension of original igt_debug_wait_for_keypress but it was nacked. v3: Make [Y/n] check inside aux function as suggested by Daniel. Also renaming and adding first use case along with the axu function. v4: Simplify function name and make it assert pressed key is different from n/N as suggested by Daniel. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2015-04-16tests: Add kms_legacy_colorkeyVille Syrjälä1-0/+4
Add a quick test to make sure the legacy set colorkey ioctl only works for sprite planes. v2: Drop igt_fixtures Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-04-14lib: load images from the data directory in igt_paint_imageThomas Wood3-8/+20
Update igt_paint_image so that it can read images from the package data directory. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14lib: use a critical warning when unable to open a data fileThomas Wood1-0/+5
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14i-g-t: Adding plane scaling test casechandra konduru3-16/+115
This patch is adding i-g-t plane scaling test case to test couple basic display plane scaling usages. Additional test scenarios can be added later. v2: -Added iterative scaling to visually observe scaling (me) v3: -Added a flag to control primary plane scaling (me) v4: -Use new tiled types when calling igt_create_fb (me) Signed-off-by: chandra konduru <chandra.konduru@intel.com> [Thomas: convert test to use igt_simple_main] Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14i-g-t: Adding test case to test background color.chandra konduru2-0/+65
Adding i-g-t test case to test display crtc background color. v2: - Added IGT_TEST_DESCRIPTION() (Thomas Wood) - Added to .gitignore (Thomas Wood) - Added additional details to function header (Thomas Wood) - Simplified igt_main (Thomas Wood) v3: - rebased to latest master (me) - took sleep calls out (Daniel) - use new tiled types when calling igt_create_fb (me) Signed-off-by: chandra konduru <chandra.konduru@intel.com> [Thomas: convert test to use igt_simple_main] Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14tests: create a single combined test listThomas Wood1-1/+1
All tests now respond in a consistent way such that separate lists for tests with and without subtests are no longer necessary. v2: fix other references to the test list Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14lib: use test failure status for igt_set_timeoutThomas Wood2-3/+6
Use a failure status code for timeout to avoid confusion between tests that take too long to execute versus a failure due to an operation taking longer than expected. v2: Add a "timed out" message before exiting. (Daniel Vetter) Fix the timeout library check by disabling hard errors in xfail tests, since these share the same exit status as test failure. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14lib: add a define for test failure exit statusThomas Wood4-11/+17
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-14lib: Implement gem_sync() using WAITChris Wilson1-3/+13
When synchronising to rendering, we only want to wait for it to complete and avoid the cache-domain side-effects of SET_DOMAIN if possible. This has the advantage of speeding up a few tests (and thereby making the actual test more explicit in terms of kernel operations). Of course some tests may be reliant on the side-effects... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-04-08lib/bxt: Add Broxton PCI idsDamien Lespiau1-1/+11
v2: Rebase on top of the SKL upstreaming Signed-off-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Ben Widawsky <benjamin.widawsky@intel.com>
2015-04-08lib/intel_chipset: fix HAS_PCH_SPLIT on GEN9Imre Deak1-1/+1
In the next patch we'll add support for BXT which is GEN9, but doesn't have PCH, so fix the macro accordingly. No functional change. Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-04-08lib/intel_chipset: fix HAS_PCH_SPLIT on CHVImre Deak1-1/+1
CherryView is GEN8 but doesn't have PCH so fix the macro accordingly. Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-04-03igt/gem_cpu_reloc: Pretty print execbuf failuresChris Wilson1-5/+3
References: https://bugs.freedesktop.org/show_bug.cgi?id=85672 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-02tests: install test programs to libexecJoonas Lahtinen2-0/+29
Install the test programs by default so that they can be packaged. Tested with the testdisplay test so that it still runs after the modifications as it depends on a data file to be present. Need to pass -r option to enable QR code display on success (PNG data file). Packaging is useful when building a complete software stack for a DUT from scratch. This should bring us closer to achieving a built-from-scratch testing workflow. Package maintainers can always decide to ignore the installed files. v2: - Install more tests including scripts and their data v3: - Add clarification to commit message about why we do this. (Chris Wilson & Thomas Wood) - Change libexec into pkglibexec to comply to standard (Thomas Wood) - Do not install $(common_files). (Thomas Wood) - Make it really obvious the installed files are tests by using tests directory name to avoid any confusion with packagers. v4: - Fixed commit message. v5: - Add file locator helper to retain backwards compatibility. (Thomas Wood) - Test with testdisplay -r option that draws the .png file. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-31lib/kms: Add a way to override an output's modeAnder Conselvan de Oliveira2-0/+21
So that it is possible to use a custom mode with the simplified mode set API. v2: Add documentation for igt_output_override_mode(). (Thomas) Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-30lib/tests: add missing library flagsThomas Wood1-1/+1
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-30lib: add debug flagsThomas Wood1-1/+1
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-26igt.cocci: check the return values of various functionsThomas Wood7-23/+52
Add rules to fix unused-result warnings when compiling with _FORTIFY_SOURCE defined and apply them to the library and tests. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-26lib: print a stack trace when a test assertion failsThomas Wood2-3/+33
Add an optional dependency on libunwind to print stack traces when a test assertion fails. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-26igt/gem_concurrent_blit: Separate out the combinatorial explosionChris Wilson2-0/+6
Apparently nobody else likes testing and debugging GEM coherency issues. However, this also means that QA is skipping these vital tests. Split out a set of canaries into igt/gem_concurrent_blit and keep the rest in igt/gem_concurrent_all. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89497 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>