Skip to content

Commit

Permalink
drm/i915: Combined gt.awake/gt.power wakerefs
Browse files Browse the repository at this point in the history
As the GT_IRQ power domain implies a wakeref, we can use it inplace of
our existing redundant rpm grab.

v2: Drop papering over forgetting to take the runtime wakeref in
selftests

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190114142129.24398-20-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Jan 14, 2019
1 parent 04161d6 commit 8d761e7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
1 change: 0 additions & 1 deletion drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1985,7 +1985,6 @@ struct drm_i915_private {
* is a slight delay before we do so.
*/
intel_wakeref_t awake;
intel_wakeref_t power;

/**
* The number of times we have woken up.
Expand Down
11 changes: 4 additions & 7 deletions drivers/gpu/drm/i915/i915_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,7 @@ static u32 __i915_gem_park(struct drm_i915_private *i915)
if (INTEL_GEN(i915) >= 6)
gen6_rps_idle(i915);

intel_display_power_put(i915, POWER_DOMAIN_GT_IRQ, i915->gt.power);

intel_runtime_pm_put(i915, wakeref);
intel_display_power_put(i915, POWER_DOMAIN_GT_IRQ, wakeref);

return i915->gt.epoch;
}
Expand All @@ -203,13 +201,11 @@ void i915_gem_unpark(struct drm_i915_private *i915)

lockdep_assert_held(&i915->drm.struct_mutex);
GEM_BUG_ON(!i915->gt.active_requests);
assert_rpm_wakelock_held(i915);

if (i915->gt.awake)
return;

i915->gt.awake = intel_runtime_pm_get_noresume(i915);
GEM_BUG_ON(!i915->gt.awake);

/*
* It seems that the DMC likes to transition between the DC states a lot
* when there are no connected displays (no active power domains) during
Expand All @@ -221,7 +217,8 @@ void i915_gem_unpark(struct drm_i915_private *i915)
* Work around it by grabbing a GT IRQ power domain whilst there is any
* GT activity, preventing any DC state transitions.
*/
i915->gt.power = intel_display_power_get(i915, POWER_DOMAIN_GT_IRQ);
i915->gt.awake = intel_display_power_get(i915, POWER_DOMAIN_GT_IRQ);
GEM_BUG_ON(!i915->gt.awake);

if (unlikely(++i915->gt.epoch == 0)) /* keep 0 as invalid */
i915->gt.epoch = 1;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/intel_lrc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,7 +1045,7 @@ static void execlists_submission_tasklet(unsigned long data)

GEM_TRACE("%s awake?=%d, active=%x\n",
engine->name,
engine->i915->gt.awake,
!!engine->i915->gt.awake,
engine->execlists.active);

spin_lock_irqsave(&engine->timeline.lock, flags);
Expand Down

0 comments on commit 8d761e7

Please sign in to comment.