summaryrefslogtreecommitdiff
path: root/tests/gem_ctx_thrash.c
AgeCommit message (Collapse)Author
2018-05-15igt/gem_ctx_thrash: Order writes between contextsChris Wilson
The test wrote to the same dwords from multiple contexts, assuming that the writes would be ordered by its submission. However, as it was using multiple contexts without a write hazard, those timelines are not coupled and the requests may be emitted to hw in any order. So emit a write hazard for each individual dword in the scratch (avoiding the write hazard for the scratch as a whole) to ensure the writes do occur in the expected order. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@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>
2018-02-07lib: Move __gem_context_create to common ioctl wrapper library.Antonio Argenziano
This patch adds a context creation ioctl wrapper that returns the error for the caller to consume. Multiple tests that implemented this already, have been changed to use the new library function. v2: - Add gem_require_contexts() to check for contexts support (Chris) v3: - Add gem_has_contexts to check for contexts support and change gem_require_contexts to skip if contests support is not available. (Chris) v4: - Cosmetic changes and use lib function in gem_ctx_create where possible. (Michal) v5: - Use gem_contexts_require() in tests and fixtures. (Chris) Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-10-17lib: Extract helpers for determining submission methodMichał Winiarski
Couple of tests are using either determining submission method, or pretty printing. Let's move those to helpers in lib. v2: s/igt_show/gem_show 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-05-18lib: Refactor testing for ability to use MI_STORE_DATA_IMMChris Wilson
Rather than have the code in multiple locations, put a copy in lib/ 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-10-10igt/gem_ctx_thrash: Include with-execlists indicatorChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-10igt/gem_ctx_thrash: Update context size estimatesChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-10igt/gem_ctx_threads: Repeat threads until timeoutChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-29tests: Skip if we cannot reserve infinite fd for ourselvesChris Wilson
A few tests rely on being able to allocate an "infinite" number of fd, but current assert instead of skip on more restrictive kernels. References: https://bugs.freedesktop.org/show_bug.cgi?id=97125 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-22lib/sysfs: Provide a convenience function for reading a boolChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-06-04igt/gem_ctx_thrash: Scale estimated usage by execlists.num_enginesChris Wilson
Since with execlists we use a context per-engine, we consume a lot more space than we were currently estimating. Enough to hit oom on some machines. References: https://bugs.freedesktop.org/show_bug.cgi?id=94145 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-18igt/gem_ctx_thrash: Combine context thrashing with a render testChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-18igt/gem_ctx_thrash: Double number of threads/proceessesChris Wilson
Slightly increase the stress by doubling the number of contending threads and the number of times we try and use each ctx/fd. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-05igt/gem_ctx_thrash: Rewrite to avoid extraneous allocationsChris Wilson
The goal of the test is to exercise what happens when we fill the Global GTT with the contexts. To that end, we only need to allocate 2/4GiB of context objects, and can forgo filling each context with buffers. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94005 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-25lib/ioctl_wrappers: Add gem_gtt_type exposing raw HAS_ALIASING_PPGTT paramMichał Winiarski
No functional changes. While I'm here, let's also rename gem_uses_aliasing_ppgtt (since it's being used to indicate if we are using ANY kind of ppgtt) and introduce gem_uses_full_ppgtt to drop some unnecessary code from tests that were previously calling getparam directly instead of using ioctl wrapper. v2: drop gem_uses_full_48b_ppgtt since it's no longer used anywhere, s/48b/64b (Chris) v3: rebase Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
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-02-13lib/igt_aux: s/swap/igt_swap/Daniel Vetter
It collides with the subtest naming convention glossary entry for swap. Which makes the docbook xml stuff unhappy. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06igt/gem_ctx_thrash: Tweak resource limitsChris Wilson
On some systems (ok, most systems!) we may need to enlarge the allowed number of open files in order to create enough fd to fill the aperture. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87572 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-18igt/gem_ctx_thrash/threads: Allow bo resuseChris Wilson
We already allocate enough objects to thrash the ppGTT VMs, so allow us to reuse the batch buffers for some efficiency gains and through the contention more towards the ctx->vm. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-18igt/gem_ctx_thread/processes: Serialise after forking childrenChris Wilson
Play nice, especially with the subtest, and wait for the children to exit before finishing the test. If we don't we end up with a fork bomb for some unknown reason... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-18igt/gem_ctx_thrash: Boost workloadsChris Wilson
Now that we are no longer busy-spinning inside random(), we can spend more time exercising i915.ko Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-12-17igt: Add gem_ctx_thrash to fill the GGTT with contextsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>