Re: [PATCH] drm/i915: Restore the kernel context after a GPU reset on an idle engine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 12/15/2017 4:03 PM, Chris Wilson wrote:
As part of the system requirement for powersaving is that we always have
a context loaded. Upon boot and resume, we load the kernel_context to
ensure that some valid state is set before powersaving kicks in, we
should do so after a full GPU reset as well. We only need to do so for
an idle engine, as any active engines will restart by executing the
stuck request, loading its context, for the idle engine we create a
new request to load the kernel_context instead.

Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
Cc: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>
Cc: Joonas Lahtinen <joonas.lahtinen@xxxxxxxxxxxxxxx>
---
  drivers/gpu/drm/i915/i915_gem.c | 9 +++++++++
  1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 4a7f5579a7a5..189725a8fed6 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3119,6 +3119,15 @@ void i915_gem_reset(struct drm_i915_private *dev_priv)
                 ctx = fetch_and_zero(&engine->last_retired_context);
                 if (ctx)
                         engine->context_unpin(engine, ctx);
+
+               if (list_empty(&engine->timeline->requests)) {
+                       struct drm_i915_gem_request *rq;
+
+                       rq = i915_gem_request_alloc(engine,
+                                                   dev_priv->kernel_context);
+                       if (!IS_ERR(rq))
+                               __i915_add_request(rq, false);
+               }
         }

         i915_gem_restore_fences(dev_priv);

It shouldn't hurt and if it fixes something,

Reviewed-by: Michel Thierry <michel.thierry@xxxxxxxxx>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux