Commit a15817cf authored by Chris Wilson's avatar Chris Wilson Committed by Daniel Vetter

drm/i915: Check whether the ring is initialised prior to dispatch

Rather than use the magic feature tests HAS_BLT/HAS_BSD just check
whether the ring we are about to dispatch the execbuffer on is
initialised.

v2: Use intel_ring_initialized()
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarBen Widawsky <ben@bwidawsk.net>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent b4519513
...@@ -1064,17 +1064,9 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, ...@@ -1064,17 +1064,9 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
ring = &dev_priv->ring[RCS]; ring = &dev_priv->ring[RCS];
break; break;
case I915_EXEC_BSD: case I915_EXEC_BSD:
if (!HAS_BSD(dev)) {
DRM_DEBUG("execbuf with invalid ring (BSD)\n");
return -EINVAL;
}
ring = &dev_priv->ring[VCS]; ring = &dev_priv->ring[VCS];
break; break;
case I915_EXEC_BLT: case I915_EXEC_BLT:
if (!HAS_BLT(dev)) {
DRM_DEBUG("execbuf with invalid ring (BLT)\n");
return -EINVAL;
}
ring = &dev_priv->ring[BCS]; ring = &dev_priv->ring[BCS];
break; break;
default: default:
...@@ -1082,6 +1074,11 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data, ...@@ -1082,6 +1074,11 @@ i915_gem_do_execbuffer(struct drm_device *dev, void *data,
(int)(args->flags & I915_EXEC_RING_MASK)); (int)(args->flags & I915_EXEC_RING_MASK));
return -EINVAL; return -EINVAL;
} }
if (!intel_ring_initialized(ring)) {
DRM_DEBUG("execbuf with invalid ring: %d\n",
(int)(args->flags & I915_EXEC_RING_MASK));
return -EINVAL;
}
mode = args->flags & I915_EXEC_CONSTANTS_MASK; mode = args->flags & I915_EXEC_CONSTANTS_MASK;
mask = I915_EXEC_CONSTANTS_MASK; mask = I915_EXEC_CONSTANTS_MASK;
......
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