]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: Make GEM suspend all GTs
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Thu, 15 Sep 2022 23:26:53 +0000 (16:26 -0700)
committerMatt Roper <matthew.d.roper@intel.com>
Fri, 16 Sep 2022 14:57:20 +0000 (07:57 -0700)
Walk all GTs when suspending.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220915232654.3283095-4-matthew.d.roper@intel.com
drivers/gpu/drm/i915/gem/i915_gem_pm.c

index 2c80cc8362b60d861d35b85cb20d2912d7482b9f..e5bfb6be9f7a4d0488043178532b5a9cba62bccd 100644 (file)
@@ -22,6 +22,9 @@
 
 void i915_gem_suspend(struct drm_i915_private *i915)
 {
+       struct intel_gt *gt;
+       unsigned int i;
+
        GEM_TRACE("%s\n", dev_name(i915->drm.dev));
 
        intel_wakeref_auto(&to_gt(i915)->userfault_wakeref, 0);
@@ -36,7 +39,8 @@ void i915_gem_suspend(struct drm_i915_private *i915)
         * state. Fortunately, the kernel_context is disposable and we do
         * not rely on its state.
         */
-       intel_gt_suspend_prepare(to_gt(i915));
+       for_each_gt(gt, i915, i)
+               intel_gt_suspend_prepare(gt);
 
        i915_gem_drain_freed_objects(i915);
 }
@@ -131,7 +135,9 @@ void i915_gem_suspend_late(struct drm_i915_private *i915)
                &i915->mm.purge_list,
                NULL
        }, **phase;
+       struct intel_gt *gt;
        unsigned long flags;
+       unsigned int i;
        bool flush = false;
 
        /*
@@ -154,7 +160,8 @@ void i915_gem_suspend_late(struct drm_i915_private *i915)
         * machine in an unusable condition.
         */
 
-       intel_gt_suspend_late(to_gt(i915));
+       for_each_gt(gt, i915, i)
+               intel_gt_suspend_late(gt);
 
        spin_lock_irqsave(&i915->mm.obj_lock, flags);
        for (phase = phases; *phase; phase++) {