summaryrefslogtreecommitdiff
path: root/lib/igt.h
AgeCommit message (Collapse)Author
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-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>
2017-08-21lib: Add ALSA library with dedicated helpersPaul Kocialkowski
This introduces an ALSA library, with dedicated helpers for handling playback and capture. It handles ALSA device identification and configuration as well as a run loop with callback mechanisms for feeding output data and handling input data. This library paves the way for testing audio going through display connectors, such as HDMI. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
2017-08-21lib: Add audio library with dedicated helpersPaul Kocialkowski
This introduces an audio library, with dedicated helpers for both generating signals and detecting peak frequencies in a signal. This library paves the way for testing audio going through display connectors, such as HDMI. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com> Reviewed-by: Lyude Paul <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-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-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-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>
2015-08-21lib: fix distcheck issuesThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: add a single include headerThomas Wood
Add a header that includes all the headers for the library. This allows reorganisation of the library without affecting programs using it and also simplifies the headers that need to be included to use the library. Signed-off-by: Thomas Wood <thomas.wood@intel.com>