summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2018-05-23lib: Add clamp() to igt_aux and use it for ycbcr<->rgb conversionVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-23tests/kms_plane_scaling: Allow clip test to fail with YUVVille Syrjälä
YUV formats require the clipped src coordinates to be suitably aligned. We'd need to very carefully compute the unclipped dst coordinates to guarantee that. That's too much hassle so let's just accept failure in case YUV formats are used. v2: Actually remove the original igt_display_commit2() (Maarten) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> #irc
2018-05-21lib/gpgpu_fill: Create generic __gen9_gpgpu_fillfuncKatarzyna Dec
Starting from gen9 main gpgpu_fillfunc differs only with kernel parameter. Let's prepare generic __gen9 function to avoid duplicating all _fillfunc for future gens. v2: fixed indentations v3: Made __gen9_gpgpu_fillfunc static v4: 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> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
2018-05-21lib/media_fill: Create common media_fill library for all gensKatarzyna Dec
Let's create common media_fill library, similarly as for gpgpu_fill. This will allow to make code easier to read and maintain. Moreover we can create generic __gen9_media_fillfunc for future gens. >From gen9 media fillfunctions differ only with kernel parameter. v2: fixed indentations in files v3: Added missing copyright headers. Made __gen9_media_fillfunc static. Removed gen9 kernel (the same as for gen8). v4: rebase Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
2018-05-16igt: Drop Intel from the name in docs and pathsArkadiusz Hiler
This is just a simple change to reflect the actual state. No rewording yet, just a simple substitution in most visible places - docs, README and paths. There are probably some leftovers here and there, but we can let them be for now, this is already well overdue. v2: fixed couple of obvious leftovers pointed out by Petri Cc: Petri Latvala <petri.latvala@intel.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-05-15lib/igt_device: Add information why cannot drop drm masterKatarzyna Dec
Let's add additional information to igt_device_drop_master in case we try to run tests with e.g. x11 enabled. v2: Changed comment and added listing clients. v3: Changed igt_require to igt_assert. v4: Added checking if we are master already. References: https://bugs.freedesktop.org/show_bug.cgi?id=105990 Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-15lib: Rename library from gpu_fill to gpu_cmdsKatarzyna Dec
After refactoring media_spin library - gpu_fill contains helper functions for render copy, *_fill functions and media_spin. Let's rename this library to gpu_cmds. This name will be more general. v2: changed name from gpu_helpers to gpu_cmds Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-05-15lib/gpu_fill: Further code unification in gpu_fillKatarzyna Dec
We can unify gen7_emit_vfe_state and gen8_emit_vfe_state functions for gpgpu/media_fill and media_spin by adding parameters. gen8_emit_media_object was renamed to gen_* and extended with additional offset parameters - we can have one gen7_emit_media_objects for all tests. I have renamed gen8_emit_media_object to gen_emit_*, because function belongs to all gens and it would be odd to have all named genX_* and only one without this prefix. v2: Use #defines instead of variables as emit_vfe_state parameters. Fixed gen7_emit_media_objects. Unified vfe state parameters in media_spin library for gen8 and gen9 (gen9 had different values by mistake). v3: Fixed bug in emit_vfe_state for gen8 and gen9 in gpgpu_fill. Moved #defines for emit_vfe_state to particular libraries. v4: Fixed indentations in media_spin v5: Few more style changes. Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-By: Ewelina Musial <ewelina.musial@intel.com>
2018-05-15lib: Adjust media_spin and gpu_fill to our code styleKatarzyna Dec
Let's adjust code to our coding style during refactoring media_spin code. Few more changes in gpgpu_fill lib was made as well: intend align and /s/unsigned/unsigned int. v2: fixed minor typos v3: few more style changes v4: few indentation changes Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
2018-05-15lib/media_spin: Remove gen8lp_media_spin functionKatarzyna Dec
Gen8lp function are duplicates of Gen8 with difference in emit_media_objects - we cannot perform media_state_flush on CHT. Similar changes were done previously for gpgpu_fill and media_fill. v2: replaced IS_BRW and IS_CHT with IS_GEN8 v3: removed remaining 8lp spin function Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-05-15lib/media_spin: Move helper functions to gpu_fill libraryKatarzyna Dec
Let's remove duplications introduced by moving media_spin helper functions to gpu_fill. These were mainly the same functions as for Gen8 media/gpgpu fill. gen8_render_flush from media_spin was replaced by gen7_render_flush. The only functions that were left intact are gen8_spin_curbe_buffer_data, gen8_emit_vfe_state_spin, gen8_emit_media_objects_spin and gen8lp_emit_media_objects_spin. v2: squashed patches 1 and 2 from v1 v3: updated commit msg Signed-off-by: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
2018-05-14lib/audio: Replace sqrt(a*a + b*b) with hypot(a, b)Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-05-09lib/igt_dummyload: Fix possible NULL pointer dereferenceAntonio Argenziano
Make sure that at least one of the 'mmap' functions returns a valid pointer to avoid dereferencing a NULL pointer later on. (Issue found via coverity) v2: - Use the version of the mapping function that will assert on fail (Chris). Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-08lib/intel_batchbuffer: Minor cosmetic change in copyright headerAntonio Argenziano
Removed some trailing white spaces. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-05-07lib: create new dependency for aubdumpLionel Landwerlin
While trying to capture an aubdump on a libva demo, I run into a crash in intel_batchbuffer.c. Turn out every driver has it's own intel_batchbuffer.c with similar symbols and because aubdump pulls in libigt, things go wrong. One could argue that there is something wrong with intel-vaapi-driver's build but I also think aubdump should embed as little as possible. This change creates a very small library that embeds just the needed bits of igt for aubdump. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-05-07lib: drop drmtest dependency on intel_batchbufferLionel Landwerlin
It doesn't look like there should be a dependency there. v2: s/intel_batchbuffer/intel_reg/ v3: One more s/intel_batchbuffer/intel_reg/ in benchmarks Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-05-06lib: Show the kernel stack when reporting a GPU hangChris Wilson
In a few tests (like gem_exec_await, gem_exec_schedule) we use the GPU hang to break a deadlock hit during test setup. In these case we would like to see where in kernel the process is stuck (if at all). References: https://bugs.freedesktop.org/show_bug.cgi?id=105900 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-05-01lib/instdone.c: Add Gen11 SupportJavier Villavicencio
Bspec: 11431 Acked-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Javier Villavicencio <javier.villavicencio@intel.com>
2018-05-01lib: Add Icelake platform definitionArkadiusz Hiler
v2 (made by Paulo): PCI IDs are now part of a previous patch, so we can move the INTEL_ICL_11_IDs macro to this patch and avoid the compilation warining on unused intel_icelake_info. v3 (made by Paulo): fix the changelog (Antonio). Acked-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-05-01lib: sync with the newer i915_pciids.h from the Kernel (KBL + ICL)Paulo Zanoni
I just copied the Kernel file into the IGT repository. New IDs: - KBL GT2 sku from 672e314b21dc ("drm/i915/kbl: Add KBL GT2 sku") - ICL IDs from d55cb4fa2cf0 ("drm/i915/icl: Add the ICL PCI IDs") Cc: Matt Atwood <matthew.s.atwood@intel.com> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Jose Roberto de Souza <jose.souza@intel.com> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
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>