From patchwork Mon Jul 9 07:05:00 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 1171341 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 04B933FC2A for ; Mon, 9 Jul 2012 07:21:27 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 034D89F319 for ; Mon, 9 Jul 2012 00:21:27 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E3AE9F0F2 for ; Mon, 9 Jul 2012 00:05:04 -0700 (PDT) Received: from epcpsbgm1.samsung.com (mailout4.samsung.com [203.254.224.34]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0M6V006K9SYNXQK0@mailout4.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 09 Jul 2012 16:05:02 +0900 (KST) X-AuditID: cbfee61a-b7f616d000004b7e-8d-4ffa829d0646 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id FF.2E.19326.D928AFF4; Mon, 09 Jul 2012 16:05: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 <0M6V00ATNT0DSY30@mmp2.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 09 Jul 2012 16:05:01 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/exynos: use __free_page() to deallocate memory Date: Mon, 09 Jul 2012 16:05:00 +0900 Message-id: <1341817501-19162-2-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.4.1 In-reply-to: <1341817501-19162-1-git-send-email-inki.dae@samsung.com> References: <1341817501-19162-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEJMWRmVeSWpSXmKPExsVy+t9jQd15Tb/8DV7tYbK48vU9mwOjx/3u 40wBjFFcNimpOZllqUX6dglcGa8W9DEWHOGqePyoj6WB8QZHFyMHh4SAicSO715djJxAppjE hXvr2boYuTiEBKYzStzc9I8JwlnPJLHkXTszSBWbgKrExBX32UBsEQFTiY5JS1lAbGaBQomF PU/BbGEBd4mug+sZQWwWoPrpf2+ygti8Ai4SV9bNZ4LYpiCx4N5bsDmcAq4Sa78/AZsvBFRz +MtX5gmMvAsYGVYxiqYWJBcUJ6XnGuoVJ+YWl+al6yXn525iBPv8mdQOxpUNFocYBTgYlXh4 D9T88hdiTSwrrsw9xCjBwawkwvsoHSjEm5JYWZValB9fVJqTWnyIUZqDRUmc19j7q7+QQHpi SWp2ampBahFMlomDU6qBkSGmvXCDck0Bq2XL51MfLczLjk4/+TXerqZ7kyLHvuOJctGftDjl zOxFvv8M2PQ2seLm7s8CXJ/2sk0+XP7XquTdCx3N0tMbrZ7f6lKS1M6a73CJW3mVTU//p3vc h6Irvi2MvbSyRuHRtUtbVgrf99kQfNGz8+L5DeYBC7+Zudj9WLt1idS/60osxRmJhlrMRcWJ AFtAEsP1AQAA 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 Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_gem.c | 14 +++----------- 1 files changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_gem.c b/drivers/gpu/drm/exynos/exynos_drm_gem.c index dceb69f..4b8b988 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_gem.c +++ b/drivers/gpu/drm/exynos/exynos_drm_gem.c @@ -129,20 +129,12 @@ static void exynos_gem_put_pages(struct drm_gem_object *obj, struct page **pages, bool dirty, bool accessed) { - 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); }