From patchwork Mon Jul 1 20:05:54 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2809541 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C7708BF4A1 for ; Mon, 1 Jul 2013 20:12:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A4D0B201C7 for ; Mon, 1 Jul 2013 20:12:07 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 94647201C6 for ; Mon, 1 Jul 2013 20:12:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7627EE5E10 for ; Mon, 1 Jul 2013 13:12:06 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ee0-f52.google.com (mail-ee0-f52.google.com [74.125.83.52]) by gabe.freedesktop.org (Postfix) with ESMTP id 501F8E60FA for ; Mon, 1 Jul 2013 13:06:04 -0700 (PDT) Received: by mail-ee0-f52.google.com with SMTP id c50so2290576eek.25 for ; Mon, 01 Jul 2013 13:06:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=qR0vPZSrHNdfoJDMbSjUBfGTvNwvkQzOlYqQqpNO+Qw=; b=jG0uBR4Vze7Uc8Bctz3rEHJKORZY3BG87Xq3YPb/tKERgKCASfqMPS2wf3TK+8zGER o4TLIcnryFJzorZXuuOVp9PAo/NolKwlszXOnHNQT1/wlnV/MLarTep9VaeyFyzhlFFG mHF43RfwtiZNesV4cPZgXTXgHErlS44MLbpbs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=qR0vPZSrHNdfoJDMbSjUBfGTvNwvkQzOlYqQqpNO+Qw=; b=ouOjtiQkbDzoJqVnbZDQc558Mj5E5RzHEQr763AGryIJeGA8KVdQKZ2VK2lQZ2Maf2 jIQiARM3xAiEuDOovdmsr0w2oGPQsKQ8anIkB+oXpbd3anOTQv7fXZm3ujwB1QfWGkKZ hv4Ylme6tdErEOZXRoIjjhqRvBic8riVkoBh6MsRWjCwzBlo4pZrK21zluQ54s39IoI3 NRwkVAM8UIFDXEXr7zZr60sXdcKXWi0rHbQyJBo00AsK9ZVrRU50rxCqo0Y02SgSNUqt pHd3EZlhq7qgyk/hkyisItNPr8qhEJ66LVSANicoWt7B76GA1WMvNtKX7o5IQLzYHNGF z+bg== X-Received: by 10.15.93.134 with SMTP id w6mr22985204eez.25.1372709163436; Mon, 01 Jul 2013 13:06:03 -0700 (PDT) Received: from bremse.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPSA id a4sm31875327eez.0.2013.07.01.13.06.01 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 01 Jul 2013 13:06:02 -0700 (PDT) From: Daniel Vetter To: DRI Development Subject: [PATCH 2/2] drm/i915: use drm_mm_remove_node instead of put_block Date: Mon, 1 Jul 2013 22:05:54 +0200 Message-Id: <1372709154-7524-2-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.7 In-Reply-To: <1372709154-7524-1-git-send-email-daniel.vetter@ffwll.ch> References: <1372709154-7524-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQke4Vrv8tw7QeabTLbebNxqloeg29nhGDt3gUd57h3gHv3H/zfivTunDED9wkjk663aVuFn Cc: Daniel Vetter , Intel Graphics Development , Ben Widawsky X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When converting to the preallocated drm_mm_node interfaces in commit dc9dd7a20fde95aa81a8307cde79c2dff9f83f3d Author: Chris Wilson Date: Fri Dec 7 20:37:07 2012 +0000 drm/i915: Preallocate the drm_mm_node prior to manipulating the GTT drm_mm only the allocation side was converted, but not the freeing. Fix this up. Note that the only difference between put_block and remove_node is that the former fills up the preallocation cache. Which we don't need anyway and hence is just wasted space. Cc: Chris Wilson Cc: Ben Widawsky Signed-off-by: Daniel Vetter Reviewed-by: Chris Wilson --- drivers/gpu/drm/i915/i915_gem.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index 4200c32..30fd694 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c @@ -2620,7 +2620,7 @@ i915_gem_object_unbind(struct drm_i915_gem_object *obj) /* Avoid an unnecessary call to unbind on rebind. */ obj->map_and_fenceable = true; - drm_mm_put_block(obj->gtt_space); + drm_mm_remove_node(obj->gtt_space); obj->gtt_space = NULL; obj->gtt_offset = 0; @@ -3137,14 +3137,14 @@ search_free: } if (WARN_ON(!i915_gem_valid_gtt_space(dev, node, obj->cache_level))) { i915_gem_object_unpin_pages(obj); - drm_mm_put_block(node); + drm_mm_remove_node(node); return -EINVAL; } ret = i915_gem_gtt_prepare_object(obj); if (ret) { i915_gem_object_unpin_pages(obj); - drm_mm_put_block(node); + drm_mm_remove_node(node); return ret; }