summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2017-08-30lib/kmod: Fix error reporting for kmod load/unloadChris Wilson
A "return -err ? err < 0 : err" managed to slip through. So if err was set, we returned 0 or 1 based on sign, or 0 if err was zero. If err is negative, we want treat it as an error, so report it back to the caller, all other values were a success, so convert those to 0. This should actually be no functional change, as all errors were reported as 1, and everything else as 0. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-08-28lib/igt_core: Use HTML character for documentation comment in examplePaul Kocialkowski
The gtkdoc output for the example configuration given in the file confuses gtkdoc because of the use of # for comments, that is interpreted as a headline (although it is an example block). This uses the HTML character instead to ensure the rendering is correct. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> (with one small typo fixed) Reviewed-by: Lyude Paul <lyude@redhat.com>
2017-08-24lib/core: Use igt_info instead of printfDaniel Vetter
igt_info doesn't add anything when printing to stdout, but so looks the same. But it has the upside of appending the lines also to the igt crashdump log, where I especially want the backtraces. Atm they're the only thing that doesn't end up in there, which is a bit confusing. While at it also convert the other lines - the test summary usually doesn't make it since the test fails before that, and the version line tends to scroll off the crashdump. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-08-21lib: Add ALSA library with dedicated helpersPaul Kocialkowski
This introduces an ALSA library, with dedicated helpers for handling playback and capture. It handles ALSA device identification and configuration as well as a run loop with callback mechanisms for feeding output data and handling input data. This library paves the way for testing audio going through display connectors, such as HDMI. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2017-08-21lib: Add audio library with dedicated helpersPaul Kocialkowski
This introduces an audio library, with dedicated helpers for both generating signals and detecting peak frequencies in a signal. This library paves the way for testing audio going through display connectors, such as HDMI. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2017-08-16lib/dummyload: Pad with a few nops so that we do not completely hog the systemChris Wilson
Part of the attraction of using a recursive batch is that it is hard on the system (executing the "function" call is apparently quite expensive). However, the GPU may hog the entire system for a few minutes, preventing even NMI. Quite why this is so is unclear, but presumably it relates to the PM_INTRMSK workaround on gen6/gen7. If we give the system a break by having the GPU execute a few nops between function calls, that appears enough to keep SNB out of trouble. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Cc: Daniel Vetter <daniel.vetter@intel.com> [danvet: Add bugzilla link] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-08-14lib/igt_kms: Remove vblank wait after plane update.Maarten Lankhorst
With the conversion to atomic, this is already handled in the core. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-08-14lib/kms: Check usage of for_each_*Daniel Vetter
Except for for_each_pipe_static they cannot be used outside of fixtures/subtest. Assert this. This will make the broken version of kms_ccs assert when run, which also would have made $make check fail. Cc: Daniel Stone <daniels@collabora.com> Cc: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-08-14lib/kms: Add for_each_pipe_staticDaniel Vetter
for_each_pipe cannot be used for enumerating testcases, so provide something that can. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-08-14lib: Add igt_can_fail()Daniel Vetter
Useful to make sure folks use library helpers correctly. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-08-08lib: Remove illegal instructions from hang injectionChris Wilson
The idea behind using an illegal instruction was to hang the GPU must faster than simply using the recursive batch. However, we stopped doing so on gen8+ as the CS parser was much laxer and allowed the illegal command through but still interpreted the packet length (jumping over the recursive batch buffer start that followed). Sandybridge doesn't just hang the GPU when it encounters an illegal command on the BLT engine, it hangs the machine. That goes above and beyond testing our hangcheck + reset, so remove the deadly instructions. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-08-01lib/igt_debugfs: Prevent compiler warning on unchecked printf formatGabriel Krisman Bertazi
Commit 34a54192e1fb ("lib/igt_debugfs: Add extended helper to format crc to string") introduced the following compiler warning: igt_debugfs.c: In function ‘igt_crc_to_string_extended’: igt_debugfs.c:373:4: warning: format not a string literal, argument types not checked [-Wformat-nonliteral] i == (crc->n_words - 1) ? '\0' : delimiter); This patch addresses the warning while also preventing a possible bad memory access access if n_words is > 64. I have no clue why we care about the padding size (crc_size), but since this was added recently, I'd rather leave it alone. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-07-28lib/aux: Better debug output for rtcwakeDaniel Vetter
Printing the error code is kinda useful. Also tune down the blame shifting away from i915, this could very well be an i915 bug, not just a setup issue. Also move the notice to the require test, not the failure, and suggest to look into dmesg. v2: Dont print errno, igt_require/assert already do that in the failure case (Chris). Acked-by: tomi.p.sarvela@intel.com Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2017-07-25lib/igt_draw: add support for Y tilingPaulo Zanoni
Most of the patch is to change the tile/untile functions so they can work with Y-major tiling. v2: (Praveen) No skipping on BLT for Y-tile now as we have a fix for that. Reviewed-by: Praveen Paneri <praveen.paneri@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
2017-07-25lib/igt_fb: Add helper function for tile_to_modPraveen Paneri
igt_get_fb_tile_size function takes modifer as an argument This helper function will let users to convert tiling to modifier and use igt_get_fb_tile_size() v2: Improved code comment (Paulo) v3 (from Paulo): Simple rebase. Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Praveen Paneri <praveen.paneri@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2017-07-25lib/igt_fb: Let others use igt_get_fb_tile_sizePraveen Paneri
This function can be used by igt_draw to get accurate tile dimensions for all tile formats. v2: Added comments to function igt_get_fb_tile_size (Daniel) v3: Fixed errors in comments and coding style (Paulo) Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Praveen Paneri <praveen.paneri@intel.com>
2017-07-25lib/drmtest: Decode driver flags on failureDaniel Vetter
I spent too much time going wtf why does this test not run until realizing that vgem is missing. This should help a lot for tests that need multiple different drm drivers. v2: Distinguish "any" and "other" (Chris). Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2017-07-24docs: Update documentation generation with missing entriesPaul Kocialkowski
This adds missing entries for documentation generation, both for tests and the API reference. The list of tests is made complete and ordered alphabetically, with modified descriptions for consistency. More files are added to the API reference, with a minimalistic description block added to them when it was missing. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-07-20lib/igt_core: Split out env-related handling to common_init_envPaul Kocialkowski
This moves the parts of the code doing env-related handling from common_init to a new dedicated common_init_env function, making common_init a bit more readable. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-20lib/igt_core: Move all config-related parsing to common_init_configPaul Kocialkowski
This moves all the pieces related to config parsing to the dedicated function for this purpose, renamed common_init_config for consistency. It allows making the common_init function less big and more readable. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-20chamelium: Add support for VGA frame comparison testingPaul Kocialkowski
This adds support for VGA frame comparison testing with the reference generated from cairo. The retrieved frame from the chamelium is first cropped, as it contains the blanking intervals, through a dedicated helper. Another helper function asserts that the analog frame matches or dump it to png if not. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-20lib/igt_frame: Add support for analog frame comparison testingPaul Kocialkowski
This adds support for analog frame comparison check, as used in VGA. Since VGA uses a DAC-ADC chain, its data cannot be expected to be pixel perfect. Thus, it is impossible to uses a CRC check and full frames have to be analyzed instead. Such an analysis is implemented, based on both an absolute error threshold and a correlation with the expected error trend for a DAC-ADC chain. It was tested with a couple encoders and provides reliable error detection with few false positives. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-20lib/igt_core: Handle glib errors correctly to avoid stderr spewPaul Kocialkowski
This adds the required error clean/free calls after calling configuration parsing functions. In addition to properly handling memory, this avoids glib spewing out error messages on stderr, which breaks the whole CI with this message: GLib-WARNING **: GError set over the top of a previous GError or uninitialized memory. This indicates a bug in someone's code. You must ensure an error is NULL before it's set. The overwriting error message was: Key file does not have group ?DUT? Fixes: ee31e0b5 ("Introduce common frame dumping configuration...") Cc: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Cc: Lyude <lyude@redhat.com> Cc: Martin Peres <martin.peres@linux.intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
2017-07-19igt_core: Add the rest of Paul's patch I forgot by accidentLyude
Whoops, I meant to commit the entirity of Paul's patch but it appears I forgot to stage all of the changes to igt_core. This should have been included in the previous commit. Signed-off-by: Lyude <lyude@redhat.com>
2017-07-19chamelium: Dump captured and reference frames to png on crc errorPaul Kocialkowski
This adds support for dumping both the frame capture from the chamelium and the reference frame generated by cairo when the captured crc does not match the crc calculated from the reference, using common helpers. Getting a dump of the frames is quite useful in order to compare them. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-19lib/igt_debugfs: Add extended helper to format crc to stringPaul Kocialkowski
This introduces a igt_crc_to_string_extended helper that allows formatting a crc to a string with a given delimiter and size to print per crc word. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-19Introduce common frame dumping configuration and helpersPaul Kocialkowski
This introduces a common FrameDumpPath configuration field, as well as helper functions in dedicated igt_frame for writing cairo surfaces to png files. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-19lib/igt_debugfs: Introduce CRC check function, with logic made commonPaul Kocialkowski
This introduces an igt_check_crc_equal function in addition to igt_assert_crc_equal and makes the CRC comparison logic from the latter common. In particular, an igt_find_crc_mismatch function indicates whether there is a mistmatch and at what index, so that the calling functions can print the diverging values. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-19chamelium: Calculate CRC from framebuffer instead of hardcoding itPaul Kocialkowski
This introduces CRC calculation for reference frames, instead of using hardcoded values for them. The rendering of reference frames may differ from machine to machine, especially due to font rendering, and the frame itself may change with subsequent IGT changes. These differences would cause the CRC checks to fail on different setups. This allows them to pass regardless of the setup. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-19lib/igt_fb: Export the cairo surface instead of writing to a pngPaul Kocialkowski
This removes the igt_write_fb_to_png function (that was unused thus far) and exports the igt_get_cairo_surface function to grab the matching cairo surface. Writing to a png is now handled by the common frame handling code in lib/igt_frame. This also fixes how the surface is retreived in chamelium code, which avoids destroying it too early. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-18lib/igt_debugfs: Update documentation and cleanupArkadiusz Hiler
The documentation was lying. The igt_crc_to_string() is threadsafe and does not return a pointer to an internal buffer. Actually the caller is responsible for the memory that is allocated (and they are for all the current cases), so let's put that in the doc too. While I was at it I got rid of strdup() in favor of an early allocation. Cc: Martin Peres <martin.peres@intel.com> Cc: Liviu Dudau <liviu.dudau@arm.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Martin Peres <martin.peres@intel.com>
2017-07-17lib: Add reset-type helper in ioctl_wrappersMichel Thierry
Soon we will have tests that are only for platforms with reset-engine (GEN8+), so add a helper to query the has_gpu_reset via the getparam ioctl. v2: Add more helper functions to avoid using magic numbers in tests (Arek). Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Michel Thierry <michel.thierry@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-07-13lib/igt_draw: Add Y-tiling support for IGT_DRAW_BLT methodAkash Goel
v2: Moved identical code into a single function (Paulo) v3 (from Paulo): stay under 80 columns. Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Akash Goel <akash.goel@intel.com> Signed-off-by: Praveen Paneri <praveen.paneri@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2017-07-10igt/kms: Do not wait for fence completion during commitMaarten Lankhorst
This will make the IGT tests that use fences more useful, since they can perform the waiting themselves when required. To celebrate, also add plane-use-after-nonblocking-unbind-fencing, the fence version of plane-use-after-nonblocking-unbind. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Gustavo Padovan <gustavo.padovan@collabora.com>
2017-07-10lib/kms: Handle fence interaction correctly WRT TEST_ONLY.Maarten Lankhorst
All other atomic properties are reset in display_commit_changed, which is the right place because TEST_ONLY commits don't need to be reset. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Gustavo Padovan <gustavo.padovan@collabora.com>
2017-07-06Make igtrc configuration common, with configurable suspend/resume delayPaul Kocialkowski
This adds support for configurable suspend/resume delay and takes the occasion to move igtrc configuation from igt_chamelium to igt_core. This way, suspend/resume delay configuration can be used for all tests. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2017-07-06chamelium: Remove init reset duplicate in favor of per-test resetPaul Kocialkowski
Since most tests are already doing a reset, there is no need to duplicate it at init time. This removes that duplicate reset and adds a call to reset_state where in-test resets where not done previously. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2017-07-06Revert "igt: Remove default from the engine list"Chris Wilson
This reverts commit d7a0b61450797a3d6644c65aebf75c2a90da1a15.
2017-07-06igt: Remove default from the engine listTvrtko Ursulin
Default is not an engine but an ABI alias for RCS. Remove it from the engine list to eliminate redundant subtests and test passes. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Acked-by: Daniel Vetter <daniel.vetter@intel.com>
2017-06-30lib/i915_pciids.h: Organize cnl/cfl ids.Rodrigo Vivi
No functional change. When CNL patches got rebased on top of cfl the ids ended up in the middle of CFL ids. So let's clean-up this mess a bit. Also remove a spurious line. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2017-06-30lib/intel_batchbuffer: Add Gen10 support for render_copy and gpgpu_fillfunc.Rodrigo Vivi
None of the fields we use on render_copy and gpgpu_fill has changed when compared to gen9. So let's reuse them. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2017-06-30lib/instdone: Add Gen10 support.Rodrigo Vivi
Apparently nothing changed since BDW on these instdone bits. So let's reuse instead of empty duplication. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2017-06-30lib/cnl: Add Cannonlake PCI IDs for Y-skus.Rodrigo Vivi
By the Spec all CNL Y skus are 2+2, i.e. GT2. This is a copy of merged i915's commit 95578277cbdb ("drm/i915/cnl: Add Cannonlake PCI IDs for Y-skus.") v2: Based on Anusha's kernel clean-up. Cc: Anusha Srivatsa <anusha.srivatsa@intel.com> Cc: Clinton Taylor <clinton.a.taylor@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Clinton Taylor <clinton.a.taylor@intel.com>
2017-06-30lib/cnl: Add Cannonlake PCI IDs for U-skus.Rodrigo Vivi
Platform enabling and its power-on are organized in different skus (U x Y x S x H, etc). So instead of organizing it in GT1 x GT2 x GT3 let's also use the platform sku. This is also the new Spec style what makes the review much more easy and straightforward. This is a copy of merged i915's commit e918d79a5d0a ("drm/i915/cnl: Add Cannonlake PCI IDs for U-skus.") v2: Based on Anusha's kernel clean-up. v3: Add kernel commit id for reference. Cc: Anusha Srivatsa <anusha.srivatsa@intel.com> Cc: Clinton Taylor <clinton.a.taylor@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Clinton Taylor <clinton.a.taylor@intel.com>
2017-06-30lib/cnl: Introduce Cannonlake platform defition.Rodrigo Vivi
Cannonlake is a Intel® Processor containing Intel® HD Graphics following Kabylake. It is Gen10. Let's start by adding the platform definition based on previous platforms. On following patches we will start adding PCI IDs and the platform specific changes. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2017-06-29lib/cfl: Add PCI Ids for U SKU in CFlAnusha Srivatsa
Follow the spec and add ID for U SKU v2: Update IDs in accordance to the kernel commit: d29fe702c9cb682df99146d24d06e5455f043101 (Chris) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com> Reviewed-by: Clint Taylor <clinton.a.taylor@intel.com>
2017-06-29lib/cfl: Add PCI IDs to H SKU in CFlAnusha Srivatsa
Follow the spec and add the ID for H SKU in CFL. v2: Update IDs following kernel commit: ccfd13215fd25a0e8c28221f3acc0dcaec11cd15 (Chris) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com> Reviewed-by: Clint Taylor <clinton.a.taylor@intel.com>
2017-06-29lib/cfl: Add Coffeelake PCI IDs for S SKU.Anusha Srivatsa
Just following the spec and adding these extra IDs. v2: update IDs following the kernel commit: b056f8f3d6b900e8afd19f312719160346d263b4 (Chris) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Anusha Srivatsa <anusha.srivatsa@intel.com> Reviewed-by: Clint Taylor <clinton.a.taylor@intel.com>
2017-06-29lib/cfl: Introduce Coffeelake platform definition.Rodrigo Vivi
Coffeelake is a Intel® Processor containing Intel® HD Graphics following Kabylake. It is Gen9 graphics based platform on top of CNP PCH. On following patches we will start adding PCI IDs and the platform specific changes. Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Clinton Taylor <clinton.a.taylor@intel.com>
2017-06-28lib/ioctl_wrappers: Fix some commentsArkadiusz Hiler
"This is a wraps" -> "This wraps" "hw/hardware context" -> "context" gem_context_create does not use igt_require() but igt_skip_on() so make the similarity note more vague and in result true. Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>