[Intel-gfx] [PATCH] drm/i915: Upgrade execbuffer fail after resume failure to EIO
Chris Wilson
chris at chris-wilson.co.uk
Tue Mar 25 09:03:28 CET 2014
If we try to execute on a known ring, but it has failed to be
initialised correctly, report that the GPU is hung rather than the
command invalid. This leaves us reporting EINVAL only if the user
requests execution on a ring that is not supported by the device.
This should prevent UXA from getting stuck in a null render loop after a
failed resume.
Reported-by: Jiri Kosina <jikos at jikos.cz>
References: https://bugs.freedesktop.org/show_bug.cgi?id=76554
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
drivers/gpu/drm/i915/i915_gem_execbuffer.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
index 1b45163e19f3..22c650490f54 100644
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
@@ -991,6 +991,18 @@ i915_reset_gen7_sol_offsets(struct drm_device *dev,
return 0;
}
+static bool
+intel_ring_valid(struct intel_ring_buffer *ring)
+{
+ switch (ring->id) {
+ case RCS: return true;
+ case VCS: return HAS_BSD(ring->dev);
+ case BCS: return HAS_BLT(ring->dev);
+ case VECS: return HAS_VEBOX(ring->dev);
+ default: return false;
+ }
+}
+
static int
i915_gem_do_execbuffer(struct drm_device *dev, void *data,
struct drm_file *file,
@@ -1041,7 +1053,7 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
if (!intel_ring_initialized(ring)) {
DRM_DEBUG("execbuf with invalid ring: %d\n",
(int)(args->flags & I915_EXEC_RING_MASK));
- return -EINVAL;
+ return intel_ring_valid(ring) ? -EIO : -EINVAL;
}
mode = args->flags & I915_EXEC_CONSTANTS_MASK;
--
1.9.1
More information about the Intel-gfx
mailing list