From patchwork Fri Mar 7 09:59:27 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sourab.gupta@intel.com X-Patchwork-Id: 3789021 Return-Path: X-Original-To: patchwork-intel-gfx@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 54125BF540 for ; Fri, 7 Mar 2014 09:59:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8920620274 for ; Fri, 7 Mar 2014 09:59:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CFEFB201B4 for ; Fri, 7 Mar 2014 09:59:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E473FAEDE; Fri, 7 Mar 2014 01:59:32 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 01B6BFAE93 for ; Fri, 7 Mar 2014 01:59:30 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 07 Mar 2014 01:59:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,606,1389772800"; d="scan'208";a="468302016" Received: from sourabgu-desktop.iind.intel.com ([10.223.82.69]) by orsmga001.jf.intel.com with ESMTP; 07 Mar 2014 01:59:28 -0800 From: sourab.gupta@intel.com To: intel-gfx@lists.freedesktop.org Date: Fri, 7 Mar 2014 15:29:27 +0530 Message-Id: <1394186367-20339-4-git-send-email-sourab.gupta@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1394186367-20339-1-git-send-email-sourab.gupta@intel.com> References: <1394186367-20339-1-git-send-email-sourab.gupta@intel.com> Cc: Daniel Vetter , Sourab Gupta , Chris Wilson Subject: [Intel-gfx] [PATCH 3/3] drm/i915: Memory node free handling on truncation of stolen obj X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 From: Sourab Gupta While we are freeing the purgeable stolen object, the memory node has to be freed so as to make space for the new object. Signed-off-by: Sourab Gupta --- drivers/gpu/drm/i915/i915_gem_stolen.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_gem_stolen.c b/drivers/gpu/drm/i915/i915_gem_stolen.c index d092bf3..ae12074 100644 --- a/drivers/gpu/drm/i915/i915_gem_stolen.c +++ b/drivers/gpu/drm/i915/i915_gem_stolen.c @@ -411,10 +411,8 @@ found: ret = i915_gem_object_put_pages(obj); if (ret == 0) { + i915_gem_object_release_stolen(obj); obj->madv = __I915_MADV_PURGED; - - kfree(obj->stolen); - obj->stolen = NULL; } else i915_gem_object_pin_pages(obj); }