aboutsummaryrefslogtreecommitdiff
path: root/linux-core/drm_compat.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-02-08 13:29:08 +0100
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2007-02-08 13:29:08 +0100
commit1257907fa9a24de7aa95485e1b3ab509fdc4d4e6 (patch)
treea73a3d646917f4df5192bfe3bb23805e33d583fd /linux-core/drm_compat.c
parent09984ad77bdeca0e9d87b1fe2be1489205fda297 (diff)
Simplify external ttm page allocation.
Implement a memcpy fallback for copying between buffers.
Diffstat (limited to 'linux-core/drm_compat.c')
-rw-r--r--linux-core/drm_compat.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/linux-core/drm_compat.c b/linux-core/drm_compat.c
index 044cf4a4..d0bca672 100644
--- a/linux-core/drm_compat.c
+++ b/linux-core/drm_compat.c
@@ -220,7 +220,6 @@ struct page *drm_bo_vm_nopage(struct vm_area_struct *vma,
unsigned long page_offset;
struct page *page;
drm_ttm_t *ttm;
- drm_buffer_manager_t *bm;
drm_device_t *dev;
mutex_lock(&bo->mutex);
@@ -241,20 +240,13 @@ struct page *drm_bo_vm_nopage(struct vm_area_struct *vma,
goto out_unlock;
}
- bm = &dev->bm;
ttm = bo->ttm;
drm_ttm_fixup_caching(ttm);
page_offset = (address - vma->vm_start) >> PAGE_SHIFT;
- page = ttm->pages[page_offset];
-
+ page = drm_ttm_get_page(ttm, page_offset);
if (!page) {
- page = drm_ttm_alloc_page();
- if (!page) {
- page = NOPAGE_OOM;
- goto out_unlock;
- }
- ttm->pages[page_offset] = page;
- ++bm->cur_pages;
+ page = NOPAGE_OOM;
+ goto out_unlock;
}
get_page(page);