Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/6] drm/i915/gt: Sanitize GPU during prepare-to-suspend
@ 2021-02-10 22:19 Chris Wilson
  2021-02-10 22:19 ` [Intel-gfx] [PATCH 2/6] drm/i915: Clear internal GT state on hibernate Chris Wilson
                   ` (8 more replies)
  0 siblings, 9 replies; 13+ messages in thread
From: Chris Wilson @ 2021-02-10 22:19 UTC (permalink / raw)
  To: intel-gfx; +Cc: Chris Wilson

After calling intel_gt_suspend_prepare(), the driver starts to turn off
various subsystems, such as clearing the GGTT, before calling
intel_gt_suspend_late() to relinquish control over the GT. However, if
we still have internal GPU state active as we clear the GGTT, the GPU
may write back its internal state to the residual GGTT addresses that
are now pointing into scratch. Let's reset the GPU to clear that
internal state as soon we have idled the GPU in prepare-to-suspend.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm.c b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
index 0bd303d2823e..f41612faa269 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm.c
@@ -295,6 +295,9 @@ void intel_gt_suspend_prepare(struct intel_gt *gt)
 	wait_for_suspend(gt);
 
 	intel_uc_suspend(&gt->uc);
+
+	/* Flush all the contexts and internal state before turning off GGTT */
+	gt_sanitize(gt, false);
 }
 
 static suspend_state_t pm_suspend_target(void)
@@ -337,7 +340,7 @@ void intel_gt_suspend_late(struct intel_gt *gt)
 		intel_llc_disable(&gt->llc);
 	}
 
-	gt_sanitize(gt, false);
+	gt_sanitize(gt, false); /* Be paranoid, remove all residual GPU state */
 
 	GT_TRACE(gt, "\n");
 }
-- 
2.20.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2021-02-11 13:09 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-10 22:19 [Intel-gfx] [PATCH 1/6] drm/i915/gt: Sanitize GPU during prepare-to-suspend Chris Wilson
2021-02-10 22:19 ` [Intel-gfx] [PATCH 2/6] drm/i915: Clear internal GT state on hibernate Chris Wilson
2021-02-11  4:28   ` Rodrigo Vivi
2021-02-11  8:46     ` Chris Wilson
2021-02-10 22:19 ` [Intel-gfx] [PATCH 3/6] drm/i915/selftests: Declare suspend_state before testing suspend Chris Wilson
2021-02-10 22:19 ` [Intel-gfx] [PATCH 4/6] drm/i915/selftests: Restrict partial-tiling to write into the object Chris Wilson
2021-02-10 22:19 ` [Intel-gfx] [PATCH 5/6] drm/i915: Check for scratch page scribbling Chris Wilson
2021-02-10 22:19 ` [Intel-gfx] [PATCH 6/6] drm/i915: Remove unused debug functions Chris Wilson
2021-02-10 23:06 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/6] drm/i915/gt: Sanitize GPU during prepare-to-suspend Patchwork
2021-02-10 23:34 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-02-11  4:25 ` [Intel-gfx] [PATCH 1/6] " Rodrigo Vivi
2021-02-11  8:57   ` Chris Wilson
2021-02-11 13:09 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [1/6] " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox