summaryrefslogtreecommitdiff
path: root/tests/i915/i915_hangman.c
AgeCommit message (Collapse)Author
2022-02-28lib/igt_dummyload: Drop ahnd from igt_spin_tAshutosh Dixit
In 4d9396e67930 we have started storing the opts with which the spin was created as part of igt_spin_t. The ahnd stored as part of igt_spin_t is therefore redundant. We can get ahnd from opts.ahnd. Cc: Zbigniew Kempczynski <zbigniew.kempczynski@intel.com> Cc: Jasmine Newsome <jasmine.newsome@intel.com> Signed-off-by: Ashutosh Dixit <ashutosh.dixit@intel.com> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com>
2022-01-18tests/i915/i915_hangman: Configure engine properties for quicker hangsJohn Harrison
Some platforms have very long timeouts configured for some engines. Some have them disabled completely. That makes for a very slow (or broken) hangman test. So explicitly configure the engines to have reasonable settings first. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2022-01-18tests/i915/i915_hangman: Don't let background contexts cause a banJohn Harrison
The global context used by all the subtests for causing hangs is marked as unbannable. However, some of the subtests set background spinners running on all engines using a freshly created context. If there is a test failure for any reason, all of those spinners can be killed off as hanging contexts. On systems with lots of engines, that can result in the test being banned from creating any new contexts. So make the spinner contexts unbannable as well. That way if one subtest fails it won't necessarily bring down all subsequent subtests. v2: Simplify anti-banning code (review feedback from Matthew Brost). Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2022-01-18tests/i915/i915_hangman: Run background task on all enginesJohn Harrison
As opposed to only on the non-target engines. This means that there is some other workload present for the scheduler to switch between and so detet the hang immediately. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2022-01-18tests/i915/i915_hangman: Remove reliance on context persistanceJohn Harrison
The hang test was relying on context persitence for no particular reason. That is, it would set a bunch of background spinners running then immediately destroy the active contexts but expect the spinners to keep spinning. With the current implementation of context persistence in i915, that means that super high priority pings are sent to each engine at the start of the test. Depending upon the timing and platform, one of those unexpected pings could cause test failures. There is no need to require context persitence in this test. So change to managing the contexts cleanly and only destroying them when they are no longer in use. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2022-01-18tests/i915/i915_hangman: Add alive-ness test after error captureJohn Harrison
Added a an extra step to the i915_hangman tests to check that the system is still alive after the hang and recovery. This submits a simple batch to each engine which does a write to memory and checks that the write occurred. v2: Use _device_coherent instead of _wc for mapping memory to support discrete boards. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2022-01-18lib/store: Refactor common store code into helper functionJohn Harrison
A lot of tests use almost identical code for creating a batch buffer which does a single write to memory and another is about to be added. Instead, move the most generic version into a common helper function. Unfortunately, the other instances are all subtly different enough to make it not so trivial to try to use the helper. It could be done but it is unclear if it is worth the effort at this point. This patch proves the concept, if people like it enough then it can be extended. v2: Fix up object address vs store offset confusion (with help from Zbigniew K). v3: Cope with >32bit store_offset (review feedback from Matthew Brost). Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2022-01-18tests/i915/i915_hangman: Use the correct context in hangcheck_unterminatedJohn Harrison
The hangman framework sets up a context that is valid for all engines and has things like banning disabled. The 'unterminated' test then ignores it and uses the default context. Fix that. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2022-01-18tests/i915/i915_hangman: Add uevent test & fix detectorJohn Harrison
Some of the IGT framework relies on receving a uevent when a hang occurs. So add a test that this actually works. While testing this, noticed that hangs could sometimes be missed because the uevent was (presumably) still in flight by the time the handler was de-registered. So add an extra delay during cleanup to give the uevent chance to arrive. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2022-01-18tests/i915/i915_hangman: Explicitly test per engine reset vs full GPU resetJohn Harrison
Although the hangman test was ensuring that *some* reset functionality was enabled, it did not differentiate what kind. The infrastructure required to choose between per engine reset or full GT reset was recently added. So update this test to use it as well. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2022-01-18tests/i915/i915_hangman: Update capture test to use engine structureJohn Harrison
The capture test was still using old style ring_id and ring_name (derived from the engine structure at the higher level). Update it to just take the engine structure directly. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2022-01-18lib/hang: Fix igt_require_hang_ring to work with all enginesJohn Harrison
The above function was checking for valid rings via the old interface. The new scheme is to check for engines on contexts as there are now more engines than could be supported. Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Matthew Brost <matthew.brost@intel.com>
2022-01-18tests/i915/i915_hangman: Add descriptionsJohn Harrison
Added descriptions of the various sub-tests and the test as a whole. v2: Added missing linefeed (spotted by Petri) Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2021-08-10tests/i915_hangman: 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-16i915: Improve the precision of command parser checksJason Ekstrand
The previous gem_has_cmdparser helper took an engine and did nothing with it. We delete the engine parameter and use the general helper for the ALL_ENGINES cases. For cases where we really do care about something more precise, we add a version which takes an intel_ctx_cfg_t and an engine specifier and is able to say whether or not that particular engine has the command parser enabled. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: Lakshminarayana Vudum <lakshminarayana.vudum@intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2021-07-08tests/i915/i915_hangman: Convert to intel_ctx_t (v2)Jason Ekstrand
v2 (Zbigniew Kempczyński): - Don't NULL-init ctx Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Zbigniew Kempczyński <zbigniew.kempczynski@intel.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.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>
2020-12-19i915/i915_hangman: Only check per-engine reset under preemptionChris Wilson
In order for the hangcheck to differentiate between a hanging request and a busy one, we use preemption. So in order for the test to not misidentify the background load as being hung, the HW must support preemption. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-12-19i915/i915_hangman: Verify hangcheck/reset engine independenceChris Wilson
Since Broadwell, we have per-engine resets, which allow the HW to reset on engine independently of another. Verify that the hangcheck only terminates the hanging engine and does not affect any other. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-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-04-06i915/i915_hangman: Drop last reference to bygone 'i915_error_state'Chris Wilson
The test is looking at sysfs/error so dumping the old debugfs/i915_error_state looks quite silly. The only dilemma is whether it is worth replacing with a line-by-line dump. I propose we make that a future problem -- and leave it to whoever has to debug it next time. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Andi Shyti <andi.shyti@intel.com>
2020-04-01i915/i915_hangman: Dynamic active engine testsChris Wilson
Use igt_subtest_with_dynamic for the flexible approach to engine dependent test discovery. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
2020-01-10i915/i915_hangman: Add secondary name for batchbufferChris Wilson
In case we decide we want a more consistent naming scheme, before we go full structured with yaml. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Andi Shyti <andi.shyti@intel.com>
2019-12-03tests/i915: remove igt_skip_on_simulation()Swati Sharma
Removing igt_skip_on_simulation() from all i915 specific tests since this feature is not supported anymore. v2: Rebase Signed-off-by: Swati Sharma <swati2.sharma@intel.com> Signed-off-by: Karthik B S <karthik.b.s@intel.com> Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
2019-10-15i915_hangman: Force error captureChris Wilson
For fast preempt-resets, error capture is skipped, so disable preempt-resets before checking the error state. While thinking ahead, be prepared for when the modparams are not accessible. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Andi Shyti <andi.shyti@intel.com>
2019-05-23lib/dummyload: Cleanup access to spin obj arrayMika Kuoppala
Instead of relying a static obj array inside igt_spin_t, access it with proper indexing. v2: IGT_SPIN_BATCH v3: indent Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Mika Kuoppala <mika.kuoppala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-05-22test/i915: i915_hangman: use the gem_engine_topology libraryAndi Shyti
Replace the legacy for_each_engine* defines with the ones implemented in the gem_engine_topology library. Signed-off-by: Andi Shyti <andi.shyti@intel.com> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2019-03-20lib/igt_sysfs: Remove idx from sysfs_openMichał Winiarski
Similar to sysfs_path - more explicit more better. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2019-02-21igt/drv_hangman: Skip if resets are disallowedChris Wilson
If we tell the machine to reset but they are disallowed, we will leave the system in a wedged state, preventing the majority of subsequent tests. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2019-02-20tests/i915: Rename files so they correspond to binary namesArkadiusz Hiler
So we do not have to do any rename shenanigans in the build system and the .c files are easier to find. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>