summaryrefslogtreecommitdiff
path: root/lib/Makefile.sources
AgeCommit message (Collapse)Author
2019-04-18lib: Add halffloat implementationKevin Strasser
Probe for and make an API available for tests to use f16c intrinsics to generate needed fp16 pixel data. Also import a pure c fp32 <-> fp16 conversion implementation from Mesa 18.3.4, which will act as a fallback when f16c is unavailable. rfc2: - Change API to reduce number of function calls (Maarten) v1: - Move pragma so AVX code isn't emitted for fallbacks (Ville) - Change edx to ecx (Ville) Signed-off-by: Kevin Strasser <kevin.strasser@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2019-04-17lib/igt_edid: new library for generating EDIDsSimon Ser
For the purposes of testing different EDID features, we need to generate more and more complex EDID blobs (e.g. with audio support). However currently IGT uses a macro-based system to generate EDIDs. This doesn't scale well and is pretty inflexible. This commit introduces a new little library to generate EDIDs. For now it can't do more than the old macro. Future commits will extend the API. The structures are mostly based on the Linux kernel code (drm_edid.h). Setters have been added for convenience. Signed-off-by: Simon Ser <simon.ser@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2019-04-10lib/igt_fb: Create AMD YUV buffers with AMD GEM IOCTLNicholas Kazlauskas
The kmstest_dumb_create API isn't suitable for creating multi-planar buffers since it tries to calculate the size based on the first plane's pitch only. AMDGPU requires that the luma pitch be aligned to 256 for YUV buffers which results in crashes on kms_plane@pixel-format-pipe-*-planes tests when using kmstest_dumb_create since the buffer returned is smaller than needed (16384 size returned, 24576 size required). Create and map the buffer with the correct size by using the AMD helpers introduced by this patch: igt_amd_create_bo and igt_amd_mmap_bo. Cc: Harry Wentland <harry.wentland@amd.com> Cc: Leo Li <sunpeng.li@amd.com> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Reviewed-by: Leo Li <sunpeng.li@amd.com>
2019-03-26lib: Add GPU power measurementChris Wilson
Read the RAPL power metrics courtesy of perf. Or your local HW equivalent? v2: uselocale() v3: Use gpu_power_s(), gpu_power_J(), gpu_power_W() to try and make the scale factors self-consistent. v4: Use igt_sysfs v5: s/tN/sampleN/ 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>
2019-02-26lib/i915: Move mmap IOCTLs wrappers into separate fileAntonio Argenziano
Move all mmap flavours and support function to separate file in i915 folder. This helps with moving i915 specific functions away from common libraries. v2: - Autotools still exists. (Petri) - Include gem_mman.h directly. (Chris) v3: - Keep includes explicit. (Chris) Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-02-26autotools: Always build VC4 helpers with the libraryPaul Kocialkowski
With recent changes to the igt_fb code, VC4 support is now integrated in common helpers. As a result, VC4 helpers have to be built as part of the library. This is already the case with meson, but VC4 support was removed from autotools. Bring it back unconditionally to match meson behaviour. This fixes a build error with autotools. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
2018-11-26v3d: Add a helper libraryEric Anholt
Just a few little ioctl wrappers that v3d tests will use. v2: Move the struct above the prototypes. Signed-off-by: Eric Anholt <eric@anholt.net> Acked-by: Petri Latvala <petri.latvala@intel.com> (v1)
2018-07-18lib/rendercopy: Add gen4/5 rendercopyLukasz Kalamarz
Add rendercopy implementation for gen4/5. Basic structure copied from the gen6 implementation, and the gen4/5 specific bits were mostly lifted from sna. v2: Renamed registers definitions, which are GEN4 specific to include that prefix (Lukasz) v3: Rebase and checkpatch Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-07-17tests/psr: Move PSR state test functions to libDhinakaran Pandiyan
kms_frontbuffer_tracking and kms_psr test PSR in different ways, let' fix that by creating common library functions. v2: Include the new file in meson.build v3: Leave --no-psr intact (Rodrigo) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-06-05lib/surfacestate: Creating surfaceformat headerLukasz Kalamarz
In several header files surface formats definitions were duplicated. To decrease amount of duplicated code in igt new lib was created. v2: Drop GEN_ from registers definition Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@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>
2018-05-23lib: Add igt_color_encodingVille Syrjälä
Add some helpers for generating rgb<->ycbcr conversion matrices. v2: Add enums for color_encoding/color_range Fix full range handling (lacked +-0.5<->+-1.0 scaling) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-05-23lib: Add igt_matrixVille Syrjälä
Add a helper library for basic matrix math. v2: Make the identity matrix static const (Chris) Add the m(row,col) macro (Chris) Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
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-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-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-03-05tests/perf_pmu: Handle CPU hotplug failures betterChris Wilson
CPU hotplug, especially CPU0, can be flaky on commodity hardware. To improve test reliability and reponse times when testing larger runs we need to handle those cases better. Handle failures to off-line a CPU by immediately skipping the test, and failures to on-line a CPU by immediately rebooting the machine. This patch includes igt_sysrq_reboot implementation from Chris Wilson. v2: Halt by default, reboot if env variable IGT_REBOOT_ON_FATAL_ERROR is set. (Petri Latvala) v3: Add missign docs and update stale comment. (Petri Latvala) v4: Use pause instead of sleep. (Chris Wilson) v5: Newlines! (Chris Wilson) Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-02-23lib/igt_gt: add intel_measure_ring_sizeDaniele Ceraolo Spurio
The logic to measure the ring size is replicated almost identically in several tests. Adding it as a common function will make the code cleaner. The tests are updated in follow up patches. v2: - Move into a new file: 'gem_ring'. (Chris) v3: - Rename ring measure function. (Chris) Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-12-08lib: Print other clients when DRM_SET_MASTER failsChris Wilson
It looks like there are some rogue processes running in CI that prevent DRM_MASTER from being obtained. Dump the list of clients on failure to make it more obvious what is being left behind. v2: Fix up gtkdocs, meson build References: https://bugs.freedesktop.org/show_bug.cgi?id=104157 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-12-08lib: Make sure intel_aub.h gets packed in distPetri Latvala
Error revealed by distcheck. Fixes: 539a86ec6035 ("lib: copy intel_aub.h from libdrm") Signed-off-by: Petri Latvala <petri.latvala@intel.com> Cc: Scott D Phillips <scott.d.phillips@intel.com> Cc: Ben Widawsky <ben@bwidawsk.net> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Reviewed-by: Scott D Phillips <scott.d.phillips@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/i915: Move context related helpers to lib/i915/gem_contextMichał Winiarski
We'd like to make ioctl_wrappers a bit thinner, and we plan to add new helpers in the following patch. Let's move context related helpers before adding more content. 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-17lib/i915: Extract helpers for determining scheduler capabilitiesMichał Winiarski
Couple of tests are using either determining scheduler capabilities or pretty printing. Let's move those to helpers in lib. We can also keep the value obtained from getparam static. v2: Break the trend of expanding ioctl_wrappers 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-10lib: Add some syncobj helpers (v2)Jason Ekstrand
[airlied: added some initial gtk-doc for the helper library.] Reviewed-by: Dave Airlie <airlied@redhat.com> Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2017-10-03lib: Reduce dependency on glibPetri Latvala
In commit ebd6eb69f57b ("Make igtrc configuration common, with configurable suspend/resume delay") .igtrc handling was moved to igt_core from igt_chamelium. That made everything in IGT depend on GLIB by accident. In short, igt_core.h declared a variable of type GKeyFile*, requiring glib.h. Everything that tried to #include igt_core.h required glib.h to be available, by use of GLIB_CFLAGS. This "worked" so far because CAIRO_CFLAGS contained GLIB_CFLAGS. As the variable is only used by other stuff in lib/, stuff it in its own header file to leave igt_core.h without a dependency to glib.h. Also add a couple of missing #ifdef HAVE_GLIBs around. Reported-by: Felipe De Jesus Ruiz Garcia <felipe.de.jesus.ruiz.garcia@intel.com> Signed-off-by: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-07-20lib/igt_frame: Add support for analog frame comparison testingPaul Kocialkowski
This adds support for analog frame comparison check, as used in VGA. Since VGA uses a DAC-ADC chain, its data cannot be expected to be pixel perfect. Thus, it is impossible to uses a CRC check and full frames have to be analyzed instead. Such an analysis is implemented, based on both an absolute error threshold and a correlation with the expected error trend for a DAC-ADC chain. It was tested with a couple encoders and provides reliable error detection with few false positives. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.com>
2017-07-19Introduce common frame dumping configuration and helpersPaul Kocialkowski
This introduces a common FrameDumpPath configuration field, as well as helper functions in dedicated igt_frame for writing cairo surfaces to png files. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude <lyude@redhat.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-03-13Revert "lib: Add i915 and drm-mm selftest headers from the kernel"Chris Wilson
This reverts commit 5ca0da9f53023b9fcfd327a5f43bc7b0916b24b1.
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-01-27Only build chamelium if its dependencies are metChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-01-26Add support for hotplug testing with the ChameliumLyude
For the purpose of testing things such as hotplugging and bad monitors, the ChromeOS team ended up designing a neat little device known as the Chamelium. More information on this can be found here: https://www.chromium.org/chromium-os/testing/chamelium This adds support for a couple of things to intel-gpu-tools: - igt library functions for connecting to udev and monitoring it for hotplug events, loosely based off of the unfinished hotplugging implementation in testdisplay - Library functions for controlling the chamelium in tests using xmlrpc. A couple of RPC calls were ommitted here, mainly because they didn't seem very useful for our needs (yet) - A set of functions for doing CRC checks and frame comparisons in tests - A set of basic tests using the Chamelium library. Cc: Tomeu Vizoso <tomeu@tomeuvizoso.net> Signed-off-by: Lyude <lyude@redhat.com> Changes since v1: - Don't try to guess connector mappings, have the user specify them manually using a configuration file - Open DRM fd using DRIVER_ANY, not DRIVER_INTEL - Lower the hotplug timeout a little bit, since 30 seconds was leftover from debugging these tests anyway - Don't try to keep track of the original state of the chamelium ports, and just leave them plugged in after each run. This makes more sense to me, since I'd imagine in automated testing setups using chameliums that all of the extra monitors will probably be provided by the Chamelium to begin with, so keeping them plugged in would make sure tests running afterwards that require >1 monitor don't get skipped. - Add wait_for_connector() to the chamelium tests. After some more testing, I found that depending on the system some tests would throw false negatives due to us not waiting long enough for the system to detect that we connected something to it. This mainly happened with VGA connectors, since their lack of HPD makes them take significantly longer for the hardware to notice. wait_for_connector() fixes this by continually reprobing the status of the desired connector (without relying on a hpd event happening, since that might never come) until we get what we want, or we time out and fail. - Use kmstest_get_property() for retrieving EDIDs instead of doing it by hand - Don't hardcode PIPE_A for bringing up the display, use kmstest to find an appropriate CRTC to use. Changes since v2: - Fix incorrect usage of the list helpers when recording new EDIDs - Add missing documentation - Make sure documentation actually appears - Since we finally got video capture working, add CRC functions and fix the ones we couldn't actually test before - In the exit handler, reset the xmlrpc env so we can properly reset the Chamelium even after an RPC error - Make sure compiling without Chamelium support still works Changes since v3: - Change the config file name from .igt_chamelium_rc to .igtrc - Remove chamelium global context - Get rid of define_common_connector_tests() - Get rid of connector list, expose connectors as opaque objects and provide helpers for accessing their attributes - Get rid of configure.ac option for Chamelium - Add tests for CRC functions - Add frame dumping functions + tests - Add FSM handling to chamelium_rpc() - Use LIBUDEV_LIBS in automake, not UDEV_LIBS - Documentation fixes - Improve debugging output some more - Remove skip_without_suspend_support, we no longer need to check for suspend support before calling things - Remove unnessecary malloc() checks with igt_assert() - Don't use igt_require in chamelium_init, leave it up to the caller whether or not to abort when failing to initialize the chamelium - Use igt_assert_eq for making assertions about connector's statuses - Define suspend/resume delay for tests as constant
2016-12-14lib/sw_sync: Add helper functions for managing synchronization primitivesRobert Foss
Base functions to help testing the Sync File Framework (explicit fencing mechanism ported from Android). These functions allow you to create, use and destroy timelines and fences. Signed-off-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.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-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-09-20lib: Add igt_primes.h to SOURCESChris Wilson
Not as automagic as kbuild :( Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-16lib: Add an iterator to generate primesChris Wilson
Primes are useful as input sources since they should not fall into any patterns that may be optimised by the drivers. An example of use this in a test driver: uint32_t seqno, inc, count; seqno = inc = count = 0; do { inc = igt_next_prime_number(inc); if (seqno + inc < seqno) break; seqno += inc; /* igt_assert_eq(test_inc(inc), seqno); */ count++; } while (1); printf("count=%u, seqno=%u, last=%u\n", count, seqno, inc); and prints "count=27878, seqno=4294845817, last=323381", or for simply generating the set of the first N prime numbers, use for_each_prime_number(prime, 100) printf("%lu ", prime); which prints 1 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 64 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 Note that 1 is included in the set of prime numbers for convenience above. Mathematicians beware! The set of primes is computed using the Sieve of Eratosthenes, which basically just keeps a list of all multiples - any number not in list is therefore prime. As a bitmask of all integers is kept, it can be quite memory intensive for very large primes. A fallback to "trial division" is available just in case, but for large primes that is much slower. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-04lib/Makefile: Replace automake specific names of listings in Makefile.sourcesRobert Foss
Replace the automake specific variable names for listings in Makefile.sources with something not automake specific. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-07-11lib; Add x86 cpuid based feature detectionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-03igt/gem_exec_gttfill: Reduce overhead in setting up filler batchesChris Wilson
Since all the batches start with the same content, we can reuse the same buf to fill them. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-30lib: Start weaning off defunct intel_chipset.hChris Wilson
Several years ago we made the plan of only having one canonical source for i915_pciids.h, the kernel and everyone importing their definitions from that. For consistency, we style the intel_device_info after the kernel, most notably using a generation mask and a per-codename bitfield. This first step converts looking up the generation for a devid tree from a massive if(devid)-chain to a (cached) table lookup. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-23igt: Add basic framework for GVT-g testingChris Wilson
We don't do anything yet other than try to load the module. Initial sanity checks to come. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Zhi Wang <zhi.a.wang@intel.com>
2016-06-18igt: Add basic exercise of vGEMChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-05-31lib: Add simple sysfs accessorsChris Wilson
igt_sysfs_set() for setting an attribute via sysfs, igt_sysfs_get() for reading. v2: Lots of little bugs in igt_sysfs_get() v3: Pass device to open, stop assuming Intel rules. v4: Test opening and reading! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-19lib/igt_pm: Lib for power managementDavid Weinehall
Move power management related code to a separate library. Initially this is done only for workarounds that apply to external components. Modify the users of such workarounds accordingly. This currently involves HD audio and SATA link power management. For SATA link PM there's also code to save the previous settings, to allow for resetting the values after we've finished testing. Signed-off-by: David Weinehall <david.weinehall@intel.com> Reviewed-by: Marius Vlad <marius.c.vlad@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-02-17lib/igt_core.c: Expand --run-subtest functionality.Derek Morton
Added extended wildcard support when specifying --run-subtest. Wildcard format is as specified in rfc3977 and the uwildmat() implementation is taken from libinn. See https://tools.ietf.org/html/rfc3977#section-4 for a description of allowed wildcard expressions. v2: Use comma as list separator (Ville Syrjala) support both ^ and ! as not operators (Dave Gordon) v3: Updated to use uwildmat() (Dave Gordon) Signed-off-by: Derek Morton <derek.j.morton@intel.com> [danvet: Fixup whitespace. Add #include <stdint.h>. Run lint.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-02-09lib: Only compile igt_vc4 is we have itDaniel Vetter
Unbreaks compilation fail. Also appease gcc in gem_exec_basic because. Cc: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-02-08igt: Add a helper function for getting a VC4 BO that's been drawn to.Eric Anholt
v2: Use do_ioctl(). Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Daniel Stone <daniels@collabora.com>
2015-12-08lib/kms: Turn base_edid into a templateVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-08-21lib: fix distcheck issuesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>