From patchwork Thu Mar 18 08:22:12 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 86613 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2I8MTRF011398 for ; Thu, 18 Mar 2010 08:23:05 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2DE179E838; Thu, 18 Mar 2010 01:22:29 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.ffwll.ch (cable-static-49-187.intergga.ch [157.161.49.187]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A9869E81C for ; Thu, 18 Mar 2010 01:22:27 -0700 (PDT) Received: by mail.ffwll.ch (Postfix, from userid 1000) id EAB8120C1BA; Thu, 18 Mar 2010 09:22:25 +0100 (CET) X-Spam-ASN: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on orange.ffwll.ch X-Spam-Level: X-Spam-Hammy: 0.000-+--UD:show_bug.cgi, 0.000-+--show_bugcgi, 0.000-+--show_bug.cgi X-Spam-Status: No, score=-4.4 required=6.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Spammy: 0.960-+--H*MI:ffwll, 0.957-+--H*m:ffwll, 0.956-+--H*r:mail.ffwll.ch Received: from viiv.ffwll.ch (viiv.ffwll.ch [192.168.23.128]) by mail.ffwll.ch (Postfix) with ESMTP id 82A3020C0B1; Thu, 18 Mar 2010 09:22:20 +0100 (CET) Received: from daniel by viiv.ffwll.ch with local (Exim 4.71) (envelope-from ) id 1NsAzk-0004Qz-8n; Thu, 18 Mar 2010 09:22:20 +0100 From: Daniel Vetter To: intel-gfx@lists.freedesktop.org Date: Thu, 18 Mar 2010 09:22:12 +0100 Message-Id: <1268900532-17007-1-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.0 Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH] drm/intel: fix up set_tiling for untiled->tiled transition X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Thu, 18 Mar 2010 08:23:06 +0000 (UTC) diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index b5c55d8..c01c878 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c @@ -325,9 +325,12 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, * need to ensure that any fence register is cleared. */ if (!i915_gem_object_fence_offset_ok(obj, args->tiling_mode)) - ret = i915_gem_object_unbind(obj); + ret = i915_gem_object_unbind(obj); + else if (obj_priv->fence_reg != I915_FENCE_REG_NONE) + ret = i915_gem_object_put_fence_reg(obj); else - ret = i915_gem_object_put_fence_reg(obj); + i915_gem_release_mmap(obj); + if (ret != 0) { WARN(ret != -ERESTARTSYS, "failed to reset object for tiling switch");