drm/i915: Set guilty-flag on fence after detecting a hang
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 10 Jan 2017 17:22:43 +0000 (17:22 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 10 Jan 2017 20:49:30 +0000 (20:49 +0000)
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
SYNC_IOC_FILE_INFO).

v2: Mark all cancelled requests as failed.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170110172246.27297-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem.c

index fb2433175a3d80c46a6f734ddd694fe4b2c996a3..324a4981366865686a50a0dde71065cde3fec96a 100644 (file)
@@ -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)