summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2017-06-09lib/igt_debugfs: Only use valid values in igt_crc_to_str()Brian Starkey
Not all elements in the crc array may be valid, so only use the valid ones to generate the string. Signed-off-by: Brian Starkey <brian.starkey@arm.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-06-09lib/igt_debugfs: Remove igt_debugfs_tBrian Starkey
It's not used anymore, so remove it. Signed-off-by: Brian Starkey <brian.starkey@arm.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-06-09lib/igt_kms: Fix erroneous assertBrian Starkey
In trying to fix igt_display_init() for devices without cursors, I actually made matters worse. Fix the assert. Fixes: 545aa3398223 lib/igt_kms: Remove redundant cursor code Signed-off-by: Brian Starkey <brian.starkey@arm.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-06-07ffs: Include strings.hArkadiusz Hiler
ffs() was used in couple of places without explicitly including strings.h. On a few libc implementation this is done implicitly through other headers, but let's do not rely on that behavior. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-06-07Android.mk: Use drm stubsArkadiusz Hiler
Use drm stubs that sit under lib/stubs. Also drop strange, nonexistent additions to LOCAL_C_INCLUDES. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-06-07Android.mk: Filter out *.h from src filesArkadiusz Hiler
Newer Android's build system complains about unused files if we leave those there. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-06-07Android.mk: Fix libkmod useArkadiusz Hiler
On Android libkmod.h is nested under libkmod directory, so we should include appropriately. Also we need to link with it. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-06-07chamelium: Fix build issues on AndroidArkadiusz Hiler
Makefile.sources are included 1:1 in Android.mk files, and are not parsed by automake. And yet those had some automake conditional logic. Moving it to .am file is enough for now. Also igt_chamelium.h included config.h without proper "HAVE_CONFIG_H" guard, and the file itself was included unconditionally. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
2017-06-07lib/igt_aux: Make procps optionalArkadiusz Hiler
Android does not have procps and it's not easy to compile it as a dependency. We can provide alternative, "naive" implementation that just shells out to external commands (i.e. pkill and lsof) in case we do not have the library. v2: have separate functions for naive impls (J. Nikula) Cc: Jani Nikula <jani.nikula@linux.intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-06-07lib/igt_aux: Include unistd.h for gettid() on AndroidArkadiusz Hiler
We define gettid() using syscall() because glibc does not provide a wrapper. Android's bionic got the syscall covered though. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-06-07Make conditions on HAVE_UDEV consistentArkadiusz Hiler
We have a lot of `#ifdef HAVE_UDEV` and ` #if HAVE_UDEV` all over the place, but ifdef and if have a slightly different semantics. Let make it consistent by using #ifdefs only. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-05-31lib: Moving gem_execbuf_wr to ioctl_wrappersLukasz Fiedorowicz
gem_execbuf_wr was duplicated in multiple places. Moving everything to lib/ Signed-off-by: Lukasz Fiedorowicz <lukasz.fiedorowicz@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2017-05-18lib: Refactor testing for ability to use MI_STORE_DATA_IMMChris Wilson
Rather than have the code in multiple locations, put a copy in lib/ Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-05-17igt/gem_spin_batch: Avoid interleave throttle within open spin batchesChris Wilson
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101079 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-05-10Revert "Revert "lib/igt_kms: Force outputs to use full range RGB""Petri Latvala
Somehow an incorrect commit was reverted. This reverts commit cda2b91da9c5209d9b3eaac2d2c6f4778a58d4a0. Signed-off-by: Petri Latvala <petri.latvala@intel.com>
2017-05-10Revert "lib/igt_kms: Force outputs to use full range RGB"Chris Wilson
This reverts commit 15ffbf378c3d9b3a75ac6b6ec6d96f917e9a7637. Some how you need to put headers in the sources, but I've forgotten how to do in the mess of automake/Android.
2017-05-10lib/igt_kms: Force outputs to use full range RGBAnder Conselvan de Oliveira
In at least SKL and GLK (possibly other devices too), using a cursor plane to scan out an fb might result in a different pipe crc than when using a regular plane at the same position with the same fb while using the CSC logic to limit the color range. The differences could be caused by the cursor plane being limited to 8 bpc while the regular planes support higher bit depths, leading to slightly different values to be used internally. This is evidenced by the failures happening with specific color values, 0.5 for example, but that's mostly speculation. To avoid misterious failures caused by limited range rgb, force all tests to use full range. It is still possible for tests to override this if necessary. v2: Add more details to the commit message. v3: Force all tests to use full range. Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-05-09wsim: Per-client prng pool for miscellaneous randomsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-04-25benchmarks/gem_wsim: Command submission workload simulatorTvrtko Ursulin
Tool which emits batch buffers to engines with configurable sequences, durations, contexts, dependencies and userspace waits. Unfinished but shows promise so sending out for early feedback. v2: * Load workload descriptors from files. (also -w) * Help text. * Calibration control if needed. (-t) * NORELOC | LUT to eb flags. * Added sample workload to wsim/workload1. v3: * Multiple parallel different workloads (-w -w ...). * Multi-context workloads. * Variable (random) batch length. * Load balancing (round robin and queue depth estimation). * Workloads delays and explicit sync steps. * Workload frequency (period) control. v4: * Fixed queue-depth estimation by creating separate batches per engine when qd load balancing is on. * Dropped separate -s cmd line option. It can turn itself on automatically when needed. * Keep a single status page and lie about the write hazard as suggested by Chris. * Use batch_start_offset for controlling the batch duration. (Chris) * Set status page object cache level. (Chris) * Moved workload description to a README. * Tidied example workloads. * Some other cleanups and refactorings. v5: * Master and background workloads (-W / -w). * Single batch per step is enough even when balancing. (Chris) * Use hars_petruska_f54_1_random IGT functions and see to zero at start. (Chris) * Use WC cache domain when WC mapping. (Chris) * Keep seqnos 64-bytes apart in the status page. (Chris) * Add workload throttling and queue-depth throttling commands. (Chris) v6: * Added two more workloads. * Merged RT balancer from Chris. v7: * Merged NO_RELOC patch from Chris. * Added missing RT balancer to help text. TODO list: * Fence support. * Batch buffer caching (re-use pool). * Better error handling. * Less 1980's workload parsing. * More workloads. * Threads? * ... ? Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: "Rogozhkin, Dmitry V" <dmitry.v.rogozhkin@intel.com>
2017-04-22lib: spinning batches requires working GEM, so add the precheckChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-04-22igt: Import basic amdgpu tests from libdrmChris Wilson
Simple copy and replace of the CUnit tests inside libdrm to form a basis for further prime integration testing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-04-20lib/tests: Add kmstest_edid_add_* selftestsAbdiel Janulgue
Sanity check the edid block generation capabilities. Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2017-04-20lib/igt_kms: Add support for 4K and audio HDMI EDID injection.Abdiel Janulgue
Based on the initial work by Marius Vlad. v3: Bring back audio injection v4: Make a helper for 3d/4k/audio HDMI injection (Petri) Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2017-04-13igt/gem_exec_reloc: Check interactions with WC domainChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-04-11lib: Fix up internal engine names (again)Chris Wilson
Another day, another format. Now we include the 0-based instance number for all engines, and not just vcs1/2. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-04-07lib/pipe_crc: Cache debugfs directoryChris Wilson
Keep the debugfs dir found during pipe_crc init around for the entire duration of the test. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-04-07lib/debugfs: Close dir before returning open debugs fileAnder Conselvan de Oliveira
The function igt_debugfs_open() would not close the debugfs dir before returning. Tests that do a lot of pipe CRC comparaions, such as kms_cursor_crc, would eventually fail. (kms_cursor_crc:3853) igt-debugfs-CRITICAL: Test assertion failure function igt_pipe_crc_do_start, file igt_debugfs.c:387: (kms_cursor_crc:3853) igt-debugfs-CRITICAL: Failed assertion: err == 0 (kms_cursor_crc:3853) igt-debugfs-CRITICAL: Last errno: 24, Too many open files (kms_cursor_crc:3853) igt-debugfs-CRITICAL: error: -24 != 0 83884e97e187 ("Restore "lib: Open debugfs files for the given DRM device"") Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-31lib/igt_kmod: Don't call igt_assert or igt_require without a fixturePetri Latvala
If kmod_module_new_from_name fails, igt_kselftest ends up calling igt_skip (through igt_require) when not in a fixture. Instead return normally from igt_kselftest, matching behaviour when the module loading is successful but it doesn't contain selftests. Also change one igt_assert to a return for the same reason. Signed-off-by: Petri Latvala <petri.latvala@intel.com> CC: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-30lib: Update kernel engine namesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-27lib/sysfs: Fix using O_WRONLY in igt_sysfs_read()!Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-27lib/dummyload: Handle timeout in a new thread instead of signal handlerAnder Conselvan de Oliveira
Currently, the main thread needs to wakeup to run the signal handler that ends a spin batch. When testing whether a function call succesfully waits for a batch to complete, this behavior is undesired. It actually invalidates the test. Fix this by spawning a new thread to handle the timeout. v2: Get rid of mutexes. (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-25Replace more system("modprobe")Chris Wilson
As we have libkmod available, it is faster and safer than calling system(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-25lib/sysfs: stop before calling write with zero bytesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-24lib/debugfs: Phase out igt_debugfs_fopen()Chris Wilson
Wrapping fdopen() proved dangerous, the underlying fd is not refcounted, and we must close it in the library or else we easily leak and exhaust all fd. Since we can't provide igt_debugfs_fopen(), move the burden onto the caller for those that require a stream FILE*. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-24Improve utilisation of igt_debugfs_dir()Chris Wilson
As we can export igt_debugfs_dir() to cache the path to our debugfs directory, encourage a few more users to take advantage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>