summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-04-27tests/kms_properties: Validate properties harderVille Syrjälä
Make the property validation more thorough: - validate property flags - make sure there's an expected number of values/enums - make sure the possible values make sense - make sure the current value makes sense - actually iterate through all planes/crtc/connectors to check their properties - make sure encoders don't expose properties while at it - check that atomic props aren't exposed to non-atomic clients Still passes on my ivb. Not tested anything else so far. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com>
2018-04-24lib/intel_batchbuffer: Move batch functions from media/render/gpgpu libsKalamarz, Lukasz
Batch functions were copy/pasted across several libs. With moving it into intel_batchbuffer lib test can now be easly maintained without worrying that we forgot to modify older version of lib. v2: Added documentation into lib and rebased patch v3: Fixed typos and rebased patch v4: Fixed documentation issues v5: Rename, clean up of leftovers from previous version and documentation polishing v6: Fixing assert Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-04-24lib/intel_batchbuffer: Removal of state variable from a intel_batchbuffer ↵Kalamarz, Lukasz
structure With a removal of all references to state variable there is no longer any need to keep it in structure. v5: Rebase Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-04-24lib/rendercopy_gen7: Cosmetic changes in codeKalamarz, Lukasz
This patch apply coding standard into rendercopy_gen7 library. No functional changes were made. v5: Fixed wrong indent Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-04-24lib/rendercopy_gen7: Reorganizing batch allocationsKalamarz, Lukasz
This lib was written in a different manner than all other libs, which was causing some issues during refactoring. Previous implementation was using two pointers (ptr and state) to access two parts of batchbuffer in the same time. Current implementation is reusing ptr with a downside of needing to ensure the state/command ordering is proper. v3: Modified commit message and added batch boundary check v5: Rebase Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-04-24lib/gen6_render: Cosmetic changes in codeKalamarz, Lukasz
This patch applies coding standard into gen6_render library. No functional changes were made. Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-04-24lib/gen6_render: Reorder registers and fields definitionsKalamarz, Lukasz
This patch is reordering registers and related shifts/fields to be in one place and also is sorting registers definitions in an ascending order by it memory address. v4: Fixed missing values and corrected commit message Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-04-24lib/gen6_render: Removal of duplicated definitionsKalamarz, Lukasz
Remove duplicated registers, shifts and values from lib. Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-04-18lib/intel_batchbuffer: Reuse gen9_media_fill on Gen 10Katarzyna Dec
Media fill function can be reused on Gen10. Code has not changed. Let's reuse gen9. Cc: Lucas De Marchi <lucas.demarchi@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Reviewed-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
2018-04-12lib: Adjust refactored gpu_fill library to our coding styleKatarzyna Dec
While I am making changes in gpgpu and media fill area let's adjust code to our coding style. v2: rebased on series new version (patch is now last from series so change seems larger) v3: rebased Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
2018-04-12lib/gpgpu_fill: Add missing configuration parameters for gpgpu_fillKatarzyna Dec
There are missing parameters for Gen8 configuration of gpgpu_fill that are causing GPU hangs on newer hardware. We need to set the number of threads in TG in gen8_fill_interface_descriptor. This field was omitted (apparently without any side effects), but according to bspec from BDW this field cannot be set to 0. We also need to use pipeline selection mask to gen9_gpgpu_fillfunc, which is necessary from SKL. v2: rebased on refactored library v3: Removed replacing gen7_emit_interface_descriptor_load with gen8 version in gen9_gpgpgu_fillfunc, because during refactoring gen8 function was removed. v4: rebase on series new version Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
2018-04-12lib: Remove duplications in gpu_fill libraryKatarzyna Dec
After moving all functions needed for gpgpu and media fill testing there is a lot of duplications which can be removed: Library media_fill_gen8 and media_fill_gen8lp for CHT was removed, media state flush for !CHT was added to gen7_emit_media_objects. Many gen8 functions were replaced with gen7 version with devid parameter (gen7_fill_curbe_load, gen7_emit_interface_descriptor, gen7_fill_binding_table, gen7_emit_media_objects). Unified fill kernel function so it is applicable to all gens and both media and gpgpu (merged gen7_fill_media_kernel and gen8_fill_media_kernel). Duplicated constants like GEN8_MEDIA_VFE_STATE, GEN8_MEDIA_CURBE_LOAD, GEN8_MEDIA_INTERFACE_DESCRIPTOR_LOAD, GEN8_MEDIA_OBJECT were replaced by GEN7 version. However this constants were not removed from gen8_media.h library, because they are used by other tests for Gen8+. More refactoring in this gen*_media.h libraries is needed. It seems that further unification of *_fillfunc functions will introduce more confusion in understanding what the tests are doing and what were changes between Gens. v2: Moved some reduntant changes from Move gpgpu/media fill to gpu_fill... to this patch. Applied comments from review. v3: rebase Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
2018-04-12lib: Move common gpgpu/media fill functions to gpu_fill libraryKatarzyna Dec
Gpgpu_fill and media_fill libraries are very similar and many functions can be shared. I have created library gpu_fill with all functions needed for implementing gpgpu_fill and media_fill tests for all Gens. For reviewing and debugging purposes this patch should be only moving functions from few libraries to one removing functions identical for both media and gpgpu. Places in the code that required more changes: Removing gen7_fill_gpgpu_kernel function that is identical to gen7_fill_media_kernel and introduces conflict with moving genX_fill_interface_descriptor, which are the same for media and gpgpu. Function gen8_fill_media_kernel is not removed in this patch (although it is identical with gen7 version), because this patch should be as much as possible functions movement. gen8_fill_interface_descriptor was unified for media and gpgpu by adding kernel and its size as a parameter (this parameters were missing in media gen8, gen8lp and gen9 functions) gen8_emit_state_base_address was unified, the one for gpgpu was configured like it would be using indirect state (while we are using CURBE). I have checked that media fill version (OUT_BATCH(0 | BASE_ADDRESS_MODIFY)) works fine on gpgpu gen8 and newer. v2: Changed code layout. GenX_fill_media_kernel was identical to genX_fill_gpgpu_kernel so this function was unified to gen7_fill_kernel. There were 2 very similar functions gen8_emit_state_base_address for media and gpgpu, where the one for gpgpu was configured like it would be using indirect state (while we are using CURBE). I have checked if media fill version works fine in gpgpu test on Gen8 and unified them. v3: Made patch easier for reviewing moving changes unifying code for various gens (that were included v1) to other patch, leaving only the most critical code changes. v5: Added copyrights and #ifndef to gpu_fill.h v5: Added copyrights to gpu_fill.c Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
2018-04-11lib/igt_debugfs: Add timeouts to opening pipe CRC fd.Maarten Lankhorst
This will fix the PSR tests to fail slightly faster, since they wait indefinitely for a CRC that never comes during open. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [mlankhorst: Increase timeout to 10 seconds for HSW CRC w/a.] Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2018-04-11lib/igt_kms: Reset FIFO underruns on first commit after init()/reset().Maarten Lankhorst
When we set the test to its first state, we will clear FIFO underrun status through the debugfs, so that any underruns caused by the tests will not affect other tests. In particular this also resets the FBC FIFO underrun status, so previous failures won't affect other tests that depend on FBC. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105681 Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-04-11lib/igt_kms: Handle outputs with no modes betterMaarten Lankhorst
Pretend that outputs without modes are disabled, and try reprobing if no modes are initially detected, just in case that the reprobe will find modes. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105798 Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
2018-04-10lib: Dump meminfo and slabinfo if we complain about insufficient memoryChris Wilson
All too frequently, we fail our memory checks to a leak in the driver. While we give every opportunity for the driver to release the memory before we fail, if we do dump the meminfo and slabinfo, if available, so we can assign blame^W^W resolve the problem quickly. References: https://bugs.freedesktop.org/show_bug.cgi?id=105967 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Martin Peres <martin.peres@linux.intel.com> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-04-06lib: Acquire master for pollable spinbatch on gen4/5Chris Wilson
gen4/5 require a DRM_MASTER to use MI_STORE_DW, make it so. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-04-03tests/gem_eio: Never re-use contexts which were in the middle of GPU resetTvrtko Ursulin
Contexts executing when reset triggers are potentialy corrupt so trying to use them from a subsequent test (like the default context) can hang the GPU or even the driver. Workaround that by always creating a dedicated context which will be running when GPU reset happens. v2: * Export and use gem_reopen_device so the test works on old gens as well. (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-29tests/perf_pmu: Fix usage of for_each_engine_class_instanceTvrtko Ursulin
Wrong file descriptor was passed to the iterator. This had currently no effect, since it wasn't used in the macro, but needs to be fixed. At the same time make the macro consistent by checking for engine presence like the other iterators do. Added __for_each_engine_class_instance which does not check for engine presence and so is useful for enumerating all possible engines - like for instance for subtest enumeration. And another 'wrong fd used' fixlet in the render node subtests. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reported-by: Michel Thierry <michel.thierry@intel.com> Cc: Michel Thierry <michel.thierry@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michel Thierry <michel.thierry@intel.com>
2018-03-28lib/igt_kms: Improve connector probing in igt_display_init(), v2.Maarten Lankhorst
Only do a full probe when the initial connector status is unknown, and otherwise skip it. This should speed up kms tests ever so slightly. Also set pipe to PIPE_NONE for igt_output_refresh(), to make the connector info slightly more accurate. Changes since v1: - Instead of a force_reprobe tristate, only force reprobe from igt_display_init() when an unknown connection is found. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-03-26lib/dummyload: Add pollable spin batchTvrtko Ursulin
Pollable spin batch exports a spin->running pointer which can be checked by dereferencing it to see if the spinner is actually executing on the GPU. This is useful for tests which want to make sure they do not proceed with their next step whilst the spinner is potentially only being processed by the driver and not actually executing. Pollable spinner can be created with igt_spin_batch_new_poll or __igt_spin_batch_new_poll, after which igt_spin_busywait_until_running can be used to busy wait until it is executing. v2: * Move READ_ONCE to igt_core. * Add igt_spin_busywait_until_running. (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-22igt/gem_measure_ring_size_inflight: Measure smallest inflight ring sizeAntonio Argenziano
Some tests measure the render's ring size but are actually meant to measure the smallest across all engines. This patch adds measuring the smallest size in gem_measure_ring_size_inflight() given the appropriate parameter. v2: - Only expose high level API. (Chris) v3: - Use ALL_ENGINES macro. Suggested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-22lib: Run gem_test_engine() in an isolated contextChris Wilson
Ignore the shennigans of the test surrounding the library call to gem_test_engine() and focus on answering the query of whether the engine exists and is operational. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Tested-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-03-21lib/kms: Use named initializers for prop name arraysVille Syrjälä
Decouple the prop name arrays from the actual enum values by using named initializers. Should make it less likely that we end up with the wrong property on account of getting the order wrong. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel@ffwll.ch> #irc
2018-03-21lib/kms: Constify some string arraysVille Syrjälä
Make a bunch of string arrays const. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel@ffwll.ch> #irc
2018-03-21lib: Don't fail if plane IN_FORMATS not presentDaniel Stone
igt_display_init() now unconditionally tries to get the plane IN_FORMATS blob, which causes a hard assert failure if we don't have the property present. Check if it's there and return early if not. Signed-off-by: Daniel Stone <daniels@collabora.com> Fixes: 98f7614bd725 ("lib: Parse plane IN_FORMATS blobifiers into a nicer form") Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-20igt: Replace 'all-engines' magic numbers with macroAntonio Argenziano
In interfaces where a parameter allow to select an engine, we usually use '-1' or '~0u' to select all engines. This patch replaces magic numbers with a named constant. Suggested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-19lib/igt_kms: Add functions to get only a single output for a pipe, v2.Maarten Lankhorst
igt_get_single_output_for_pipe() will give a valid output for a pipe, for_each_pipe_with_single_output will iterate over all pipes, and will be called for each pipe with an output once. Changes since v1: - pipe = __outputs - __output returned a negative number for pipe, correctly set it to __output - __outputs. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-03-16lib: Parse plane IN_FORMATS blobifiers into a nicer formVille Syrjälä
Maintain straight up arrays of format+modifier tuples for each plane, and also collect up a similar device wide array. These will make it easy to confirm whether each plane (or the whole device) supports a specific format+modifier pair. v2: s/igt_hweight64/igt_hweight/ Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-16lib: Add igt_hweight()Ville Syrjälä
Add the binary hamming weight helper to igt_aux.h. v2: Add just the one macro that works for 64 and 32 bits (Chris) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-15lib/igt_kms: Fix enum type in igt_pipe_has_prop.Maarten Lankhorst
Found when compiling igt with clang: [284/819] Compiling C object 'tests/kms_crtc_background_color@exe/kms_crtc_background_color.c.o'. ../tests/kms_crtc_background_color.c:140:48: warning: implicit conversion from enumeration type 'enum igt_atomic_crtc_properties' to different enumeration type 'enum igt_atomic_connector_properties' [-Wenum-conversion] Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-03-12lib/igt_kms: Fix igt_plane_reset to handle cursor planes correctly tooMaarten Lankhorst
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-03-12intel_chipsets: store GT information in device infoLionel Landwerlin
Right now we define this only for big core skus and leave the gt field to 0 to mean unknown. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-12include: bump drm uAPI headersLionel Landwerlin
Taken from drm-tip : commit 1e6aa7e55c28ecd842b8b4599e4273c2429ee061 Author: Jani Nikula <jani.nikula@intel.com> Date: Tue Mar 6 12:41:55 2018 +0200 drm/i915/icl: do not save DDI A/E sharing bit for ICL Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Acked-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-03-07lib: Use C99 initialisers to clear context parametersChris Wilson
valgrind complains we feed uninitialised stack into the CONTEXT_SETPARAM ioctl. It is unused by the kernel, but valgrind doesn't know that and it's easy enough to clear the struct to prevent the warning. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-03-07Bump measure_ring_size() timer intervalChris Wilson
It appears that waiting for a 100us period whereby we are unable to submit another batch and proclaim the ring full, may have the false positive where the scheduler intervenes and we are signalled twice before having slept on ring space. Increasing the interval reduces the likelihood of the scheduler stealing the cpu from us, but does not eliminate it. Fortuitously it appears to be a rare false positive. For the library routine, we can fork a RT process but that seems a bit overkill! References: https://bugs.freedesktop.org/show_bug.cgi?id=105343 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-03-05lib/sysfs: s/kick_fbcon/bind_fbcon/Ville Syrjälä
Rename kick_fbcon() into bind_fbcon() so that it's not so confusing. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-05lib/sysfs: Fix fbcon unbind, againVille Syrjälä
Looks like unbinding the dummy con doesn't work on all machines. Instead we have to bind fbcon (which is what we used to do before commit d18fca7f6cf3 ("lib/sysfs: Fix fbcon rebind")). Since some machines need the bind and others need the unbind let's do both. The most obvious difference I observed between two machines that behave differently was the order in which the console drivers were listed in sysfs. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-03-05lib/igt_pm: Restore runtime pm state on test exitTvrtko Ursulin
Some tests (the ones which call igt_setup_runtime_pm and igt_pm_enable_audio_runtime_pm) change default system configuration and never restore it. The configured runtime suspend is aggressive and may influence behaviour of subsequent tests, so it is better to restore to previous values on test exit. This way system behaviour, with regards to a random sequence of executed tests, will be more consistent from one run to another. v2: Read failure means no runtime pm support so don't assert on it. v3: Install exit handler before the write to close the Ctrl^C race. (Imre) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> # v2 Acked-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-03-05tests/perf_pmu: Handle CPU hotplug failures betterChris Wilson
CPU hotplug, especially CPU0, can be flaky on commodity hardware. To improve test reliability and reponse times when testing larger runs we need to handle those cases better. Handle failures to off-line a CPU by immediately skipping the test, and failures to on-line a CPU by immediately rebooting the machine. This patch includes igt_sysrq_reboot implementation from Chris Wilson. v2: Halt by default, reboot if env variable IGT_REBOOT_ON_FATAL_ERROR is set. (Petri Latvala) v3: Add missign docs and update stale comment. (Petri Latvala) v4: Use pause instead of sleep. (Chris Wilson) v5: Newlines! (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-03-03lib: Fix MI_BATCH_BUFFER_START for hang injectionChris Wilson
A couple of bugs inside the hang injector, the worst being that the presumed_offset of the reloc didn't match the batch; so if the reloc was skipped (as the presumed_offset matched the reloc offset), the batch wasn't updated and so we may not have generated a hanging batch at all! Secondly, the MI_BATCH_BUFFER_START was not correct for all gen. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-03-01lib: Provide an accelerated routine for readback from WCChris Wilson
Reading from WC is awfully slow as each access is uncached and so performed synchronously, stalling for the memory load. x86 did introduce some new instructions in SSE 4.1 to provide a small internal buffer to accelerate reading back a cacheline at a time from uncached memory, for this purpose. v2: Don't be lazy and handle misalignment. v3: Switch out of sse41 before emitting the generic memcpy routine v4: Replace opencoded memcpy_from_wc v5: Always flush the internal buffer before use (Eric) v6: Assume bulk moves, so check for dst alignment. v7: Use _mm_fence for _buitlin_ia32_mfence for consistency, remove superfluous defines (Ville) Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Eric Anholt <eric@anholt.net> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-03-01lib/dummyload: Avoid assertions in lowlevel spin constructorChris Wilson
__igt_spin_batch_new() may be used inside a background helper which is competing against the GPU being reset. As such, we cannot even assert that the spin->handle is busy immediately after submission as it may have already been reset by another client writing to i915_wedged. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2018-02-28lib/igt_draw: Fix bo leak in gpu draw routinesMaarten Lankhorst
gem_handle_to_libdrm_bo creates a new handle through the use of flink, which makes kms_frontbuffer_tracking through a single run not complete when it starts leaking 50MB objects. Add the missing bo_unref to kill the duplicated handle and fix the leaks! Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-02-27meson: Get rid of lib_headersArkadiusz Hiler
Unused since commit 1f53e0dcec7a ("meson: Don't install headers"). Suggested-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2018-02-27igt: Make libudev mandatoryAntonio Argenziano
Since more essential components use libudev, make its dependency mandatory. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2018-02-27lib/igt_kms: Remove remaining docbook warnings mentioning igt_kms files.Maarten Lankhorst
Some warnings still exist, but they are about missing descriptions for structs enums and their members. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-02-27lib/igt_kms: Fix docbook warningsMaarten Lankhorst
This gets rid of the following warnings: lib/igt_kms.c:2688: warning: Symbol name not found at the start of the comment block. lib/igt_kms.c:2738: warning: Symbol name not found at the start of the comment block. lib/igt_kms.c:2788: warning: Symbol name not found at the start of the comment block. lib/igt_kms.c:2812: warning: Parameter description for igt_pipe_obj_replace_prop_blob::pipe is not used from source code comment block. lib/igt_kms.c:2812: warning: Parameter description for igt_pipe_obj_replace_prop_blob::pipe_obj is missing in source code comment block. lib/igt_kms.c:3794: warning: Parameter description for igt_cleanup_hotplug::mon is missing in source code comment block. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-02-27lib: Export kmsg()Chris Wilson
Export the kmsg() function for use by tests to write into the kernel message log, useful for tests to inline their progress with kernel error messages. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>