diff options
author | Akinobu Mita <akinobu.mita@gmail.com> | 2012-09-25 07:57:02 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-10-01 19:26:17 -0400 |
commit | 259a290e78d639bd02d0e408ceb72967318abb13 (patch) | |
tree | f217ae8df6efa4b6febebbcbcef5367bd0d66f42 /drivers/gpu/drm/ttm/ttm_tt.c | |
parent | 27796b465d25bc48f785c235be33cdc334a624e6 (diff) |
gpu/drm/ttm: use copy_highpage
Use copy_highpage() to copy from one page to another.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_tt.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_tt.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index fa09daf9a50c..11c9369d4208 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) | |||
290 | struct file *swap_storage; | 290 | struct file *swap_storage; |
291 | struct page *from_page; | 291 | struct page *from_page; |
292 | struct page *to_page; | 292 | struct page *to_page; |
293 | void *from_virtual; | ||
294 | void *to_virtual; | ||
295 | int i; | 293 | int i; |
296 | int ret = -ENOMEM; | 294 | int ret = -ENOMEM; |
297 | 295 | ||
@@ -311,11 +309,7 @@ int ttm_tt_swapin(struct ttm_tt *ttm) | |||
311 | goto out_err; | 309 | goto out_err; |
312 | 310 | ||
313 | preempt_disable(); | 311 | preempt_disable(); |
314 | from_virtual = kmap_atomic(from_page); | 312 | copy_highpage(to_page, from_page); |
315 | to_virtual = kmap_atomic(to_page); | ||
316 | memcpy(to_virtual, from_virtual, PAGE_SIZE); | ||
317 | kunmap_atomic(to_virtual); | ||
318 | kunmap_atomic(from_virtual); | ||
319 | preempt_enable(); | 313 | preempt_enable(); |
320 | page_cache_release(from_page); | 314 | page_cache_release(from_page); |
321 | } | 315 | } |
@@ -336,8 +330,6 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage) | |||
336 | struct file *swap_storage; | 330 | struct file *swap_storage; |
337 | struct page *from_page; | 331 | struct page *from_page; |
338 | struct page *to_page; | 332 | struct page *to_page; |
339 | void *from_virtual; | ||
340 | void *to_virtual; | ||
341 | int i; | 333 | int i; |
342 | int ret = -ENOMEM; | 334 | int ret = -ENOMEM; |
343 | 335 | ||
@@ -367,11 +359,7 @@ int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage) | |||
367 | goto out_err; | 359 | goto out_err; |
368 | } | 360 | } |
369 | preempt_disable(); | 361 | preempt_disable(); |
370 | from_virtual = kmap_atomic(from_page); | 362 | copy_highpage(to_page, from_page); |
371 | to_virtual = kmap_atomic(to_page); | ||
372 | memcpy(to_virtual, from_virtual, PAGE_SIZE); | ||
373 | kunmap_atomic(to_virtual); | ||
374 | kunmap_atomic(from_virtual); | ||
375 | preempt_enable(); | 363 | preempt_enable(); |
376 | set_page_dirty(to_page); | 364 | set_page_dirty(to_page); |
377 | mark_page_accessed(to_page); | 365 | mark_page_accessed(to_page); |