From patchwork Mon Jul 9 07:20:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1171351 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id DDFC73FC2A for ; Mon, 9 Jul 2012 07:26:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D48599F0E8 for ; Mon, 9 Jul 2012 00:26:25 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout2.samsung.com (mailout2.samsung.com [203.254.224.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 062B79F0F9 for ; Mon, 9 Jul 2012 00:20:03 -0700 (PDT) Received: from epcpsbgm2.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M6V009B9TNQ6AS0@mailout2.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 09 Jul 2012 16:20:02 +0900 (KST) X-AuditID: cbfee61b-b7f566d000005c8a-cf-4ffa86229c92 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id A8.A3.23690.2268AFF4; Mon, 09 Jul 2012 16:20:02 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.90.51.53]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0M6V00BJGTPEQ510@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 09 Jul 2012 16:20:02 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH v2] drm/exynos: use __free_page() to deallocate memory Date: Mon, 09 Jul 2012 16:20:02 +0900 Message-id: <1341818402-32584-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1341817501-19162-2-git-send-email-inki.dae@samsung.com> References: <1341817501-19162-2-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJMWRmVeSWpSXmKPExsVy+t9jQV2ltl/+Bv2nDSyufH3P5sDocb/7 OFMAYxSXTUpqTmZZapG+XQJXxt3ZDUwFvfwV/1b+ZWpgXMnTxcjJISFgIrFu72cmCFtM4sK9 9WxdjFwcQgLTGSVa1qyCctYzSSxtP80MUsUmoCoxccV9NhBbRMBUomPSUhYQm1mgUGJhz1Mw W1jATeLZ719gNSxA9W0XvzCC2LwCLhK/3sxkhNimILHg3luwGk4BV4lfZ36BXSEEVLNnRhPz BEbeBYwMqxhFUwuSC4qT0nON9IoTc4tL89L1kvNzNzGCvf5MegfjqgaLQ4wCHIxKPLwnm3/5 C7EmlhVX5h5ilOBgVhLhfZQOFOJNSaysSi3Kjy8qzUktPsQozcGiJM5r4v3VX0ggPbEkNTs1 tSC1CCbLxMEp1cDI518mmZdm8iZ2WfJ1WfX7jubbqtbNuCWQsJftd5qaCOOC8F3PbSbLzN71 4c/uMAmz2alZdyc+kNjVdNYyKPrryzsLGMp5Pi04sTC5/PXEQIbqQxmy7MsXbJlsvPe7LsPU iwu5nvFl8TdcZF1m0+s73eriFKPfYo9jtpaZtMhIzn30VcVAz/qTEktxRqKhFnNRcSIAB2jx wPYBAAA= X-TM-AS-MML: No Cc: Inki Dae , kyungmin.park@samsung.com, sw0312.kim@samsung.com 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 this patch uses __free_page() to deallocate the pages allocated by alloc_page() and the pages doesn't need set_parge_dirty() and mark_page_accessed() because they aren't from page cache so removes them. this patch has a pair with previous patch below, http://www.spinics.net/lists/dri-devel/msg24382.html Changelog v2: remove unnecessary arguments. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 21 ++++++--------------- 1 files changed, 6 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index dceb69f..e6ca2b3 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -126,23 +126,14 @@ fail: } static void exynos_gem_put_pages(struct drm_gem_object *obj, - struct page **pages, - bool dirty, bool accessed) + struct page **pages) { - int i, npages; + unsigned int npages; npages = obj->size >> PAGE_SHIFT; - for (i = 0; i < npages; i++) { - if (dirty) - set_page_dirty(pages[i]); - - if (accessed) - mark_page_accessed(pages[i]); - - /* Undo the reference we took when populating the table */ - page_cache_release(pages[i]); - } + while (--npages >= 0) + __free_page(pages[npages]); drm_free_large(pages); } @@ -222,7 +213,7 @@ err1: kfree(buf->sgt); buf->sgt = NULL; err: - exynos_gem_put_pages(obj, pages, true, false); + exynos_gem_put_pages(obj, pages); return ret; } @@ -240,7 +231,7 @@ static void exynos_drm_gem_put_pages(struct drm_gem_object *obj) kfree(buf->sgt); buf->sgt = NULL; - exynos_gem_put_pages(obj, buf->pages, true, false); + exynos_gem_put_pages(obj, buf->pages); buf->pages = NULL; /* add some codes for UNCACHED type here. TODO */