@@ -1076,6 +1076,19 @@ eb_get_batch(struct eb_vmas *eb)
return vma->obj;
}
+static bool
+intel_ring_valid(struct intel_engine_cs *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);
+ case VCS2: return HAS_BSD2(ring->dev);
+ default: return false;
+ }
+}
+
static int
i915_gem_do_execbuffer(struct drm_device *dev, void *data,
struct drm_file *file,
@@ -1133,7 +1146,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;