From: Daniel Vetter Subject: [PATCH] drm/i915: don't allow tiling changes on pinned buffers v2 Date: Fri, 23 Apr 2010 23:01:01 +0200 Message-ID: <1272056461-7841-1-git-send-email-daniel.vetter@ffwll.ch> References: <20100423173408.GL13925@stephanie.nicotinebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from localhost.localdomain (cable-static-49-187.intergga.ch [157.161.49.187]) by gabe.freedesktop.org (Postfix) with ESMTP id C27629E709 for ; Fri, 23 Apr 2010 14:00:11 -0700 (PDT) In-Reply-To: <20100423173408.GL13925@stephanie.nicotinebsd.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org To: Eric Anholt Cc: Daniel Vetter , intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org 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 --- drivers/gpu/drm/i915/i915_gem_tiling.c | 5 +++++ 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index 449157f..4aed1f3 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c @@ -287,6 +287,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; -- 1.6.6.1