Commit c06ee6ff authored by Tvrtko Ursulin's avatar Tvrtko Ursulin

drm/i915/selftests: Context SSEU reconfiguration tests

Exercise the context image reconfiguration logic for idle and busy
contexts, with the resets thrown into the mix as well.

Free from the uAPI restrictions this test runs on all Gen9+ platforms
with slice power gating.

v2:
 * Rename some helpers for clarity.
 * Include subtest names in error logs.
 * Remove unnecessary function export.

v3:
 * Rebase for RUNTIME_INFO.

v4:
 * Fix incomplete unexport from v2. (Chris Wilson)

v5:
 * Rebased for runtime pm api changes.

v6:
 * Rebased for i915_reset.c.

v7:
 * Tidy checkpatch warnings.
 * Consolidate error checking and logging a bit.
 * Skip idle test phase if something failed before it.

v8:
 (Chris Wilson)
 * Fix i915_request_wait error handling.
 * No need to PIN_HIGH the VMA.
 * Remove pointless GEM_BUG_ON before pointer dereference.

v9:
 * Avoid rq leak if rpcs query fails. (Chris)
Signed-off-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> # v6
Link: https://patchwork.freedesktop.org/patch/msgid/20190205095032.22673-5-tvrtko.ursulin@linux.intel.com
parent e46c2e99
...@@ -1052,23 +1052,19 @@ gen8_modify_rpcs_gpu(struct intel_context *ce, ...@@ -1052,23 +1052,19 @@ gen8_modify_rpcs_gpu(struct intel_context *ce,
} }
static int static int
i915_gem_context_reconfigure_sseu(struct i915_gem_context *ctx, __i915_gem_context_reconfigure_sseu(struct i915_gem_context *ctx,
struct intel_engine_cs *engine, struct intel_engine_cs *engine,
struct intel_sseu sseu) struct intel_sseu sseu)
{ {
struct intel_context *ce = to_intel_context(ctx, engine); struct intel_context *ce = to_intel_context(ctx, engine);
int ret; int ret = 0;
GEM_BUG_ON(INTEL_GEN(ctx->i915) < 8); GEM_BUG_ON(INTEL_GEN(ctx->i915) < 8);
GEM_BUG_ON(engine->id != RCS); GEM_BUG_ON(engine->id != RCS);
ret = mutex_lock_interruptible(&ctx->i915->drm.struct_mutex);
if (ret)
return ret;
/* Nothing to do if unmodified. */ /* Nothing to do if unmodified. */
if (!memcmp(&ce->sseu, &sseu, sizeof(sseu))) if (!memcmp(&ce->sseu, &sseu, sizeof(sseu)))
goto out; return 0;
/* /*
* If context is not idle we have to submit an ordered request to modify * If context is not idle we have to submit an ordered request to modify
...@@ -1081,7 +1077,22 @@ i915_gem_context_reconfigure_sseu(struct i915_gem_context *ctx, ...@@ -1081,7 +1077,22 @@ i915_gem_context_reconfigure_sseu(struct i915_gem_context *ctx,
if (!ret) if (!ret)
ce->sseu = sseu; ce->sseu = sseu;
out: return ret;
}
static int
i915_gem_context_reconfigure_sseu(struct i915_gem_context *ctx,
struct intel_engine_cs *engine,
struct intel_sseu sseu)
{
int ret;
ret = mutex_lock_interruptible(&ctx->i915->drm.struct_mutex);
if (ret)
return ret;
ret = __i915_gem_context_reconfigure_sseu(ctx, engine, sseu);
mutex_unlock(&ctx->i915->drm.struct_mutex); mutex_unlock(&ctx->i915->drm.struct_mutex);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment