summaryrefslogtreecommitdiff
path: root/lib/igt_aux.h
AgeCommit message (Collapse)Author
2019-05-07meson: Don't redefine gettid if the C library provides itLyude Paul
glibc 2.30+ will actually include a definition for gettid() that makes it so that users don't have to manually define a wrapper for it themselves with syscall(). We don't currently check for this, and as a result will end up redefining gettid() on the latest versions of glibc, causing the build to fail: FAILED: lib/76b5a35@@igt-igt_kmod_c@sta/igt_kmod.c.o In file included from /usr/include/unistd.h:1170, from ../../mnt/vol/lib/igt_core.h:43, from ../../mnt/vol/lib/igt_kmod.c:28: /usr/include/bits/unistd_ext.h:34:28: error: macro "gettid" passed 1 arguments, but takes just 0 34 | extern __pid_t gettid (void) __THROW; | ^ In file included from ../../mnt/vol/lib/igt_kmod.c:27: ../../mnt/vol/lib/igt_aux.h:40: note: macro "gettid" defined here 40 | #define gettid() syscall(__NR_gettid) | [36/771] Compiling C object 'lib/76b5a35@@igt-igt_kms_c@sta/igt_kms.c.o'. ninja: build stopped: subcommand failed. So, fix this by by adding some meson checks to define HAVE_GETTID whenever the host defines its own gettid(), and avoid redefining gettid() when HAVE_GETTID is defined. This fixes build igt-gpu-tools for me on Fedora Rawhide Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-05-07lib/aux: Typecast gettid() as pid_tLyude Paul
Partly, for correctness. But mostly because not typecasting properly causes the gettid() macro provided by newer glibc to be typed as pid_t (aka int), while ours is typed as long. Causing annoying warnings: [158/846] Compiling C object 'tests/59830eb@@drm_import_export@exe/drm_import_export.c.o'. In file included from ../../mnt/vol/lib/drmtest.h:39, from ../../mnt/vol/lib/igt.h:27, from ../../mnt/vol/tests/drm_import_export.c:27: ../../mnt/vol/tests/drm_import_export.c: In function ‘test_thread’: ../../mnt/vol/tests/drm_import_export.c:123:12: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘__pid_t’ {aka ‘int’} [-Wformat=] 123 | igt_debug("start %ld\n", gettid()); | ^~~~~~~~~~~~~ ~~~~~~~~ | | | __pid_t {aka int} ../../mnt/vol/lib/igt_core.h:875:64: note: in definition of macro ‘igt_debug’ 875 | #define igt_debug(f...) igt_log(IGT_LOG_DOMAIN, IGT_LOG_DEBUG, f) | ^ ../../mnt/vol/tests/drm_import_export.c:123:21: note: format string is defined here 123 | igt_debug("start %ld\n", gettid()); | ~~^ | | | long int | %d So, typecast gettid() as pid_t and update all of our callers accordingly Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-05-07Use gettid() wrapper everywhereLyude Paul
Currently we have multiple different parts of IGT that define their own wrapper around the gettid() syscall (or just call it directly with no wrapper). Additionally, add the appropriate #includes for igt_aux.h to make sure syscall() is available. Reviewed-by: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Lyude Paul <lyude@redhat.com>
2019-04-26lib: consolidate duplicated define of vfs_file_max(void)Caz Yokoyama
Remove it from intel_os.c and gem_exec_reuse.c and globally define in igt_aux.c. v3: update comment in the code and commit message. Signed-off-by: Caz Yokoyama <caz.yokoyama@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2019-04-25tests/kms_chamelium: add dp-audio testSimon Ser
This new test ensures DisplayPort audio works by using the Chamelium. It enables the DisplayPort output and sends an audio signal containing a set of frequencies we choose to all HDMI/DisplayPort audio devices. It starts recording audio on the Chamelium device and uses the stream server to retrieve captured audio pages. It then checks that the capture audio signal contains the frequencies we sent, and only those, by computing a FFT. A new library has been added to libigt to communicate with the stream server. It implements a simple custom TCP protocol. In case the test fails, a WAV file with the captured data is saved on disk. Right now the test has a few limitations: - Only the first channel is checked - IGT only generates audio with a single sampling rate (48 KHz) - Audio data is not captured in real-time These limitations will be lifted in future patches. PulseAudio must not run during the tests since ALSA is used directly. To ensure this, edit /etc/pulse/client.conf and add `autospawn=no`. Then run `pulseaudio --kill`. This commit deletes the existing audio tests. They weren't run and required an exotic configuration (HDMI audio splitter, dummy HDMI sink and a line-in port on the DUT). This patch also changes lib/igt_audio to use uint16_t instead of short. The rationale is: - The standard says a short is at least 16 bit wide, but a short can be larger (in practice it won't happen, but better use types correctly) - It makes it clearer that the audio format is S16_LE, since "16" is in the type name. This patch depends on the following Chameleon bugs: - https://crbug.com/948060 - https://crbug.com/950857 Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-04-05lib: add igt_allow_unlimited_files()Lucas De Marchi
Share the implementation to tweak the maximum number of open files. The version in tests/i915/gem_exec_reuse.c was a little bit different, but I don't think it needs to be because it would still return a failure if any of the calls to setrlimit() fail. So I'm using the other one. Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-02-28lib: Incrementally mlock()Chris Wilson
As we already have the previous portion of the mmap mlocked, we only need to mlock() the fresh portion for testing available memory. v2: Fixup the uint64_t pointer arithmetric and only use a single mmap to avoid subsequent mlock fail (for reasons unknown, but bet on mm/). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Caz Yokoyama <Caz.Yokoyama@intel.com> Reviewed-by: Caz Yokoyama <Caz.Yokoyama@intel.com>
2018-09-25lib: Add DIV_ROUND_UP()Ville Syrjälä
Add DIV_ROUND_UP() and replace some hand rolled versions with it. v2: Drop the duplicate from gem_render_copy() (Paulo) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-09-11lib: Add roundup_power_of_two()Ville Syrjälä
Add a helper to round a value to the next power of two size. And since we need fls() to implement that, reuse that elsewhere as well. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-07-19lib: Move trash_bos to their only userChris Wilson
Only pm_rpm still uses the igt_trash_aperture() and so we can remove it from the lib and in the process convert it over from the legacy libdrm_intel. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2018-07-13lib/gt: Make use of dummyload library to create recursive batchAntonio Argenziano
An hanging batch is nothing more than a spinning batch that never gets stopped, so re-use the routines implemented in dummyload.c. v2: Let caller decide spin loop size v3: Only use loose loops for hangs (Chris) v4: No requires v5: Free the spinner v6: Chamelium exists. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> #v3 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-06-13lib: Extract mlock probingMichał Winiarski
We already have the routine we need in drv_suspend. Let's move it to lib and use it in the mlocking tests. We can also make it a bit faster if we tweak the initial step and initial amount. (I think it's safe to assume that we should be able to lock 3/4 of RAM, this cuts the probe time on my 32G SKL - from ~530s to ~180s) v2: Use available mem, amend step, also lock outside of fork, early exit if the assumption is wrong (Chris) Update the function name in doc (Ewelina) v3: Total for pin, available for initial lock (Chris) Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Ewelina Musial <ewelina.musial@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ewelina Musial <ewelina.musial@intel.com>
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-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-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-02-16lib/igt_aux: Add function to swap int64 in arrayAntonio Argenziano
v2: Use igt_swap() Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michal Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-01-26lib: Refactor igt_wait() to use library timersChris Wilson
Use the timer routines for computing elapsed time from igt_core for smaller code. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2017-11-29igt: Remove Android supportArkadiusz Hiler
This patch gets rid of the Android support, deleting all the hacks and moving code around to the places it belongs. Android build is not really maintained properly and rots rather fast. With recent push for Meson here and Android going for Soong it will only accelerate. It's a good time to drop the illusion of providing any support. Cc: Daniel Vetter <daniel.vetter@intel.com> Cc: Kalyan Kondapally <kalyan.kondapally@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2017-10-19lib/i915: Move submission related helpers to lib/i915/gem_submissionMichał Winiarski
Since I accidentally broke the build for some, by putting the pretty printer for submission inside ifdef HAVE_PROCPS, it's time to move the whole thing into lib/i915 while fixing this mistake. Let's also rename the pretty printer and add a doc to it as well as the section. Fixes: f6dfe556659f ("lib: Extract helpers for determining submission method") Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-17lib: Extract helpers for determining submission methodMichał Winiarski
Couple of tests are using either determining submission method, or pretty printing. Let's move those to helpers in lib. v2: s/igt_show/gem_show Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-10-16aux: Suspend signal helper for shell commandsImre Deak
The clone() system call with a larger executable (like /bin/sh) may have difficulty to make progress on some platforms if interrupted frequently. So suspend the signal helper process for the duration of the syscall. This is needed to solve an actual problem by the next patch. v2: - Clarify/fix code comments. (Chris) - Update igt_system_quiet() as well accordingly. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1)
2017-07-06Make igtrc configuration common, with configurable suspend/resume delayPaul Kocialkowski
This adds support for configurable suspend/resume delay and takes the occasion to move igtrc configuation from igt_chamelium to igt_core. This way, suspend/resume delay configuration can be used for all tests. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude Paul <lyude@redhat.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-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: 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-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-01-26igt_aux: Add igt_set_autoresume_delay()Lyude
The default autoresume delay is about 5 seconds. It's possible on a system that's not very fast this might not be a long enough time, since an asynchronous hotplug event we scheduled on the chamelium that was intended to happen during suspend could happen before we actually manage to suspend. So, add a function that allows us to increase the autoresume time to ensure this never happens during suspend/resume tests with the chamelium. Cc: Tomeu Vizoso <tomeu@tomeuvizoso.net> Signed-off-by: Lyude <lyude@redhat.com> Changes since v1: - Use igt_require, not assert
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-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_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-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-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-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-08-01igt/gem_mmap_gtt/wc: Reduce test runtimeChris Wilson
Add a new iterator macro to run for a specified number of milliseconds. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-27lib: update docs for igt_pmDaniel Vetter
- Move all the pm helpers into igt_pm.c. No idea why that wasn't done in the original commit that created igt_pm.c. - Add missing docs where needed. Cc: David Weinehall <david.weinehall@intel.com> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-03lib/igt_aux: Framework for measuring latency in raising signalsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-12lib/igt_aux: Polish docs for igt_timeoutDaniel Vetter
Add docs, rename parameter and rename the macro to igt_do_timeout to make it clear it works like a loop. v2: Rename instead to igt_until_timeout (Chris). Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-05-12lib/igt_aux: Polish docs for igt_interruptibleDaniel Vetter
- Give __ prefix to internal funcstion and structs, only igt_interruptible is used by tests. - Move docs to igt_interruptible and adjust. - Explain more clearly how the timeout is getting doubled each iteration until no more interruptions happen. Also rename the argument to give it a more meaningful name in the docs. - Link from other functions to this one for cross-referencing. - Rename to igt_do_interruptible to make it clearer it's a loop, inspired by do {} while () loops. v2: Rename instead to igt_while_interruptible and fix typos (Chris). And add gtk-doc for igt_ioctl, too. Acked-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-04-20igt/gem_close_race: BatifyChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-24lib: Add a GPU error detectorChris Wilson
If we listen to the uevents from the kernel, we can detect when the GPU hangs. This requires us to fork a helper process to do so and send a signal back to the parent. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19igt/gem_concurrent_blit: dmabuf requires twice the number of filesChris Wilson
In order to keep the dmabuf mmap around whilst we keep the object alive, we need a file descriptor for each. Check that the VFS supports that many fd. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19lib/igt_aux: Divert ioctls for signal injectionChris Wilson
To simplify and speed up running interruptible tests, use a custom ioctl() function that control the signaling and detect when we need no more iterations to trigger an interruption. We use a realtime timer to inject the signal after a certain delay, increasing the delay on every loop to try and exercise different code paths within the function. The first delay is very short such that we hopefully enter the kernel with a pending signal. Clients should use struct igt_sigiter iter = {}; while (igt_sigiter_repeat(&iter, enable_interrupts=true)) do_test() to automatically repeat the test until we can inject no more signals into the ioctls. This is condensed into a macro igt_interruptible(enable_interrupts=true) do_test(); for convenience. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22lib: Print memory requirements as MiBChris Wilson
Since we need a lot of memory, trim off the less significant digits for easier human consumption. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-19gem_concurrent_blit: Don't call igt_require() outside of a subtest/fixtureChris Wilson
gem_concurrent_blit tries to ensure that it doesn't try and run a test that would grind the system to a halt, i.e. unexpectedly cause swap thrashing. It currently calls intel_require_memory(), but outside of the subtest (as the tests use fork, it cannot do requirement testing within the test children) - but intel_require_memory() calls igt_require() and triggers and abort. Wrapping that initial require within an igt_fixture() stops the abort(), but also prevents any further testing. This patch restructures the requirement checking to ordinary conditions, which though allowing the test to run, also prevents listing of subtests on machines which cannot handle them.
2015-08-14lib: Allow caller to use uint64_t sizes with intel_require_memory()Chris Wilson
Allow the caller to ask how many extra large objects can be created and still fit into memory. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-07-02aux: Don't evaluate several times the arguments of min() and max()Damien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-06-11lib/igt_aux: add functions to manipulate i915.ko parametersPaulo Zanoni
Some i915.ko features have very nice IGT tests, which are never executed because the features are disabled by default. This leads to unnoticed regressions both in the Kernel and in the IGT tests. We have seen this multiple times, for example, on FBC and PSR. We want to be able to run IGT and actually test these disabled-by-default features in order to make sure we at least don't break them even more. Sometimes they may be disabled for some specific reason, and we don't want to increase the set of reasons without noticing. To help solving this problem, this commit adds some helper functions that should make it easier to change certain i915.ko parameters and then restore their original values at the end of the test. With this, I'm hoping QA will be able to detect any regressions and automatically bisect them - or, with PRTS, reject the patches before they are even merged. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-05-05lib: add igt_wait()Paulo Zanoni
Just a little helper for code that needs to wait for a certain condition to happen. It has the nice advantage that it can survive the signal helper. Despite the callers added in this patch, there is another that will go in a separate patch, and another in a new IGT test file that I plan to push later. v2: Check COND again before returning in case we hit the timeout. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>