summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_gem.c
diff options
context:
space:
mode:
authorMika Kuoppala2017-01-17 16:59:07 +0100
committerChris Wilson2017-01-18 11:47:32 +0100
commit71895a085879d7bc490611994c7efb156162f33d (patch)
tree9a4f3ab1f189d97b7a20a443ed4f75d1ba2faa76 /drivers/gpu/drm/i915/i915_gem.c
parentdrm/i915: Detect a failed GPU reset+recovery (diff)
downloadkernel-qcow2-linux-71895a085879d7bc490611994c7efb156162f33d.tar.gz
kernel-qcow2-linux-71895a085879d7bc490611994c7efb156162f33d.tar.xz
kernel-qcow2-linux-71895a085879d7bc490611994c7efb156162f33d.zip
drm/i915: Add comment how we treat hung contexts
Explain in a comment how and why we treat hung context like we do. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1484668747-9120-7-git-send-email-mika.kuoppala@intel.com Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem.c')
-rw-r--r--drivers/gpu/drm/i915/i915_gem.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index 3e10e8101014..d6ec63997ca3 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2697,6 +2697,27 @@ static bool i915_gem_reset_request(struct drm_i915_gem_request *request)
/* Read once and return the resolution */
const bool guilty = engine_stalled(request->engine);
+ /* The guilty request will get skipped on a hung engine.
+ *
+ * Users of client default contexts do not rely on logical
+ * state preserved between batches so it is safe to execute
+ * queued requests following the hang. Non default contexts
+ * rely on preserved state, so skipping a batch loses the
+ * evolution of the state and it needs to be considered corrupted.
+ * Executing more queued batches on top of corrupted state is
+ * risky. But we take the risk by trying to advance through
+ * the queued requests in order to make the client behaviour
+ * more predictable around resets, by not throwing away random
+ * amount of batches it has prepared for execution. Sophisticated
+ * clients can use gem_reset_stats_ioctl and dma fence status
+ * (exported via sync_file info ioctl on explicit fences) to observe
+ * when it loses the context state and should rebuild accordingly.
+ *
+ * The context ban, and ultimately the client ban, mechanism are safety
+ * valves if client submission ends up resulting in nothing more than
+ * subsequent hangs.
+ */
+
if (guilty) {
i915_gem_context_mark_guilty(request->ctx);
skip_request(request);