drm/i915: don't allow tiling changes on pinned buffers v2
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 23 Apr 2010 21:01:01 +0000 (23:01 +0200)
committerEric Anholt <eric@anholt.net>
Mon, 10 May 2010 20:38:30 +0000 (13:38 -0700)
Makes no sense and complicates matters for pipelined tiling changes.
So don't allow it and return -EBUSY.

v2: Fix reference leak. Thanks to Owain Ainsworth for spotting this.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Eric Anholt <eric@anholt.net>
drivers/gpu/drm/i915/i915_gem_tiling.c

index 4bdccefcf2cf7b5f9733b00971f75dfa26b10505..4b7c49d4257d3de8d938680280762e1b2e1e4ab6 100644 (file)
@@ -283,6 +283,11 @@ i915_gem_set_tiling(struct drm_device *dev, void *data,
                return -EINVAL;
        }
 
+       if (obj_priv->pin_count) {
+               drm_gem_object_unreference_unlocked(obj);
+               return -EBUSY;
+       }
+
        if (args->tiling_mode == I915_TILING_NONE) {
                args->swizzle_mode = I915_BIT_6_SWIZZLE_NONE;
                args->stride = 0;