]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
gpu/drm/ttm: use copy_highpage
authorAkinobu Mita <akinobu.mita@gmail.com>
Fri, 28 Sep 2012 00:18:54 +0000 (10:18 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 28 Sep 2012 06:06:37 +0000 (16:06 +1000)
Use copy_highpage() to copy from one page to another.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/gpu/drm/ttm/ttm_tt.c

index fa09daf9a50c30adb728bda9d29ba0319ce478c8..11c9369d420879c05449ca4ff16228f4ec8e0bd1 100644 (file)
@@ -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);