To avoid context corruption on some gens, we need to hold forcewake for long periods of time. This leads to increased energy expenditure for mostly idle workloads. To combat the increased power consumption, park GPU more hastily. As the HW isn't so quick to end up in rc6, this software mechanism supplements it. So we can apply it, across all gens. Suggested-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Testcase: igt/i915_pm_rc6_residency/rc6-idle References: "Add RC6 CTX corruption WA" Cc: Stable <stable@xxxxxxxxxxxxxxx> # v4.19+ Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> Signed-off-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx> --- drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/intel_lrc.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index c7d05ac7af3c..6ddc75098b28 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -197,7 +197,7 @@ void i915_gem_park(struct drm_i915_private *i915) return; /* Defer the actual call to __i915_gem_park() to prevent ping-pongs */ - mod_delayed_work(i915->wq, &i915->gt.idle_work, msecs_to_jiffies(100)); + mod_delayed_work(i915->wq, &i915->gt.idle_work, 1); } void i915_gem_unpark(struct drm_i915_private *i915) diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 13e97faabaa7..284ffdfd8840 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -388,7 +388,12 @@ execlists_user_begin(struct intel_engine_execlists *execlists, inline void execlists_user_end(struct intel_engine_execlists *execlists) { + struct intel_engine_cs *engine = + container_of(execlists, typeof(*engine), execlists); + execlists_clear_active(execlists, EXECLISTS_ACTIVE_USER); + + mod_delayed_work(engine->i915->wq, &engine->i915->gt.retire_work, 0); } static inline void -- 2.17.1