diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-12-02 11:08:35 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-12-02 21:57:22 +0000 |
commit | 61e258ee33328ea8dbd9208ad79d281693d5e0e4 (patch) | |
tree | 72e0b63461c7e16b86691c97ad9daba58a667d33 /drivers/gpu/drm/i915/gt/intel_rc6.c | |
parent | 98cf5c9a482d975b91d2cf00e09c061b535b8ee4 (diff) | |
download | linux-61e258ee33328ea8dbd9208ad79d281693d5e0e4.tar.gz |
drm/i915/gt: Use soft-rc6 for w/a protection
Now that we have soft-rc6 in place, we can use that instead of the
forcewake to disable rc6 while active; preferred by a few
microbenchmarks.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Andi Shyti <andi.shyti@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191202110836.2342685-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gt/intel_rc6.c')
-rw-r--r-- | drivers/gpu/drm/i915/gt/intel_rc6.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/gpu/drm/i915/gt/intel_rc6.c b/drivers/gpu/drm/i915/gt/intel_rc6.c index c4379c49c20d..f58674f4aaec 100644 --- a/drivers/gpu/drm/i915/gt/intel_rc6.c +++ b/drivers/gpu/drm/i915/gt/intel_rc6.c @@ -527,26 +527,25 @@ void intel_rc6_ctx_wa_resume(struct intel_rc6 *rc6) * Check if an RC6 CTX corruption has happened since the last check and if so * disable RC6 and runtime power management. */ -void intel_rc6_ctx_wa_check(struct intel_rc6 *rc6) +static bool intel_rc6_ctx_wa_check(struct intel_rc6 *rc6) { struct drm_i915_private *i915 = rc6_to_i915(rc6); if (!NEEDS_RC6_CTX_CORRUPTION_WA(i915)) - return; + return false; if (rc6->ctx_corrupted) - return; + return false; if (!intel_rc6_ctx_corrupted(rc6)) - return; + return false; dev_notice(i915->drm.dev, "RC6 context corruption, disabling runtime power management\n"); - intel_rc6_disable(rc6); rc6->ctx_corrupted = true; - return; + return true; } static void __intel_rc6_disable(struct intel_rc6 *rc6) @@ -627,6 +626,9 @@ void intel_rc6_enable(struct intel_rc6 *rc6) else if (INTEL_GEN(i915) >= 6) gen6_rc6_enable(rc6); + if (NEEDS_RC6_CTX_CORRUPTION_WA(i915)) + rc6->ctl_enable = 0; + intel_uncore_forcewake_put(uncore, FORCEWAKE_ALL); /* rc6 is ready, runtime-pm is go! */ @@ -652,6 +654,11 @@ void intel_rc6_park(struct intel_rc6 *rc6) if (!rc6->enabled) return; + if (unlikely(intel_rc6_ctx_wa_check(rc6))) { + intel_rc6_disable(rc6); + return; + } + /* Turn off the HW timers and go directly to rc6 */ set(uncore, GEN6_RC_CONTROL, GEN6_RC_CTL_RC6_ENABLE); set(uncore, GEN6_RC_STATE, 0x4 << RC_SW_TARGET_STATE_SHIFT); |