[Intel-gfx] [PATCH 2/5] drm/i915: Set guilty-flag on fence after detecting a hang

Chris Wilson chris at chris-wilson.co.uk
Tue Jan 10 10:27:37 UTC 2017

The struct dma_fence carries a status field exposed to userspace by
sync_file. This is inspected after the fence is signaled and can convey
whether or not the request completed successfully, or in our case if we
detected a hang during the request (signaled via -EIO in

v2: Mark all cancelled requests as failed.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
Cc: Mika Kuoppala <mika.kuoppala at linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin at intel.com>
 drivers/gpu/drm/i915/i915_gem.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index fb2433175a3d..324a49813668 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2626,6 +2626,8 @@ static void reset_request(struct drm_i915_gem_request *request)
 		head = 0;
 	memset(vaddr + head, 0, request->postfix - head);
+	dma_fence_set_error(&request->fence, -EIO);
 void i915_gem_reset_prepare(struct drm_i915_private *dev_priv)

More information about the Intel-gfx mailing list