Commit a168b2d8 authored by Chris Wilson's avatar Chris Wilson

drm/i915: Mark all default contexts as uninitialised after context loss

When the GPU is reset or state lost through suspend, every default
legacy context needs to reload their state - both the golden render
state and the L3 mapping. Only context images explicitly saved to memory
(i.e. all execlists and non-default legacy contexts) will retain their
state across the reset.

v2: Rebase
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarJoonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466776558-21516-4-git-send-email-chris@chris-wilson.co.uk
parent c7c3c07d
...@@ -476,6 +476,18 @@ void i915_gem_context_lost(struct drm_i915_private *dev_priv) ...@@ -476,6 +476,18 @@ void i915_gem_context_lost(struct drm_i915_private *dev_priv)
/* Force the GPU state to be restored on enabling */ /* Force the GPU state to be restored on enabling */
if (!i915.enable_execlists) { if (!i915.enable_execlists) {
struct i915_gem_context *ctx;
list_for_each_entry(ctx, &dev_priv->context_list, link) {
if (!i915_gem_context_is_default(ctx))
continue;
for_each_engine(engine, dev_priv)
ctx->engine[engine->id].initialised = false;
ctx->remap_slice = ALL_L3_SLICES(dev_priv);
}
for_each_engine(engine, dev_priv) { for_each_engine(engine, dev_priv) {
struct intel_context *kce = struct intel_context *kce =
&dev_priv->kernel_context->engine[engine->id]; &dev_priv->kernel_context->engine[engine->id];
...@@ -483,7 +495,6 @@ void i915_gem_context_lost(struct drm_i915_private *dev_priv) ...@@ -483,7 +495,6 @@ void i915_gem_context_lost(struct drm_i915_private *dev_priv)
kce->initialised = true; kce->initialised = true;
} }
} }
dev_priv->kernel_context->remap_slice = ALL_L3_SLICES(dev_priv);
} }
void i915_gem_context_fini(struct drm_device *dev) void i915_gem_context_fini(struct drm_device *dev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment