summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2016-12-13lib/kselftest: Parse embedded test number from parameterChris Wilson
Order the tests by an embedded test number from the parameter string. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-13lib: Allow permutation of the first two elements in the arayChris Wilson
Spotted-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-08igt_kms: Remove support for drivers with <1 drm_planeLyude
We've had support for universal planes since kernel version 3.15, so there's not really a good reason to try supporting drivers that lack plane support now. As well, the current has_universal_planes logic is broken anyway as it makes the assumption that having display planes always means we have both a primary plane and a cursor plane (this isn't true on radeon/amdgpu and nouveau). So, remove this, and just check for whether or not we have a cursor plane. Signed-off-by: Lyude <lyude@redhat.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-12-07Revert "lib/kselftests: Eliminate ENOTTY hack"Chris Wilson
This reverts commit 721866d83907c8ade5d20121418261d715b145ed. Still required for late tests as ->probe() is not allowed to return 1, but must return a negative error code.
2016-12-07lib/kselftests: Eliminate ENOTTY hackChris Wilson
Returning a positive value from module loading does not get interpretted as an error, so we can forgo passing a proxy value of -ENOTTY. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-07lib: Use igt_assert_eq in CHECK_RETURNTomeu Vizoso
So that debug logs contain the unexpected value. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2016-12-07igt/drv_selftest: Adapt to mock/late splitChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-07igt_kms: Don't require intel hardware for kmstest_force_connectorLyude
Due to the unconditional call to intel_get_drm_devid() in kmstest_force_connector(), trying to use this function on anything that isn't intel hardware results in the current fixture being skipped. So, don't try to get the devid in kmstest_force_connector() unless we're on an Intel chipset. Signed-off-by: Lyude <lyude@redhat.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-12-02lib/igt_kmod: Update the prefix match string lengthChris Wilson
Not only do you need to change the prefix string, but you also need to update its length. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-02lib/igt_kmod: s/subtest__/igt__/ for kernel parametersChris Wilson
Use igt__ to detect kernel parameters indicating subtests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-02lib/igt_kmod: Squelch the igt assert for a module with no subtestsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-01igt: Add kselftest runner for i915Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-01lib/igt_kmod: Adopt igt_kselftests()Chris Wilson
Extract the automagic kselftest runner from tests/drm_mm.c to the new lib/igt_kmod.c Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-01lib/igt_gvt: Make use of libkmod helpers and fix reading gvt parameter.Marius Vlad
v2: - use igt_sysfs_get_boolean() to get gvt status (Chris Wilson) - do not hard-fail when i915 module could not be loaded/unloaded (Chris Wilson) Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-12-01lib/igt_kmod: New library to support driver loading/unloading and additional ↵Marius Vlad
helpers. lib/igt_aux: Added igt_pkill and igt_lsof helper. lib/igt_kmod: Added load/unload kmod helpers. v7: - document the case where leaving stray fd from drm_open_driver() might fail reloading the driver. - list also current opened files from /dev/dri in case we could not unload the driver. - convert igt_info to igt_warn (Chris Wilson) - added KMOD_|PROCPS CFLAGS (Chris Wilson) v6: - include latest modifications from tests/drv_module_reload: display all loaded modules and list information about opened files by processes (Petri Latvala) v5: - added igt_i915_driver_{load/unload}. - added kick_snd_hda_intel() to match current tests/drv_module_reload_basic and integrated into igt_i915_driver_load/unload. - added gtk-doc section for lib/igt_kmod v4: - decided to split libkmod helpers into their own file as there's another user lib/igt_gvt or tests/gvt_basic. - fixed some gtk-doc documentation. v3: - return -errno (igt_pkill()) in case of failure (Cris Wilson) - return bool for igt_kmod_is_loaded(), replaced strncasecmp with strncmp (Chris Wilson) v2: - Renamed libkmod helpers (Chris Wilson) - Removed SIGTERM/SIGKILL case where we repeatedly tried to terminate the process: just call kill(2) once (Chris Wilson) - Removed redundant check in igt_kmod_unload(), igt_module_in_use() (Chris Wilson) - Pass flags to igt_kmod_unload() from the caller (Chris Wilson) - Removed useless function igt_kill() which acts just as kill(2) (Chris Wilson) Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-12-01lib/igt_dummyload: Don't clear a signal if we haven't installed the timeoutChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-01lib/dummyload: Don't clear the same signal twiceChris Wilson
Now that the signal is disable on spin_batch_end, we don't need to do the same from the signal handler if we have a match. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-01Revert "igt_dummyload: Don't clear handler for invalid signal"Chris Wilson
This reverts commit 32d38ea2f6c3e07d38bc65f8cf2df1e0c0fe1c6b.
2016-12-01lib/dummyload: Clear the right signal afterwardsChris Wilson
If the signal handler fires after we delete the busybatch, it would walk the list and find no match. Then attempt to use the list_head as its info->signo. Use the passed in sig instead. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-01igt_dummyload: Don't clear handler for invalid signalAbdiel Janulgue
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2016-12-01igt_dummyload: clear signal handler on the desructor as wellAbdiel Janulgue
Fixes an issue when calling igt_spin_batch_set_timeout and then tearing down the spinner right away before it has the chance to timeout, causes the associated signal handler to linger. Make sure to remove the handler on the destructor. Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-01Silence a bunch of "const discard" warningsChris Wilson
A few warnings of the form: gem_mmap_gtt.c: In function ‘copy_wc_page’: gem_mmap_gtt.c:480:16: warning: initialization discards ‘const’ qualifier from pointer target type [enabled by default] __m128i *S = (const __m128i *)src; are no more. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-01lib/igt_aux.h: Cast is confusing old gccRodrigo Vivi
I noticed in some machines igt compilation was breaking after igt_dummyload was introduced. I don't know exactly why, but it seems this cast seems to let old gcc a bit confused. Without the cast everything works properly. Compilation Error log: CC igt_dummyload.lo In file included from igt.h:30:0, from igt_dummyload.c:25: igt_aux.h:288:39: error: initializer element is not constant #define __IGT_INIT_LIST(name) (struct igt_list){ &(name), &(name) } ^ igt_aux.h:289:47: note: in expansion of macro ‘__IGT_INIT_LIST’ #define IGT_LIST(name) struct igt_list name = __IGT_INIT_LIST(name); ^ igt_dummyload.c:50:8: note: in expansion of macro ‘IGT_LIST’ static IGT_LIST(spin_list); ^ make[4]: *** [igt_dummyload.lo] Error 1 Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2016-11-29lib: add igt_dummyloadAbdiel Janulgue
A lot of igt testcases need some GPU workload to make sure a race window is big enough. Unfortunately having a fixed amount of workload leads to spurious test failures or overly long runtimes on some fast/slow platforms. This library contains functionality to submit GPU workloads that should consume exactly a specific amount of time. Since v14: Since we are using multiple signals, walk list of batches to terminate a batch to avoid using a single global batch. Cycle signals between SIGRTMIN and SIGRTMAX properly. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: tomeu@tomeuvizoso.net Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2016-11-29igt_aux: Add some list helpers from waylandLyude
Since we're going to be using lists for keeping track of EDIDs we've allocated on the chamelium, add some generic list helpers from the wayland project. Signed-off-by: Lyude <lyude@redhat.com> Changes since v1: - Rename list helpers to be more like those from the Linux kernel v2: Make the api compatible with the kernel as well.
2016-11-29lib: Make signal helper definitions reusableAbdiel Janulgue
Lots of test cases are re-declaring this. v2: Remove definition in benchmarks/gem_syslatency.c Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2016-11-27igt: Add kselftest runner for drm_mmChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-15lib: Add missing include for sync()Petri Latvala
Commit 721d8747e3a2 added sync() calls to igt_main and igt_simple_main, making self-tests fail to build. #including unistd.h in igt_core.h fixes that. Fixes: 721d8747e3a2 ("igt: Add a test for reordering execbufs") CC: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-11lib: substitute cxt BAN_PERIOD with BANNABLEMika Kuoppala
Context BAN_PERIOD will get depracated so subsitute it with BANNABLE property. Make ctx param test to accept both variants for now until kernel changes have landed, to not break BAT. v2: check against - EINVAL on get/set ban as it can return -EPERM v3: better naming for get/set (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2016-11-11lib: Pass I915_TILING_NONE if Yf or YsTomeu Vizoso
The kernel expects that BOs for framebuffers with I915_FORMAT_MOD_Yf_TILED will have I915_TILING_NONE. Fixes: 050c00d53f39 ("lib: Pass I915_TILING_Y to the kernel if Yf or Ys") Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-11-10lib: Pass I915_TILING_Y to the kernel if Yf or YsTomeu Vizoso
GEM_SET_TILING doesn't care about Yf or Ys, so just pass Y. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-11-10lib: Pass tiling constant where that's expectedTomeu Vizoso
We were passing in two places a framebuffer modifier constant instead of a tiling constant. Also adds igt_fb_mod_to_tiling so tests can do that by themselves. Cc: Tvrtko Ursulin <tursulin@ursulin.net> Fixes: 8a1a38661f56 ("lib: Add igt_create_bo_with_dimensions") Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-11-09lib: use the local intel_aub.h fileEmil Velikov
File is provided by the libdrm_intel package which is optional. Since we already have a local copy of the file, we might as well use it ;-) v2: Move the file alongside intel_bufmgr.h and use it in the disable-intel case. Cc: Brian Starkey <brian.starkey@arm.com> Reported-by: Brian Starkey <brian.starkey@arm.com> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Tested-by: Brian Starkey <brian.starkey@arm.com>
2016-11-09Revert "lib: use the local intel_aub.h file"Tomeu Vizoso
Emil prefers if the approach in v2 is used (it was sent around the time v1 had been applied). This reverts commit 438c8d7c688780337d271016d84a69aab0474097.
2016-11-07igt: Add a test for reordering execbufsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-27lib/drmtest: Test for equivalence with DRIVER_ANYTomeu Vizoso
Cc: Chris Wilson <chris@chris-wilson.co.uk> Fixes: 9921aff583ac ("lib/drmtest: Take DRIVER_ANY into account when opening the DRM device") Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-10-27lib: use the local intel_aub.h fileEmil Velikov
File is provided by the libdrm_intel package which is optional. Since we already have a local copy of the file, we might as well use it ;-) Cc: Brian Starkey <brian.starkey@arm.com> Reported-by: Brian Starkey <brian.starkey@arm.com> Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-10-27lib/drmtest: Take DRIVER_ANY into account when opening the DRM deviceTomeu Vizoso
__drm_open_driver was changed to bail out on VGEM devices unless they are explicitly asked for (DRIVER_VGEM). But with that change we lost support for DRIVER_ANY. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Fixes: 7ce63894854d ("lib: Support opening vGEM device") Cc: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-19igt: Check the physical swizzle statusChris Wilson
The kernel tries to hide L-shaped memory with asymmetric swizzling from userspace by reporting lies through the get-tiling interface. Check for these lies by comparing the reported swizzle with the actual swizzle, and only run swizzling tests where we know the underlying physical swizzling. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-18drmtest: Install exithandler for i915, even in multidriver testsChris Wilson
If we opened the driver multiple times, we would not flush i915 if it was opened second. The persistence of one test state into a second can upset third parties, e.g. prime_vgem upsetting vgem_basic (due to references from i915.ko to vgem.ko preventing module unload). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2016-10-18lib/igt_aux: Improve documentation for igt_system_suspend_autoresume()Imre Deak
While at it fix the order of states for consistency. Suggested by Daniel. Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-10-14lib/sysfs: Use a fallback for builtin modulesChris Wilson
A builtin modules does not have a sysfs/device/module symlink, so be creative. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-14tests: prefix IGT kernel log messages with [IGT]Jani Nikula
Make the IGT logging stand out better and easier to grep. Signed-off-by: Jani Nikula <jani.nikula@intel.com>
2016-10-13igt/gem_ctx_param: Update invalid parma numberChris Wilson
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97108 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-13igt/gem_ctx_param: Tidy error messagesChris Wilson
Avoid macro expansion inside the asserts so that the error messages are readable. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-13lib/igt_aux: Add support for various system suspend/resume optionsImre Deak
To have a more accurate idea about any suspend/resume issues we can perform the s/r until various phases in the s/r sequence. This way we can isolate the given problem as being a device driver, kernel core or BIOS related issue. Actual subtests using these new s/r phases will be added as follow-up. While at it also add the freeze suspend target, it's something we also would need to test. Signed-off-by: Imre Deak <imre.deak@intel.com>
2016-10-13lib/igt_gt: Use /sys/.../error instead of /debug/.../i915_error_stateChris Wilson
The stable path is via sys, but we only have to use this should the kernel be ignoring our request to ignore simulated hangs. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-13igt/gem_wait: Use explicit timersChris Wilson
Rather than guestimating a workload that should take a certain amount of time, use a sigitimer to terminate a batch (and so complete the wait) after an exact amount of time. And in the process expand testing to cover multiple rings and hangcheck. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-11lib/chipset: Properly skip on non-IntelDaniel Vetter
Random drive-by I noticed while hacking on piglit. Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-10-05igt_kms: Refresh output when setting pipe.Maarten Lankhorst
We still allow duplicates at this point, but when commit is called only one output per display is allowed. This fixes tests like kms_psr_sink_crc, which expect a valid pipe. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>