summaryrefslogtreecommitdiff
path: root/tests/gem_concurrent_all.c
AgeCommit message (Collapse)Author
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-02-23Iterate over physical enginesChris Wilson
We current have a single for_each_engine() iterator which we use to generate both a set of uABI engines and a set of physical engines. Determining what uABI ring-id corresponds to an actual HW engine is tricky, so pull that out to a library function and introduce for_each_physical_engine() for cases where we want to issue requests once on each HW ring (avoiding aliasing issues). v2: Remember can_store_dword for gem_sync v3: Find more open-coded for_each_physical 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>
2017-04-13igt/gem_concurrent_blit: Mark up with DOMAIN_WCChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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-02-22igt: Start marking up GEM tests that require an alive GPU to functionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-01-02lib: Wrap conversion from u64 to pointersChris Wilson
The opposite direction of to_user_pointer() is from_user_pointer(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-01-02igt: Mass conversion to to_user_pointer()Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-26igt/gem_concurrent_blit: Only set the pixels to be compared (GTT paths)Chris Wilson
Just to tidy a discrepancy where doing the compare using the GTT (i.e. a readback) is now faster than setting the contents initially (as the readback only checks one pixel per page, do the same for setting the object). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-25igt/gem_concurrent_blit: Limit number of reads for dmabufsChris Wilson
vgem provides WC mmap on its dmabufs, so reading and comparing these is slow. We can employ a similar w/a to the other WC mmaps (i.e. mmap__gtt or mmap__wc) and only check one pixel per page. This will speed up those tests, but I don't know if it makes detecting coherency issues more or less likely. :| Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-23igt/gem_concurrent_all: Leave bufmgr destroyed before forkingChris Wilson
Otherwise we inherit the bufmgr and fd across the fork, try to clean it up in the child (affecting the parent's device), then try to clean it up in the parent (triggering warns). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-09-13igt/gem_busy: Prevent banning when running multiple hang testsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-27igt/gem_concurrent_blit: More subtest groupingChris Wilson
To stop igt from tripping over itself with the combinatorial explosion and skips. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-27igt/gem_concurrent_all: Fix up copy sizesChris Wilson
The copy size passed to the CPU copy routines were only for a single row not the full bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-18igt/gem_concurrent_blit: Hook up vgem dmabufChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-17tests: Push igt_fork/stop_hang_detector into fixturesDaniel Vetter
It access hardware, hence why the simple igt_only_list_subtests() check from igt_fork/stop_signal_helper() isn't enough. 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_concurrent_blit: Ensure we only shrink the child buffersChris Wilson
As we reuse the parent arrays under the assumption that the child uses fewer buffers, make sure that is true. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-11igt/gem_concurrent_blit: Tweak num_buffers to just exceed targetChris Wilson
Remember that we allocate and use twice as many buffers as specified (we have a num_buffers array of src and dst) and so adjust the computation such that the combined allocation matches the target. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-04-10igt/gem_concurrent_blit: Purge the libdrm caches before cloningChris Wilson
When forking, the entire VM is cloned including the VMA backed by GEM objects from the libdrm buffer cache. This is not only slow, but can also cause the system to exceed the maximum number of VMA and premature test failure. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-25igt/gem_concurrent_blit: Relax maxfiles restrictionsChris Wilson
Only fail the dmabuf tests if we cannot prep the system to support "unlimited" fd. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-24igt/gem_concurrent_blit: Enable hang detectionChris Wilson
When we aren't deliberately injecting hangs, we don't expect to see any GPU hang. Detect them and fail early. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-21igt/gem_concurrent_all: Inject a hang onto all ringsChris Wilson
Also test a hang across all rings, rather than just one engine. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-20igt/gem_concurent_blit: Prevent a memleak if we assert whilst creating buffersChris Wilson
Assume that we may halt partway through buffers_create() and so be careful to clear up the partial state in buffers_destroy(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-20igt/gem_concurrent_blit: Reset process limits to allow dmabuf testsChris Wilson
Since dmabuf requires an actual fd for every object, we need to increase the number of files our process is allowed. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19igt/gem_concurrent_blit: Enable quicker interruptible testingChris Wilson
v2: Because I managed to push the wrong version. Make --list-subtests happer by creating the name before the igt_fixture, not inside it. 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-19igt/gem_concurrent_blit: Enable quicker interruptible testingChris Wilson
Use the igt_sigiter interface to only repeat the -interruptible tests when we can make further progress with another change at injecting a signal. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-19tests/gem_concurrent_blt|all: Use igt_subtest_groupDaniel Vetter
Looks tidy again, and doesn't break igt assumptions. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-03-18igt/gem_concurent_blit: Exercise different object sizesChris Wilson
Searching for coherency problems that may arise with smaller-then-cache/large-then-cache objects. 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-10igt/gem_concurrent_blit: 32bit compilation warningChris Wilson
gem_concurrent_all.c: In function ‘__real_main1556’: gem_concurrent_all.c:1642:4: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘uint64_t’ [-Wformat=] igt_debug("Pinning %ld MiB\n", pin_sz); Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-01igt/gem_concurrent_blit: Deglobalify num_buffersChris Wilson
More num_buffers onto the local struct passed down into the tests to avoid the issue with having to modify the global value inside the tests leading to hilarity if the test asserts. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
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-25igt/gem_concurrent_blit: Pretend tests existChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-25igt/gem_concurrent_blit: Add dmabuf exercisersChris Wilson
Create and use dmabuf mmaps as well to ensure correct synchronisation between concurrent rendering and CPU access. 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-11lib: Add gem_userptr and __gem_userptr helpersTiago Vignatti
This patch moves userptr definitions and helpers implementation that were locally in gem_userptr_benchmark and gem_userptr_blits to the library, so other tests can make use of them as well. There's no functional changes. v2: added __ function to differentiate when errors want to be handled back in the caller; bring gem_userptr_sync back to gem_userptr_blits; added gtkdoc. v8: remove local_i915_gem_userptr from gem_concurrent_all.c to use the global helpers instead. Signed-off-by: Tiago Vignatti <tiago.vignatti@intel.com> Reviewed-by: Stéphane Marchesin <marcheu@chromium.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-01-27igt/gem_concurrent_blit: Disable libdrm buffer cache for child inheritanceChris Wilson
It just ends up with buffer leaks all over. On the flip side, it does allow us to inherit the bufmgr directly without worry of stomping over the aliased entries (and causing double closes). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27igt/gem_concurrent_all: Pass buffer data downChris Wilson
In order reduce the number of parameters being passed everywhere, whilst simultaneously making more information available to the lower levels, pass the struct buffers around. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27igt/gem_concurrent_blit: Tighter scoping of buffers variableChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27igt/gem_concurrent_blit: Close userptr handle after importing into bufmgrChris Wilson
The bufmgr import creates a new handle from a name for the userptr - we can discard our original handle immediately. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-27igt/gem_concurrent_blit: Tidy blt-fill using gem wrappersChris Wilson
Replace the open-coded ioctls with the thin gem wrappers. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-23igt/gem_concurrent_blit: Switch to a shared mmap for userptrChris Wilson
If we use a MAP_SHARED mmaping for the our backing storage for userptr, then it will be inherited across the fork with the same address. ideal for continuity testing of children. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-23igt/gem_concurrent_blit: Allocate a private batch cache for the childChris Wilson
We have to avoid the COW alias for the intel_bufmgr and intel_batch cache as the child may close the object (in its local cache) leaving an alias in the parent cache pointing to a stale object. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22igt/gem_concurrent_blit: Disable userptr+child testsChris Wilson
The issue here is that the pointer inherited upon the child is copied-on-write, i.e. the pointer is private to each process, but the handle is shared. This means that writes and reads in the child are going to a different set of pages than the GPU's object - the test is simply broken. To overcome this we would need to mmap the shared buffer into the child. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22igt/gem_concurrent_blit: Check inheritance of buffersChris Wilson
The current forked modes recreate their handles in the children and just look at any complications arising from contention. This mode looks at inheriting the fd+handles from the parent into the child and seeing if we can use them within the child. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-22lib: Refactor common detection of missed interruptsChris Wilson
As we have the same function in a few places to read the debugfs/i915_ring_missed_irq file, move it to the core. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>