summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
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-21lib: add crc comparison function without an assertLionel Landwerlin
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21lib: fb: add igt_paint_color_gradient_rangeLionel Landwerlin
This is a helper to draw a gradient between 2 colors. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21lib: kms: add helpers for color management properties on pipesLionel Landwerlin
v2: Rename CTM_MATRIX property to CTM v3: Add support for atomic commits Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21lib: kms: add crtc_id to igt_pipe_tLionel Landwerlin
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
2016-03-21lib: Measure the cost of calling timer_settimer() for sigiterChris Wilson
We wish to delay the first signal from the igt_sigiter_ioctl sufficiently to skip over the timer_settime() and into the drmIoctl kernel context before firing. If we fire too early, we will think that the ioctl doesn't respond to signals and ignore it in future. If we fire too late, we won't probe the ioctl for signal handling at all. Let's try measuring the timer_settime() call time as a first approximation. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19lib/igt_aux: Refine decision to stop signal injectionChris Wilson
The goal of injecting signals into the ioctl() is to trigger an EINTR. If we did not succeed on the last pass, we are not going to on the next or subsequent passes either. 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-03-19lib: Replace drmIoctl() with a layer of indirectionChris Wilson
Insted of calling drmIoctl() directly, call igt_ioctl() instead. In the normal scenario this is function pointer that calls drmIoctl() (so no penalty), but allows us to divert ioctls into our own routines for nefarious purposes. One such purpose will be to control interrupt generation into the ioctl, to be able to detect when we successfully interrupt the ioctl and when we no longer need more interrupts. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19lib/tests: More igt_subtest_group checksDaniel Vetter
... for some cases discussed with Chris on irc. We seem to get them all right. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-03-19lib: Fix some doc warningsDaniel Vetter
Cc: Marius Vlad <marius.c.vlad@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-03-19lib: Add igt_subtest_groupDaniel Vetter
Useful for creating common setup code in igt_fixture which is only needed by a subset of tests. And since I'm a good citizen it comes with a library testcase/example included. v2: Make testcase nastier to ensure a subtest group SKIPS when it's parent is skipping already. I accidentally got this right, but let's make sure. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2016-03-18intel: Adding missing Broxton PCI IDs.Rodrigo Vivi
These IDs were already part of the kernel since: kernel commit 985dd4360fdf2533fe48a33a4a2094f2e4718dc0 Author: Imre Deak <imre.deak@intel.com> Date: Thu Jan 28 16:04:12 2016 +0200 drm/i915/bxt: update list of PCIIDs Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Arun Siluvery <arun.siluvery@linux.intel.com>
2016-03-18lib/ioctl_wrappers: Explain a couple of igt_require(ret == 0)Chris Wilson
Use more verbose igt_require(), here assocaited with SET_CACHING, such that the requirements are explained in the debug/failure log. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-18lib/intel_os: Squelch dmesg spam when purging VM cachesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-18igt/gem_concurrent_all: struct buffers for allChris Wilson
Now that we started packaging all parameters in one handy struct, pass them everywhere. This allows us to pass along requirements so that we can perform the checks inside each indvidual subtest and so not anger the igt gods. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-18igt/gem_softpin: Repeat tests with signal interruptionsChris Wilson
For the long running tests probing error conditions, throwing in the signal interruptions is a good idea. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-17lib/igt_gt: Handle SIGINT whilst writing to i915_error_stateChris Wilson
Becareful in case we try and eat the error state whilst interrupts are being sent and repeat the write() until we finish uninterrupted. References: https://bugs.freedesktop.org/show_bug.cgi?id=94573 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-15lib/igt_kms: Add COMMIT_ATOMIC to igt_display_commit2()Mayuresh Gharpure
Co-Author : Marius Vlad <marius.c.vlad@intel.com> Co-Author : Pratik Vishwakarma <pratik.vishwakarma@intel.com> So far we have had only two commit styles, COMMIT_LEGACY and COMMIT_UNIVERSAL. This patch adds another commit style COMMIT_ATOMIC which makes use of drmModeAtomicCommit() v2: (Marius) i)Set CRTC_ID to zero while disabling plane ii)Modified the log message in igt_atomic_prepare_plane_commit https://patchwork.freedesktop.org/patch/71945/ v3: (Marius)Set FB_ID to zero while disabling plane https://patchwork.freedesktop.org/patch/72179/ v4: (Maarten) Corrected the typo in commit message https://patchwork.freedesktop.org/patch/72598/ v5: Added check for DRM_CLIENT_CAP_ATOMIC in igt_display_init (Marius) i)Removed unused props from igt_display_init ii)Removed unused ret. Changed function to void iii)Declare the variable before checking if we have DRM_CLIENT_CAP_ATOMIC. https://patchwork.freedesktop.org/patch/73505/ v6: (Jani) Corrected typo in commit message v7: Added is_atomic check for DRM_CLIENT_CAP_ATOMIC in igt_display_init and igt_atomic_commit v8: (Matthew Auld) Replaced for loops by for_each_connected_output and for_each_plane_on_pipe (Lionel) Populate properties only if the value has changed Remove the resetting of values in disable case Note : I've used Maarten's diff patch v9: (Lionel) Added resetting of rotation property v10: (Marius) Modified the macro declaration to avoid shadow declaration warning, also removed one unused variable Signed-off-by: Mayuresh Gharpure <mayuresh.s.gharpure@intel.com> Signed-off-by: Pratik Vishwakarma <pratik.vishwakarma@intel.com> Signed-off-by: Mayuresh Gharpure <mayuresh.s.gharpure@intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-03-14lib: Remove dead gem_get_num_rings()Chris Wilson
No users so time to die. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-14lib: Remove unused gem_has_enable_ring()Chris Wilson
No one uses this nor should they as it just gem_get_param() in disguise and they are better feature queries for whether individual execution engines are functional. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-09benchmarks: Add gem_syslatencyChris Wilson
Instead of measuring the wakeup latency of a GEM client, we turn the tables here and ask what is the wakeup latency of a normal process competing with GEM. In particular, a realtime process that expects deterministic latency. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-09lib: remove saved_sig_maskDaniel Vetter
Oversight from the exit handler cleanup, spotted by Chris Wilson. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-08lib: Unit test for exit handlerDaniel Vetter
Checks that - exit handlers are run only once, even when registered multiple times. - run in reverse order - actually run for all ways a test could exit. This is prep work to extend exit handlers to also work in a subtest aware way. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-08lib/igt_core: remove igt_disable/enable_exit_handlersDaniel Vetter
No longer needed, and also not really a safe idea. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-08lib/igt_kms: Don't disable exit handlers around set_vt_modeDaniel Vetter
This was originally added to work around a race, but then that's broken now. And set_vt_mode generally never results in a test binary crash, so overkill. I want to get rid of this interface since I spotted some abuse. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-08benchmarks/gem_latency: Replace igt_stats with igt_meanChris Wilson
Use a simpler statically allocated struct for computing the mean as otherwise we many run out of memeory! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08lib: Magic for_each_engine() macro to iterate over available enginesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08igt/gem_exec_suspend: Do pre/post suspend double checksChris Wilson
Check that the system operates normally before and after the suspend (as well as across the suspend). The goal is to isolate the breakage to the subtest. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08lib: Skip execution in gem_has_ring()Chris Wilson
By looking for a particular error we can avoid actually executing anything when testing whether the kernel supports an individual ring. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08lib: Flush all possible ringsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-08lib: Flush BSD2 as well when availableChris Wilson
When flushing work and idling the GPU, we need to flush all engines, including the forgotten BSD2. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-03tests: fix CRTC assignment for a few testsPaulo Zanoni
All the tests I wrote always assumed that every connector supported CRTC 0. This is not the case for BSW and possibly others, so fix the tests before the CI reports more failures. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-03lib/igt_kms: add kmstest_get_crtc_idxPaulo Zanoni
Move it from pm_rpm.c to lib/igt_kms and remove the hardcoded version from kms_frontbuffer_tracking. I'm also planning to add other callers. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-03lib/igt_fb: Fix gen2 and 915 Y tile sizesVille Syrjälä
gen2 tile dimensions are 128x32 for both X and Y tiling 915 tile dimensions are 512x8 for both X and Y tiling Fix igt_get_fb_tile_size() to return the correct Y tile dimensions for these platforms. X tile was fine already. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-03-03lib/igt_kms: Fix igt_fb_set_size() debug messageVille Syrjälä
The debug message in igt_fb_set_size() was copy pasted from igt_fb_set_position() and not adjusted to say the right thing. Fix it up. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-03-03lib/igt_gt: Replace asm clflush/mfence with __builtin_ia32 variantsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-03lib: Tidy testing for rtcwakeChris Wilson
When performing a dummy-run of rtcwake, hide the output as it doesn't print anything useful (just when it will wake up). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-02lib/igt_fb: Fix domain tracking for GTT cairo surfacesChris Wilson
If we create a cairo surface using a GTT mmaping, then we need to use the GTT access domain. cairo surfaces created with a blit temporary (for unfenced surfaces) still use the CPU domain. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-02lib: Show the command that fails when suspendingChris Wilson
Include the system("") in the debug output for the assertion failure. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-01lib: move i915_wedged_set to ig_gt.cDaniele Ceraolo Spurio
Upcoming tests will call it to recover from bad states caused by hangcheck bugs.the function was renamed to igt_force_gpu_reset to have a naming closer to other hang-related functions in the same file. The value written to the debugfs has also been changed to -1; this makes no differences with the current implementation but copes with upcoming TDR changes (still under discussion) that should allow the resetting of a mask of rings. Signed-off-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
2016-03-01lib: Add read/write direction support for dmabuf synchronisationChris Wilson
Allow read-only synchronisation on dmabuf mmaps, useful to allow concurrent read-read testing between the CPU and GPU. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-29lib: Check required number of surfaces against VFS file limitsChris Wilson
If we want to create more file handles than VFS supports (itself often a memory limited value), report that we can not create that many objects via intel_require_memory(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-26igt/gem_sync: Enforce a timeout of 20sChris Wilson
The sync test is supposed to complete in 10s. But some bugs cause it to run very, very slowly. As a defence against those, terminate the test if we wait for more than 20s. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-23lib: Move gem_wait() to ioctl-wrappersChris Wilson
We intend to use gem_wait() in more tests than gem_wait.c, so move the simple ioctl wrapper into the core. 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-18lib: Restore gem_available_aperture_size()Chris Wilson
Missed an error whilst rebasing and trying to modify the previous patch to keep this function intact... Instead, I now have to add this patch to restore gem_available_aperture_size() and its one usage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-18igt: Report the global GTT sizeChris Wilson
For many tests, the relevant aperture is not the ppGTT but the internal global GTT managed by the kernel. Use this limit appropriately. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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>