Skip to content

Commit c06ee6f

Browse files
committed
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: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Chris 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
1 parent e46c2e9 commit c06ee6f

File tree

2 files changed

+488
-10
lines changed

2 files changed

+488
-10
lines changed

drivers/gpu/drm/i915/i915_gem_context.c

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,23 +1052,19 @@ gen8_modify_rpcs_gpu(struct intel_context *ce,
10521052
}
10531053

10541054
static int
1055-
i915_gem_context_reconfigure_sseu(struct i915_gem_context *ctx,
1056-
struct intel_engine_cs *engine,
1057-
struct intel_sseu sseu)
1055+
__i915_gem_context_reconfigure_sseu(struct i915_gem_context *ctx,
1056+
struct intel_engine_cs *engine,
1057+
struct intel_sseu sseu)
10581058
{
10591059
struct intel_context *ce = to_intel_context(ctx, engine);
1060-
int ret;
1060+
int ret = 0;
10611061

10621062
GEM_BUG_ON(INTEL_GEN(ctx->i915) < 8);
10631063
GEM_BUG_ON(engine->id != RCS);
10641064

1065-
ret = mutex_lock_interruptible(&ctx->i915->drm.struct_mutex);
1066-
if (ret)
1067-
return ret;
1068-
10691065
/* Nothing to do if unmodified. */
10701066
if (!memcmp(&ce->sseu, &sseu, sizeof(sseu)))
1071-
goto out;
1067+
return 0;
10721068

10731069
/*
10741070
* 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,
10811077
if (!ret)
10821078
ce->sseu = sseu;
10831079

1084-
out:
1080+
return ret;
1081+
}
1082+
1083+
static int
1084+
i915_gem_context_reconfigure_sseu(struct i915_gem_context *ctx,
1085+
struct intel_engine_cs *engine,
1086+
struct intel_sseu sseu)
1087+
{
1088+
int ret;
1089+
1090+
ret = mutex_lock_interruptible(&ctx->i915->drm.struct_mutex);
1091+
if (ret)
1092+
return ret;
1093+
1094+
ret = __i915_gem_context_reconfigure_sseu(ctx, engine, sseu);
1095+
10851096
mutex_unlock(&ctx->i915->drm.struct_mutex);
10861097

10871098
return ret;

0 commit comments

Comments
 (0)