summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2017-03-23lib: system() is bad, use libkmod insteadChris Wilson
For an as of yet unknown reason, calling system("modprobe") from inside igt/gem_wait causes kasan to spend 1-5 minutes copying the process pagetables. This evaporates if we replace the fork-happy call to system with a call to load the module using libkmod. So be it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-23lib: Clear unrelated errno for intel_detect_and_clear_missed_interruptsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-21Restore "lib: Open debugfs files for the given DRM device"Chris Wilson
This reverts commit 25fbae15262cf570e207e62f50e7c5233e06bc67, restoring commit 301ad44cdf1b868b1ab89096721da91fa8541fdc Author: Tomeu Vizoso <tomeu.vizoso@collabora.com> Date: Thu Mar 2 10:37:11 2017 +0100 lib: Open debugfs files for the given DRM device with fixes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-21Revert "lib: Open debugfs files for the given DRM device"Tomeu Vizoso
This reverts commit 301ad44cdf1b868b1ab89096721da91fa8541fdc. When a render-only device is opened and gem_quiescent_gpu is called, we need to use the debugfs dir for the master device instead. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2017-03-21lib/debugfs: Only inspect errno after a confirmed errorChris Wilson
The contents of errno are strictly only valid after a syscall (or library function) reported an error. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-21lib: Open debugfs files for the given DRM deviceTomeu Vizoso
When opening a DRM debugfs file, locate the right path based on the given DRM device FD. This is needed so, in setups with more than one DRM device, any operations on debugfs files affect the expected DRM device. v2: - rebased and fixed new API additions v3: - updated chamelium test, which was missed previously - use the minor of the device for the debugfs path, not the major - have a proper exit handler for calling igt_hpd_storm_reset with the right device fd. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Robert Foss <robert.foss@collabora.com> Acked-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-20lib/igt_kms: Do not refresh all outputs in igt_display_commitMaarten Lankhorst
Now that igt_output_set_pipe handles refreshing igt_output, we only have to be sure that there are no conflicting outputs in igt_display_commit. Reported-and-tested-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-03-16lib: Remove requirements spam from gem_set_tiling()Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-14lib: Squelch a pair of ignore result warningsChris Wilson
igt_debugfs.c: In function 'igt_drop_caches_has': igt_debugfs.c:890:9: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(file, "0x%" PRIx64, &mask); ^ CC igt_aux.lo CC igt_gt.lo igt_gt.c: In function 'igt_force_gpu_reset': igt_gt.c:382:8: warning: ignoring return value of 'fscanf', declared with attribute warn_unused_result [-Wunused-result] fscanf(file, "%d", &wedged); Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-13lib: Update i915_pciids.hChris Wilson
Sync to commit 77a9e13b5a3c9c0cbd9e672e55970e7358a1a482 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Mar 13 11:26:09 2017 +0000 drm/i915: Add i810/i815 pci-ids for completeness Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-13igt/kms_pipe_crc_basic: Tighten timings for CRC readbackChris Wilson
The number of vblanks that pass whilst we read back the CRCs is depended upon CPU scheduling -- we may take longer than expected and end up reading more CRCs. Align the start of the loop to a vblank. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100132 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-13Revert "lib: Add i915 and drm-mm selftest headers from the kernel"Chris Wilson
This reverts commit 5ca0da9f53023b9fcfd327a5f43bc7b0916b24b1.
2017-03-13Revert "Always expose IGT subtests for known kernel selftests"Chris Wilson
This reverts commit 7ab5c97924bf971a348ff4a1768da624ba2f564c.
2017-03-13Always expose IGT subtests for known kernel selftestsPetri Latvala
Even when the running kernel does not support selftests, make subtest enumeration list known kselftests. The list is generated using selftest listing headers copied from the kernel. If the running kernel gains new selftest subtests, they are listed even without copying the headers over and rebuilding IGT. v2: Use correct names for the testcases Signed-off-by: Petri Latvala <petri.latvala@intel.com>
2017-03-13lib: Add i915 and drm-mm selftest headers from the kernelPetri Latvala
Copied as of commit commit 496b575e3ccbf6fbe57a674c721af43dc8826361 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Mon Feb 13 17:15:58 2017 +0000 drm/i915: Add initial selftests for hang detection and resets The headers are used to enumerate available tests when the running kernel does not support selftests. v2: Also add them to Makefile.sources Signed-off-by: Petri Latvala <petri.latvala@intel.com>
2017-03-10lib: Shrink all i915 caches before measuring avail memoryChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-10igt: Exercise the shrinkerChris Wilson
Introduce a new fork helper that spawns a process that just repeatedly calls i915_gem_shrink_all() and watch what happens as we try to use objects that have been shrunk. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-09lib: Fix hang detectorChris Wilson
The kill/signal became mismatched in commit d930b6493d93 ("lib: Add basic support for valgrind annotations.") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-08tests/gem_userptr_blits: subtests for MAP_FIXED mappings of regular BOMichał Winiarski
When the memory backing the userptr object is released by the user, but the BO itself is not closed, it's possible to trigger recursive deadlock caused by operations done on different BO mapped in that region. Testcases are simulating such behaviour by using MAP_FIXED mmap flag. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2017-03-08igt/gem_madvise: Correct expected resultsChris Wilson
Trying to execbuf with a purged object is meant to fail. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-08igt/gem_eio: Check we succeed in unwedging the driverChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-07lib/igt_gt: Remove duplicated PARAM_NO_ERROR_CAPTURE defineMichel Thierry
LOCAL_CONTEXT_PARAM_NO_ERROR_CAPTURE exists in lib/ioctl_wrappers.h since commit 171b21d9f761 ("igt/gem_ctx_param: Update invalid parma number"). Signed-off-by: Michel Thierry <michel.thierry@intel.com> Reviewed-by: Robert Foss <robert.foss@collabora.com>
2017-03-07lib: Break poll loop to check for a missed signalChris Wilson
If our parent dies, so should we. Our parent should kill us before it exits, but just in case we escape, wake up periodically to check upon our parent. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-07lib: Check for dead parent first in hang detectorChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-28lib/igt_debugfs: Add functions/tests for controlling/testing HPD storm logicLyude
Recently we added i915_hpd_storm_ctl into i915's debugfs directory, which allows us to control the thresholds i915 uses for detecting hotplug interrupt storms from userspace, along with the ability to entirely disable them. This adds some helper functions into IGT to enable making use of this feature, along with adding some chamelium tests for it. Signed-off-by: Lyude <lyude@redhat.com>
2017-02-27lib: Add basic support for valgrind annotations.Maarten Lankhorst
SIGRTMAX appears to be used by valgrind now for its internal tracking, so avoid it in the helpers. Also add some valgrind annotations in gem_mmap, to make sure that its accesses are tracked correctly. I've also added gem_munmap, but there are a lot of places that don't use it yet in tests/. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-02-23lib/sysfs: Explicit read/write lengthChris Wilson
Export a couple of routines to read/write an exact length, rather than a strring. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-22igt: Start marking up GEM tests that require an alive GPU to functionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-21lib/igt_kms: Remove redundant cursor codeBrian Starkey
The dynamic plane support means that there should never be gaps in the pipe->planes array. This means we should never need to move the cursor plane from the last slot to another. Remove the unnecessary code, and add an assert that makes sure nothing strange happened that broke the assignment logic. Signed-off-by: Brian Starkey <brian.starkey@arm.com> Reviewed-by: Robert Foss <robert.foss@collabora.com>
2017-02-21lib/igt_kms: Fix memory corruption when there's no cursor planeBrian Starkey
The dynamic plane support means that if there's no cursor plane, then there is no space in the pipe->planes array for it, and thus assigning a "drm_plane-less" plane is out-of-bounds and leads to heap corruption and later crashes. The "drm_plane-less" cursor plane isn't included in n_planes anyway, which means there's no way to ever access it/know that it's there - so just remove it entirely. Fixes: 36656239ef96 lib/igt_kms: Implement dynamic plane count support Signed-off-by: Brian Starkey <brian.starkey@arm.com> Reviewed-by: Robert Foss <robert.foss@collabora.com>
2017-02-21lib/igt_kms: Fix possible out-of-bounds accessBrian Starkey
If there's no primary plane, pipe->plane_primary == -1, and the assert meant to check that it's valid will access pipe->planes[-1]. Fix that to check that pipe->plane_primary has been set instead. Fixes: 36656239ef96 lib/igt_kms: Implement dynamic plane count support Signed-off-by: Brian Starkey <brian.starkey@arm.com> Reviewed-by: Robert Foss <robert.foss@collabora.com>
2017-02-21lib/igt_kms: Neaten up pipe->planes[] assignmentBrian Starkey
Remove a bunch of branches, functionally equivalent. Changes since v1: - Added back display->has_cursor_plane assignment Signed-off-by: Brian Starkey <brian.starkey@arm.com> Reviewed-by: Robert Foss <robert.foss@collabora.com>
2017-02-21lib/igt_kms: Fix drm_plane leakBrian Starkey
In the loop looking for planes on a pipe, we always want to free up the drm_plane afterwards. Fixes: 36656239ef96 lib/igt_kms: Implement dynamic plane count support Signed-off-by: Brian Starkey <brian.starkey@arm.com> Reviewed-by: Robert Foss <robert.foss@collabora.com>
2017-02-17lib/igt_kms: Fix regression on kms_plane_lowres testMika Kahola
kms_plane_lowres subtest pipe-C-tiling-none crashes when reading out number of crtc. This patch fixes the bug on crtc readout. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99653 Fixes: 9de635976c426b4c835083792c7d4d6e32aec615 ("lib/igt_kms: Avoid depencency on static plane count") Reviewed-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: Mika Kahola <mika.kahola@intel.com>
2017-02-08igt_kms: Handle failure in drmModeGetConnector gracefully.Maarten Lankhorst
This can happen when a DP-MST disappears, handle the error by printing a warning instead of crashing. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-02-08lib/kselftests: Split up igt_kselftests()Chris Wilson
To make it easier to reuse, split up the the single function up into stages. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-07igt/core: Return condition result from igt_warn_on*()Lyude
This allows us to be a little more flexible with how we use igt_warn_on() and igt_warn_on_f() by allowing us to write statements like this: if (igt_warn_on(scary_condition)) { /* some error handling... */ } Signed-off-by: Lyude <lyude@redhat.com>
2017-02-04lib/gt: Set context for contolling bannableChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-04tests/gem_exec_params: add test for exec_fence paramsDaniele Ceraolo Spurio
Added a subtest for invalid FENCE_IN usage, updated invalid-flag subtest and made the rsvd2 test skip when exec fences are available. Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-03lib/igt_kmod: Compare module names with strcmpAnder Conselvan de Oliveira
The function igt_kmod_is_loaded() returns the wrong value when there is a module loaded whose name is a prefix of the name supplied as a parameter. For instance, if the "snd" module is loaded, igt_kmod_is_loaded("snd_hda_intel") will return true even if that module isn't loaded, thus causing drv_module_reload to fail in that scenario. Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-02-02tests/kms_atomic_transition: add in_fences testsGustavo Padovan
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-02-02tests/kms_atomic_transition: add out_fences testsRobert Foss
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-02-02lib/igt_kms: Add support for the OUT_FENCE_PTR propertyGustavo Padovan
Add support for the OUT_FENCE_PTR property to enable setting out fences for atomic commits. Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-02-02lib/igt_kms: Add support for the IN_FENCE_FD propertyRobert Foss
Add support for the IN_FENCE_FD property to enable setting in fences for atomic commits. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-02-02lib/igt_kms: export properties namesGustavo Padovan
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-02-02lib/igt_kms: move igt_kms_get_alt_edid() to the right placeGustavo Padovan
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Brian Starkey <brian.starkey@arm.com>
2017-01-31lib/igt_kms: Remove code obsoleted by dyn n_planes implementationRobert Foss
Due to the dyn n_planes implementation some attributes and functions were made obsolete and cand be removed. However to keep all of the tests building the obsolete code is removed after all of the tests have been made compatible with the dyn n_planes changes. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-01-31lib/igt_kms: Implement dynamic plane count supportRobert Foss
In upcoming drm-misc-next changes, the number of planes per pipe has been increased as more than one primary plane can be associated with a pipe. The simple fix for this would be to simply bump hardcoded value for number of frames per pipe. But a better solution would be to add support for dynamic number of planes per pipe to i-g-t. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-01-31lib/igt_kms: Rename kmstest properties nplanes and planeRobert Foss
Rename these properties to have them use the same naming convention as the igt_*_t structs. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-01-31lib/igt_kms: Avoid depencency on static plane countRobert Foss
Rework kmstest_crtc and kmstest_plane structs and their usage to not depend on a static plane count. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>