From patchwork Mon Feb 1 12:59:18 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 76064 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 o11D5Z6P018719 for ; Mon, 1 Feb 2010 13:06:16 GMT Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6FB939F372; Mon, 1 Feb 2010 05:05:14 -0800 (PST) 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 093379E902 for ; Mon, 1 Feb 2010 05:05:11 -0800 (PST) Received: by mail.ffwll.ch (Postfix, from userid 1000) id 0A19720C330; Mon, 1 Feb 2010 14:05:10 +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-+--struct, 0.000-+--100644, 0.000-+--signedoffby X-Spam-Status: No, score=-1.2 required=6.0 tests=ALL_TRUSTED,AWL,BAYES_00, FH_DATE_PAST_20XX autolearn=no version=3.2.5 X-Spam-Spammy: 0.969-+--H*m:ffwll, 0.965-+--H*Ad:U*daniel.vetter, 0.954-+--H*r:mail.ffwll.ch Received: from biene (unknown [192.168.23.129]) by mail.ffwll.ch (Postfix) with ESMTP id 3AE7E20C2BF; Mon, 1 Feb 2010 14:04:43 +0100 (CET) Received: from daniel by biene with local (Exim 4.71) (envelope-from ) id 1NbvsL-00026h-Gv; Mon, 01 Feb 2010 13:59:33 +0100 From: Daniel Vetter To: intel-gfx@lists.freedesktop.org Date: Mon, 1 Feb 2010 13:59:18 +0100 Message-Id: X-Mailer: git-send-email 1.6.6.1 In-Reply-To: <1264b12229d1821821a5f9a1a79828bf7f12de24.1265028983.git.daniel.vetter@ffwll.ch> References: <10bf8c49d793b2c3055ec6159fb53afd5d688c87.1265028983.git.daniel.vetter@ffwll.ch> <1264b12229d1821821a5f9a1a79828bf7f12de24.1265028983.git.daniel.vetter@ffwll.ch> In-Reply-To: References: Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 03/11] drm/i915: reuse i915_gem_object_put_fence_reg for fence stealing code X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.9 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]); Mon, 01 Feb 2010 13:06:16 +0000 (UTC) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 1596949..ee1b667 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2448,39 +2448,16 @@ i915_gem_object_get_fence_reg(struct drm_gem_object *obj) */ drm_gem_object_reference(old_obj); - /* i915 uses fences for GPU access to tiled buffers */ - if (IS_I965G(dev) || !old_obj_priv->active) - break; - - /* This brings the object to the head of the LRU if it - * had been written to. The only way this should - * result in us waiting longer than the expected - * optimal amount of time is if there was a - * fence-using buffer later that was read-only. - */ - i915_gem_object_flush_gpu_write_domain(old_obj); - ret = i915_gem_object_wait_rendering(old_obj); - if (ret != 0) { - drm_gem_object_unreference(old_obj); - return ret; - } - break; } - /* - * Zap this virtual mapping so we can set up a fence again - * for this object next time we need it. - */ - i915_gem_release_mmap(old_obj); - i = old_obj_priv->fence_reg; reg = &dev_priv->fence_regs[i]; - old_obj_priv->fence_reg = I915_FENCE_REG_NONE; - list_del_init(&old_obj_priv->fence_list); - + ret = i915_gem_object_put_fence_reg(old_obj); drm_gem_object_unreference(old_obj); + if (ret != 0) + return ret; } obj_priv->fence_reg = i;