diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-10-04 16:40:03 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-10-04 17:39:22 +0300 |
commit | 33d856445b3ef6f00466cd9fbb04d69061143077 (patch) | |
tree | f0981415c29aaa2d4577890777015c529e4c7cb8 /drivers/gpu/drm/i915/gem/i915_gem_pm.c | |
parent | 7e8057626640cfedbae000c5032be32269713687 (diff) | |
download | linux-33d856445b3ef6f00466cd9fbb04d69061143077.tar.xz |
drm/i915: Remove the GEM idle worker
Nothing inside the idle worker now requires struct_mutex, so we can
remove the indirection of using our own worker.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191004134015.13204-9-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/gem/i915_gem_pm.c')
-rw-r--r-- | drivers/gpu/drm/i915/gem/i915_gem_pm.c | 28 |
1 files changed, 2 insertions, 26 deletions
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_pm.c b/drivers/gpu/drm/i915/gem/i915_gem_pm.c index 2ddc3aeaac9d..26f325bbfe4d 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_pm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_pm.c @@ -13,36 +13,13 @@ static void i915_gem_park(struct drm_i915_private *i915) { - lockdep_assert_held(&i915->drm.struct_mutex); + cancel_delayed_work(&i915->gem.retire_work); i915_vma_parked(i915); i915_globals_park(); } -static void idle_work_handler(struct work_struct *work) -{ - struct drm_i915_private *i915 = - container_of(work, typeof(*i915), gem.idle_work); - bool park; - - cancel_delayed_work_sync(&i915->gem.retire_work); - mutex_lock(&i915->drm.struct_mutex); - - intel_wakeref_lock(&i915->gt.wakeref); - park = (!intel_wakeref_is_active(&i915->gt.wakeref) && - !work_pending(work)); - intel_wakeref_unlock(&i915->gt.wakeref); - if (park) - i915_gem_park(i915); - else - queue_delayed_work(i915->wq, - &i915->gem.retire_work, - round_jiffies_up_relative(HZ)); - - mutex_unlock(&i915->drm.struct_mutex); -} - static void retire_work_handler(struct work_struct *work) { struct drm_i915_private *i915 = @@ -71,7 +48,7 @@ static int pm_notifier(struct notifier_block *nb, break; case INTEL_GT_PARK: - queue_work(i915->wq, &i915->gem.idle_work); + i915_gem_park(i915); break; } @@ -264,7 +241,6 @@ err_wedged: void i915_gem_init__pm(struct drm_i915_private *i915) { - INIT_WORK(&i915->gem.idle_work, idle_work_handler); INIT_DELAYED_WORK(&i915->gem.retire_work, retire_work_handler); i915->gem.pm_notifier.notifier_call = pm_notifier; |