summaryrefslogtreecommitdiff
path: root/tests/i915/gem_ctx_engines.c
AgeCommit message (Collapse)Author
2022-06-01tests/i915: Use correct type for gen parameterKarolina Drobnik
intel_gen is designed to return a big unsigned number for an unknown device. The value is interpreted to be the newest generation possible, and the matching configuration is used. Some functions incorrectly pass the gen value as a signed number, meaning it becomes negative, and the oldest configuration is used instead of the newest one. This leads to GPU hangs in some cases. Update the definition of submit functions in gem_exec_gttfill and gem_softpin, and has_cs_timestamp in gem_ctx_engines to use a correct type for gen parameter. Signed-off-by: Karolina Drobnik <karolina.drobnik@intel.com> Cc: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2022-04-04tests/gem_ctx_engines: handle missing set_cachingMatthew Auld
Not supported on discrete. Here the object will already have the GTT caching bits enabled, and the mapping will be WB, which looks inline with what the test is expecting here. Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/4926 Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Nirmoy Das <nirmoy.das@linux.intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com>
2022-02-09tests/i915/gem_ctx_engines: Added out fence for execute-one subtestArjun Melkaveri
Resolved __gem_execbuf error seen, by passing spin->execbuf.rsvd2 >> 32. As we are creating ctx for each engine . Error resolved:- (gem_ctx_engines:4117) CRITICAL: Failed assertion: __gem_execbuf(i915, &execbuf) == expected (gem_ctx_engines:4117) CRITICAL: Failed to report the valid engine for slot 0 (valid at 0) Introducing IGT_SPIN_FENCE_OUT means we can stop using the no-preemption in spinner. Added I915_EXEC_FENCE_IN to the execbuf.flags so that it is executed after the spinner. This is enhancement to the code . Cc: Chris Wilson <chris.p.wilson@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Signed-off-by: Arjun Melkaveri <arjun.melkaveri@intel.com> Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
2021-08-10tests/gem_ctx_engines: Adopt to use allocatorZbigniew Kempczyński
For newer gens we're not able to rely on relocations. Adopt to use offsets acquired from the allocator. Signed-off-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com>
2021-07-08tests/i915/gem_ctx_engines: Fix the invalid subtest for the new rulesJason Ekstrand
Since we no longer allow setting engines multiple times on one context, we need to create a new context every time. We've also got more invalid cases that need testing. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2021-07-08lib/i915: Rework engine API availability checks (v4)Jason Ekstrand
Instead of relying on the context param, check for the device query or attempt to set engines as a create param. v2 (Jason Ekstrand): - Add a common gem_has_context_engines helper v3 (Jason Ekstrand): - Drop gem_has_context_engines and always check I915_QUERY_ENGINE_INFO v4 (Ashutosh Dixit): - Add a comment to the gem_has_engine_topology docs saying that it can be used to query either feature. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2021-07-08tests/i915/gem_ctx_engines: Delete the libapi subtestJason Ekstrand
It just tests enumeration APIs that we're about to delete. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2021-07-08tests/i915/gem_ctx_engines: Drop the idempotent subtestJason Ekstrand
This just tests the engines CONTEXT_GETPARAM which we're going to be dropping from i915. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2021-07-08tests/i915/gem_ctx_engines: Use better engine iterationJason Ekstrand
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2021-07-08tests/i915/gem_ctx_engines: Rework execute-one*Jason Ekstrand
Instead of switching out the set of engines constantly, create a new context for every set of engines. This means, among other things, that there's no point in testing whether or not the context is in a "default" because there's no more resetting it. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2021-06-10lib/dummyload: Rename igt_spin_factory::ctx to ctx_idJason Ekstrand
Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2021-05-27lib/i915/gem_create: Add gem_create_extAndrzej Turko
Add a wrapper for gem_create_ext ioctl (a version of gem_create that accepts extensions). In preparation for the driver change implementing it, a local definition of its id and necessary structs have been added, which are to be erased as soon as those definitions appear in the i915_drm.h file. The new ioctl wrapper is added to a separate file. For consistency the wrapper of the old ioctl, gem_create is moved from ioctl_wrappers to gem_create. Signed-off-by: Andrzej Turko <andrzej.turko@linux.intel.com> Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com> Cc: Dominik Grzegorzek <dominik.grzegorzek@intel.com> Cc: Petri Latvala <petri.latvala@intel.com> Cc: Chris P Wilson <chris.p.wilson@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2021-01-06i915/gem_ctx_engines: Skip store-dword testing on unusable enginesChris Wilson
If the engine does not support MI_STORE_DWORD, we cannot use IGT_SPIN_POLL_RUN. For simplicity, skip testing that engine, slightly better than skipping the entire test at least. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2021-01-06i915/gem_ctx_engine: Prerun the spinner to bind offsets before useChris Wilson
Set the spinner and target execbuf up before we start the test; this not only saves time in recreating the spinner on each loop, but it ensures that we don't antagonise ourselves by fighting over GTT offsets. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Venkata Sandeep Dhanalakota <venkata.s.dhanalakota@intel.com> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2021-01-03i915/gem_ctx_engines: Don't try and read non-existent registersChris Wilson
Skip reading CS_TIMESTAMP on Sandybridge/bcs as it doesn't exist. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-12-29i915/gem_ctx_engine: Check idempotency by passing all known enginesChris Wilson
Don't rely on just rcs0 being well defined, check that we return a list of each engine when asked. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: "Melkaveri, Arjun" <arjun.melkaveri@intel.com> Reviewed-by: Arjun Melkaveri <arjun.melkaveri@intel.com>
2020-12-29i915/gem_ctx_engines: Exercise independence across all physical enginesChris Wilson
Run the 'independent' subtest on all all engines. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Andi Shyti <andi.shyti@intel.com>
2020-10-15tests/i915: Treat gen as unsigned for forward compatibilityChris Wilson
We want to recognise future devices (gen = -1u) and treat them as an extension of the latest known device, which is typically true. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2020-05-28i915/gem_ctx_engines: Take GPU relocations into account for batch busynessChris Wilson
If we are using GPU relocations, then the batch may legitimately be marked as having been written to by the GPU. As this is expected, remove the write marker, which may be a different engine to that we execute on, and the corresponding read engine if different. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-05-07lib/i915: Split igt_require_gem() into i915/Chris Wilson
igt_require_gem() is a pecularity of i915/, move it out of the core. Similar opportunistic move of gem_reopen_driver() and gem_quiescent_gpu(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2020-02-15i915/gem_ctx_engine: Exercise for_each_context_engine() with custom engine[]Chris Wilson
Set up a custom engine map with no engines, and check that the for_each_context_engine() correctly iterates over nothing. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2020-02-14i915/gem_ctx_engines: Exercise 0 engines[]Chris Wilson
Setup a context with no engines, and make sure we reject all execution attempts. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2020-01-28i915/gem_ctx_engines: Use a mmap-offset for an invalid pointerChris Wilson
It suffices to use any mmap-offset generated pointer for our invalid pointers, not just gem_map__gtt, as the crucial part is the faulthandler vs revocation and is the same for all mmap-offsets. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-01-14i915/gem_ctx_engine: Skip redundant clear of a fresh bufferChris Wilson
No need to memset(0) the mapping of a fresh buffer, as we expect it to be 0 already. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chuansheng Liu <chuansheng.liu@intel.com>
2019-12-07i915/gem_ctx_engines: Use an offset hint to avoid overlapChris Wilson
As Braswell is using aliasing-ppgtt, softpinning is trick as we have to avoid overlapping with HW objects in the GGTT (like context images). Typically allocations are from either end, so if we provide a hint to use the middle, we should be safe from overlap. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2019-08-19i915/gem_ctx_engine: Scheduler required for reordering requestsChris Wilson
To run the independent subtests requires to issue the requests not-in-submission order, we need a scheduler. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2019-08-13i915/gem_ctx_engine: Drip feed requests into 'independent'Chris Wilson
The intent of the test is to exercise that each channel in the engine[] is an independent context/ring/timeline. It setups 64 channels pointing to rcs0 and then submits one request to each in turn waiting on a timeline that will force them to run out of submission order. They can only run in fence order and not submission order if the timelines of each channel are truly independent. However, we released the fences en masse, and once the requests are ready they are independent and may be executed in any order by the HW, especially true with timeslicing that may reorder the requests on a whim. So instead of releasing all requests at once, increment the timeline step by step and check we get our results advancing. If the requests can not be run in fence order and fall back to submission order, we will time out waiting for our incremental results and trigger a few GPU hangs. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110987 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Andi Shyti <andi.shyti@intel.com>
2019-06-19i915/gem_ctx_engines: Prevent preemptionChris Wilson
In order to pin the engine as busy, we have to prevent the kernel from executing other independent work ahead of our plug, so tell the spinner to not allow preemption. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
2019-06-10i915/gem_ctx_engines: Skip trying to read a non-existent TIMESTAMPChris Wilson
The per-engine TIMESTAMP (at least at the offset I know about) only came into being with gen6. So skip the test on older gen as the results are garbage. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=110874 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2019-06-04i915: Add gem_ctx_enginesChris Wilson
To exercise the new I915_CONTEXT_PARAM_ENGINES and interactions with gem_execbuf(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Cc: Andi Shyti <andi@etezian.org> Reviewed-by: Andi Shyti <andi@etezian.org>