drm/i915: Cleanup gt powerstate from gem
authorChris Wilson <chris@chris-wilson.co.uk>
Sun, 12 Aug 2018 22:36:29 +0000 (23:36 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 13 Aug 2018 20:20:03 +0000 (21:20 +0100)
Since the gt powerstate is allocated by i915_gem_init, clean it from
i915_gem_fini for symmetry and to correct the imbalance on error.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180812223642.24865-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem.c
drivers/gpu/drm/i915/intel_display.c

index 71502512ac1f0b6fae2464a930fc294ab9034e60..0453eb42a1a3a87ea43ed4b4160a9d9d3dd2f548 100644 (file)
@@ -5634,6 +5634,7 @@ err_uc_misc:
 void i915_gem_fini(struct drm_i915_private *dev_priv)
 {
        i915_gem_suspend_late(dev_priv);
+       intel_disable_gt_powersave(dev_priv);
 
        /* Flush any outstanding unpin_work. */
        i915_gem_drain_workqueue(dev_priv);
@@ -5645,6 +5646,8 @@ void i915_gem_fini(struct drm_i915_private *dev_priv)
        i915_gem_contexts_fini(dev_priv);
        mutex_unlock(&dev_priv->drm.struct_mutex);
 
+       intel_cleanup_gt_powersave(dev_priv);
+
        intel_uc_fini_misc(dev_priv);
        i915_gem_cleanup_userptr(dev_priv);
 
index 366ff66e927958e4534cf391b50a4922a958f557..5138a921e0b5ff9971e76bb5b0de941215aafc31 100644 (file)
@@ -15991,8 +15991,6 @@ void intel_modeset_cleanup(struct drm_device *dev)
        flush_work(&dev_priv->atomic_helper.free_work);
        WARN_ON(!llist_empty(&dev_priv->atomic_helper.free_list));
 
-       intel_disable_gt_powersave(dev_priv);
-
        /*
         * Interrupts and polling as the first thing to avoid creating havoc.
         * Too much stuff here (turning of connectors, ...) would
@@ -16020,8 +16018,6 @@ void intel_modeset_cleanup(struct drm_device *dev)
 
        intel_cleanup_overlay(dev_priv);
 
-       intel_cleanup_gt_powersave(dev_priv);
-
        intel_teardown_gmbus(dev_priv);
 
        destroy_workqueue(dev_priv->modeset_wq);