From: Daniel Vetter Date: Fri, 23 Apr 2010 21:01:01 +0000 (+0200) Subject: drm/i915: don't allow tiling changes on pinned buffers v2 X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=31770bd49ab157c5639043ad7541c3e0c83afcc4;p=openwrt%2Fstaging%2Fblogic.git drm/i915: don't allow tiling changes on pinned buffers v2 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 Signed-off-by: Eric Anholt --- diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index 4bdccefcf2cf..4b7c49d4257d 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c @@ -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;