drm/i915: Catch abuse of I915_EXEC_GEN7_SOL_RESET
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 24 Apr 2014 06:09:09 +0000 (08:09 +0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Mon, 5 May 2014 07:08:41 +0000 (09:08 +0200)
Currently we catch it, but silently succeed. Our userspace is
better than this.

v2: Add DRM_DEBUG (Chris)

Testcase: igt/gem_exec_params/sol-reset-*
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_gem_execbuffer.c

index 0ec8621eb4f8545f9e6f809d9858d3089370a33c..04102cc80ef483edf12854b23fd77926d23d33b2 100644 (file)
@@ -981,8 +981,10 @@ i915_reset_gen7_sol_offsets(struct drm_device *dev,
        struct drm_i915_private *dev_priv = dev->dev_private;
        int ret, i;
 
-       if (!IS_GEN7(dev) || ring != &dev_priv->ring[RCS])
-               return 0;
+       if (!IS_GEN7(dev) || ring != &dev_priv->ring[RCS]) {
+               DRM_DEBUG("sol reset is gen7/rcs only\n");
+               return -EINVAL;
+       }
 
        ret = intel_ring_begin(ring, 4 * 3);
        if (ret)