Skip to content

Commit

Permalink
drm/i915/selftests: verify_gt_engine_wa() needs rpm wakeref
Browse files Browse the repository at this point in the history
The mmio readback for verify_gt_engine_wa() also needs a runtime-pm
wakeref, so effectively do the entirety of both engine workarounds
tests. As such simplify the rpm behaviour here by acquiring the wakeref
for the whole of each subtest. It would be still useful to later verify
the registers retain their magic values across rpm suspend/resume.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181206180713.6827-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Dec 6, 2018
1 parent 7e90e8d commit 3abd614
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions drivers/gpu/drm/i915/selftests/intel_workarounds.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,6 @@ static bool verify_gt_engine_wa(struct drm_i915_private *i915, const char *str)
bool ok = true;

ok &= intel_gt_verify_workarounds(i915, str);

for_each_engine(engine, i915, id)
ok &= intel_engine_verify_workarounds(engine, str);

Expand All @@ -353,19 +352,19 @@ live_gpu_reset_gt_engine_workarounds(void *arg)
pr_info("Verifying after GPU reset...\n");

igt_global_reset_lock(i915);
intel_runtime_pm_get(i915);

ok = verify_gt_engine_wa(i915, "before reset");
if (!ok)
goto out;

intel_runtime_pm_get(i915);
set_bit(I915_RESET_HANDOFF, &error->flags);
i915_reset(i915, ALL_ENGINES, "live_workarounds");
intel_runtime_pm_put(i915);

ok = verify_gt_engine_wa(i915, "after reset");

out:
intel_runtime_pm_put(i915);
igt_global_reset_unlock(i915);

return ok ? 0 : -ESRCH;
Expand All @@ -390,6 +389,7 @@ live_engine_reset_gt_engine_workarounds(void *arg)
return PTR_ERR(ctx);

igt_global_reset_lock(i915);
intel_runtime_pm_get(i915);

for_each_engine(engine, i915, id) {
bool ok;
Expand All @@ -402,9 +402,7 @@ live_engine_reset_gt_engine_workarounds(void *arg)
goto err;
}

intel_runtime_pm_get(i915);
i915_reset_engine(engine, "live_workarounds");
intel_runtime_pm_put(i915);

ok = verify_gt_engine_wa(i915, "after idle reset");
if (!ok) {
Expand All @@ -416,13 +414,10 @@ live_engine_reset_gt_engine_workarounds(void *arg)
if (ret)
goto err;

intel_runtime_pm_get(i915);

rq = igt_spinner_create_request(&spin, ctx, engine, MI_NOOP);
if (IS_ERR(rq)) {
ret = PTR_ERR(rq);
igt_spinner_fini(&spin);
intel_runtime_pm_put(i915);
goto err;
}

Expand All @@ -431,15 +426,12 @@ live_engine_reset_gt_engine_workarounds(void *arg)
if (!igt_wait_for_spinner(&spin, rq)) {
pr_err("Spinner failed to start\n");
igt_spinner_fini(&spin);
intel_runtime_pm_put(i915);
ret = -ETIMEDOUT;
goto err;
}

i915_reset_engine(engine, "live_workarounds");

intel_runtime_pm_put(i915);

igt_spinner_end(&spin);
igt_spinner_fini(&spin);

Expand All @@ -451,6 +443,7 @@ live_engine_reset_gt_engine_workarounds(void *arg)
}

err:
intel_runtime_pm_put(i915);
igt_global_reset_unlock(i915);
kernel_context_close(ctx);

Expand Down

0 comments on commit 3abd614

Please sign in to comment.