intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH] drm/i915/gt: Be paranoid and reset the GPU before release
@ 2020-01-17 12:58 Chris Wilson
  2020-01-17 17:30 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Chris Wilson @ 2020-01-17 12:58 UTC (permalink / raw)
  To: intel-gfx

Just in the very unlikely case we have not stopped the GPU before we
return the pages being used by the GPU to the system, force a reset.

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

diff --git a/drivers/gpu/drm/i915/gt/intel_engine_cs.c b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
index 2d0ef5fc6748..08c7b49ccdaf 100644
--- a/drivers/gpu/drm/i915/gt/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/gt/intel_engine_cs.c
@@ -392,6 +392,18 @@ void intel_engines_release(struct intel_gt *gt)
 	struct intel_engine_cs *engine;
 	enum intel_engine_id id;
 
+	/*
+	 * Before we release the resources held by engine, we must be certain
+	 * that the HW is no longer accessing them -- having the GPU scribble
+	 * to or read from a page being used for something else causes no end
+	 * of fun.
+	 *
+	 * The GPU should be reset by this point, but assume the worst just
+	 * in case we aborted before completely initialising the engines.
+	 */
+	if (!INTEL_INFO(gt->i915)->gpu_reset_clobbers_display)
+		__intel_gt_reset(gt, ALL_ENGINES);
+
 	/* Decouple the backend; but keep the layout for late GPU resets */
 	for_each_engine(engine, gt, id) {
 		if (!engine->release)
-- 
2.25.0

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

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

end of thread, other threads:[~2020-01-20 19:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-17 12:58 [Intel-gfx] [PATCH] drm/i915/gt: Be paranoid and reset the GPU before release Chris Wilson
2020-01-17 17:30 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2020-01-17 17:30 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
2020-01-17 17:49 ` [Intel-gfx] [PATCH] " Matthew Auld
2020-01-17 18:03 ` Chris Wilson
2020-01-18  2:04 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/gt: Be paranoid and reset the GPU before release (rev2) Patchwork
2020-01-18  2:04 ` [Intel-gfx] ✗ Fi.CI.BUILD: warning " Patchwork
2020-01-20 19:37 ` [Intel-gfx] ✓ Fi.CI.IGT: success " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).