summaryrefslogtreecommitdiff
path: root/tests/gem_reloc_vs_gpu.c
AgeCommit message (Collapse)Author
2017-09-08build: remove _GNU_SOURCE from source filesDaniel Vetter
We are, the build system takes care of that. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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-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-02igt: Mass conversion to to_user_pointer()Chris Wilson
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-01-20tests: Drop the superfluous igt_require_hang_ring()Chris Wilson
As the hang injection now itself checks for validity before use, the tests don't need to do so themselves. Except in certain situations! If the test forks, it should do requirement checks before the fork (so that we don't anger the igt gods) and if the test plays around i915.reset then it needs to do an early igt_require_hang_ring() that is not affected by the changes to i915.reset. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-12Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()Ville Syrjälä
gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with it. Mostly done with coccinelle, with some manual help: @@ identifier I; expression E1, E2, E3, E4, E5, E6; @@ ( - I = __gem_mmap__gtt(E1, E2, E3, E4); + I = gem_mmap__gtt(E1, E2, E3, E4); ... - igt_assert(I); | - I = __gem_mmap__cpu(E1, E2, E3, E4, E5); + I = gem_mmap__cpu(E1, E2, E3, E4, E5); ... - igt_assert(I); | - I = __gem_mmap__wc(E1, E2, E3, E4, E5); + I = gem_mmap__wc(E1, E2, E3, E4, E5); ... - igt_assert(I); ) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09Make gem_mmap__{cpu,gtt,wc}() assert on failureVille Syrjälä
Rename the current gem_mmap__{cpu,gtt,wc}() functions into __gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name that assert that the pointer is valid. Most callers will expect a valid pointer and shouldn't have to bother with failures. To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g' over the entire codebase. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09s/gem_mmap/gem_mmap__gtt/Ville Syrjälä
Get rid of the gem_mmap() alias of gem_mmap__gtt(). I don't see any point in having it. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> 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>
2015-03-06igt.cocci: Replace igt_assert() with igt_assert_CMP() where possibleMatt Roper
The integer comparison macros give us better error output by including the actual values that failed the comparison. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13lib/igt_gt: Document and consolidateDaniel Vetter
Also move forcewake and stop_rings code from igt_debugfs to igt_gt since it fits better. And move the hang injection fork helpers from igt_aux to igt_gt, too. Also push the intel_gen call into igt_hang_ring while at it. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13lib/gt: api polish for igt_can_hang_ringDaniel Vetter
Align with common igt library style: - Push the igt_require into the function. - Push the intel_gen into the function. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-01-07igt/gem_reloc_vs_hang: Inject hangs!Chris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-04tests: add more test descriptionsThomas Wood
Add more test descriptions based on exiting comments. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-19igt/gem_reloc_vs_gpu: Fix reloc.presumed_offset valueChris Wilson
Since the last patched value does not match the presumed relocation value we submit to the kernel, it occasionally makes mistakes. Also note that the libdrm interface makes the same presumptive mistake, and would easily be broken by a threaded environment. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=77793 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-30batch: Specify number of relocations to accommodateChris Wilson
Since relocations are variable size, depending upon generation, it is easier to handle the resizing of the batch request inside the BEGIN_BATCH macro. This still leaves us with having to resize commands in a few places - which still need adaption for gen8+. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29Prepare for 64bit relocation addressesChris Wilson
This reveal that quite a few locations were writing relocation offsets but only allowing for 32 bit addresses. To reveal such places in active tests, we also now double check that we do not use more batch space than declared. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-03-23lib: extract igt_aux.[hc]Daniel Vetter
And shovel all the various helpers in there. Also move igt_set_vt_graphics_mode to igt_kms.h since the function is implemented in igt_kms.c. And it fits better. I kinda missed this in the prep work. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: rename intel_gpu_tools.h to intel_io.hDaniel Vetter
With the header cleanup we can now give this header a suitable name, since it now really only contains register access and other I/O functions and assorted definitions. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-03-22lib: unnecessary header removal for drmtest.h, part 1Daniel Vetter
Brought a few missing headers to light in ioctl_wrappers.h, too. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-12-05gem_reloc_vs_gpu: Update for gen8 BLT cmdsBen Widawsky
NOTE: Some subtests are still failing, but I haven't found the bug yet. At least this should help QA meanwhile. Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
2013-11-06bdw: Update obvious missing blit supportBen Widawsky
This provides a macro that allows us to update all the arbitrary blit commands we have stuck throughout the code. It assumes we don't actually use 64b relocs (which is currently true). This also allows us to easily find all the areas we need to update later when we really use the upper dword. This block was done mostly with a sed job, and represents the easier in test blit implementations. v2 by Oscar: s/OUT_BATCH/BEGIN_BATCH in BLIT_COPY_BATCH_START CC: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Signed-off-by: Oscar Mateo <oscar.mateo@intel.com>
2013-11-04lib: drop return value from igt_drop_cachesDaniel Vetter
No one actually cares, everyone expects it to just work. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-04lib: Add igt_drop_caches_set()Oscar Mateo
This is basically a "drop cache" interface to the igt_debugfs facilities. Also, update existing users. Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> Cc: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-04tests: Fix "-thrashing" and "-thrash-inactive" distinctionOscar Mateo
A typo in the relocation tests made both sub-tests perform the same action: drop *all* caches. Signed-off-by: Oscar Mateo <oscar.mateo@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-11-01lib: add igt_main macroDaniel Vetter
In the past new testcases with subtest often forgot to add the call to igt_exit at the end of their main() function. That is now caught with a bit more obnoxious asserts, but it's still a nuissance. This little igt_main macro takes care of that (and also of calling the subtest machinery initialization code correctly). If no one objects I'll roll this out for all the simple cases (i.e. those tests that don't have additional argv parsing on top of the subtest machinery). v2: Roll it out across the board. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-25tests: use igt_assert/igt_require moreDaniel Vetter
With the new _f variants we can replace almost all of them. Also remove a ton of checks for argc != 1, they're a bit useless ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-11tests/gem_reloc_vs_gpu: some fixesDaniel Vetter
- Clear the igt_helper_process struct to avoid hitting asserts. - Fix up the logic for enumerating forked processes. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-10tests/gem_reloc_vs_gpu: use igt_fork_helperDaniel Vetter
Now we do a waitpid instead of a simple wait which could eat the "wrong" child ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04tests: add missing igt_exit() callsDaniel Vetter
Forgotten while converting to subtests, then copy&pasted. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-04tests: add gem_persisten_relocsDaniel Vetter
This reproduces the 3.7 relocation regression ... Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03tests/gem_reloc_vs_gpu: add thrashing testsDaniel Vetter
Using the i915_gem_drop_caches debugfs interface to thrash without really thrashing. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03tests/gem_reloc_vs_gpu: add forked versionsDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03tests/gem_reloc_vs_gpu: Add faulting reloc testsDaniel Vetter
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-09-03tests/gem_reloc_vs_gpu: add interruptible versionDaniel Vetter
Exercise a bug where we've failed to propagate the error code correctly. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13tests: use igt_fail instead of exit(param != 0)Daniel Vetter
Mostly a sed job with too manual fixups: - one case of using _exit instead of exit - and one case which under some conditions use 77, so convert that check to an igt_skip. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-13tests: s/assert/igt_assertDaniel Vetter
Just a wholesale rollout for now, we can refine later on. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-08-12s/drmtest_/igt_/Daniel Vetter
Requested-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2013-07-18tests: Black list tests we don't want to run on simulationDamien Lespiau
Let's start by a small set of tests, to eventually consider running more. The current list should then be: gem_mmap gem_pread_after_blit gem_ring_sync_loop gem_ctx_basic gem_pipe_control_store_loop gem_storedw_loop_render gem_storedw_loop_blt gem_storedw_loop_bsd gem_render_linear_blits gem_tiled_blits gem_cpu_reloc gem_exec_nop gem_mmap_gtt v2 add (Daniel Vetter) gem_exec_bad_domains gem_exec_faulting_reloc gem_flink gem_reg_read gem_reloc_overflow gem_tiling_max_stride prime_* Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2012-01-10tests: fixup new warningsDaniel Vetter
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-04tests/gem_reloc_vs_gpu: fixup this messDaniel Vetter
- fixup pitch mess noticed by Chris Wilson. - we need to diable bo reuse otherwise the kernel won't do the relocs (we might get an already gtt-bound batch from the dummy load). Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-04tests/gem_reloc_vs_gpu: emit special batch on blt ring on gen6+Daniel Vetter
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-04tests/gem_reloc_vs_gpu: switch to COLOR_BLT instead of PIPE_CONTROLDaniel Vetter
Less fancy command that works everywhere. Suggested by Chris Wilons. Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2011-12-04tests: add gem_reloc_vs_gpuDaniel Vetter
Tests whether the kernel properly waits for the gpu before applying a reloc. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>