summaryrefslogtreecommitdiff
path: root/tests/i915/i915_hangman.c
diff options
context:
space:
mode:
authorJohn Harrison <John.C.Harrison@Intel.com>2022-01-14 10:17:09 -0800
committerAshutosh Dixit <ashutosh.dixit@intel.com>2022-01-18 12:43:38 -0800
commit8933490dab079e6fbb4e61452a733b50a8141a5f (patch)
treec0208b2ed0cc61fd99aefbd80bcb4a0334680789 /tests/i915/i915_hangman.c
parent8d45b02048f9e1b5a4bf05c95dbc71628a95b316 (diff)
tests/i915/i915_hangman: Don't let background contexts cause a ban
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>
Diffstat (limited to 'tests/i915/i915_hangman.c')
-rw-r--r--tests/i915/i915_hangman.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/i915/i915_hangman.c b/tests/i915/i915_hangman.c
index a1aeeba6..e661b8ad 100644
--- a/tests/i915/i915_hangman.c
+++ b/tests/i915/i915_hangman.c
@@ -284,6 +284,17 @@ static void test_error_state_capture(const intel_ctx_t *ctx,
check_alive();
}
+static void context_unban(int fd, unsigned ctx)
+{
+ struct drm_i915_gem_context_param param = {
+ .ctx_id = ctx,
+ .param = I915_CONTEXT_PARAM_BANNABLE,
+ .value = 0,
+ };
+
+ gem_context_set_param(fd, &param);
+}
+
static void
test_engine_hang(const intel_ctx_t *ctx,
const struct intel_execution_engine2 *e, unsigned int flags)
@@ -307,6 +318,7 @@ test_engine_hang(const intel_ctx_t *ctx,
num_ctx = 0;
for_each_ctx_engine(device, ctx, other) {
local_ctx[num_ctx] = intel_ctx_create(device, &ctx->cfg);
+ context_unban(device, local_ctx[num_ctx]->id);
ahndN = get_reloc_ahnd(device, local_ctx[num_ctx]->id);
spin = __igt_spin_new(device,
.ahnd = ahndN,