From patchwork Tue Sep 25 11:57:02 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Akinobu Mita X-Patchwork-Id: 1507931 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 71ED43FDAE for ; Wed, 26 Sep 2012 07:47:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 61E66A0E43 for ; Wed, 26 Sep 2012 00:47:55 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f49.google.com (mail-pa0-f49.google.com [209.85.220.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 5BB5C9EC53 for ; Tue, 25 Sep 2012 04:57:47 -0700 (PDT) Received: by padbi5 with SMTP id bi5so2202591pad.36 for ; Tue, 25 Sep 2012 04:57:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=3/S2QXt9aUHoIzan2yRM59oX0KT99h85DqTBlG3YD8U=; b=yJEALpxhktIUh7vf6ssoKXvlWcMfbLvGFINb6UVZ1pGlxsjnIKjD/HyuadUNoUNumd KIlHe5eBHaZhPHM9cSbvc6zmeJ8NwJ7HHg48T8ljxNweVioBc97kFSCPhd2YGuS6JnB5 QtGlC7nAxu5ikYMlXc5RKgk8V8EFRNg6cyNNJrWYnourF8LYELad1GViXZAQUPsqHZ4a FfiwnsxIAVkgVyaUboF5miITUvi2W8G0coaZ3YO8Lix3jl9s8l4wkStK+wfDqsplbt++ RaZOn4UYnopz0Av7X7u9z6oRm4W351kSpW7AoMPa9hJfXvqUrGR87jv2FZiOHYDLxfth KggQ== Received: by 10.68.218.100 with SMTP id pf4mr44742913pbc.122.1348574267161; Tue, 25 Sep 2012 04:57:47 -0700 (PDT) Received: from localhost.localdomain (p1145-ipbf2802hodogaya.kanagawa.ocn.ne.jp. [118.15.72.145]) by mx.google.com with ESMTPS id bj7sm54899pab.24.2012.09.25.04.57.44 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 25 Sep 2012 04:57:46 -0700 (PDT) From: Akinobu Mita To: linux-kernel@vger.kernel.org, akpm@linux-foundation.org Subject: [PATCH] gpu/drm/ttm: use copy_highpage Date: Tue, 25 Sep 2012 20:57:02 +0900 Message-Id: <1348574222-3512-2-git-send-email-akinobu.mita@gmail.com> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1348574222-3512-1-git-send-email-akinobu.mita@gmail.com> References: <1348574222-3512-1-git-send-email-akinobu.mita@gmail.com> X-Mailman-Approved-At: Wed, 26 Sep 2012 00:47:42 -0700 Cc: Akinobu Mita , dri-devel@lists.freedesktop.org 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 Use copy_highpage() to copy from one page to another. Signed-off-by: Akinobu Mita Cc: David Airlie Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/ttm/ttm_tt.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index fa09daf..11c9369 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -290,8 +290,6 @@ int ttm_tt_swapin(struct ttm_tt *ttm) struct file *swap_storage; struct page *from_page; struct page *to_page; - void *from_virtual; - void *to_virtual; int i; int ret = -ENOMEM; @@ -311,11 +309,7 @@ int ttm_tt_swapin(struct ttm_tt *ttm) goto out_err; preempt_disable(); - from_virtual = kmap_atomic(from_page); - to_virtual = kmap_atomic(to_page); - memcpy(to_virtual, from_virtual, PAGE_SIZE); - kunmap_atomic(to_virtual); - kunmap_atomic(from_virtual); + copy_highpage(to_page, from_page); preempt_enable(); page_cache_release(from_page); } @@ -336,8 +330,6 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage) struct file *swap_storage; struct page *from_page; struct page *to_page; - void *from_virtual; - void *to_virtual; int i; int ret = -ENOMEM; @@ -367,11 +359,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage) goto out_err; } preempt_disable(); - from_virtual = kmap_atomic(from_page); - to_virtual = kmap_atomic(to_page); - memcpy(to_virtual, from_virtual, PAGE_SIZE); - kunmap_atomic(to_virtual); - kunmap_atomic(from_virtual); + copy_highpage(to_page, from_page); preempt_enable(); set_page_dirty(to_page); mark_page_accessed(to_page);