summaryrefslogtreecommitdiff
path: root/linux-core/drm_ttm.c
diff options
context:
space:
mode:
authorThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-25 18:05:35 +0200
committerThomas Hellstrom <thomas-at-tungstengraphics-dot-com>2006-08-25 18:05:35 +0200
commit4c03030b12bae28dad50d69bd271de632c43ff13 (patch)
tree5f719dc1e98584077b2a257be2d548143583fe3c /linux-core/drm_ttm.c
parent8fa43d4b2ff4137bab743bfaf6282aa327f16830 (diff)
Checkpoint commit
Buffer object code.
Diffstat (limited to 'linux-core/drm_ttm.c')
-rw-r--r--linux-core/drm_ttm.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/linux-core/drm_ttm.c b/linux-core/drm_ttm.c
index df4c312c..806c109b 100644
--- a/linux-core/drm_ttm.c
+++ b/linux-core/drm_ttm.c
@@ -398,10 +398,6 @@ static int drm_set_caching(drm_ttm_t * ttm, unsigned long page_offset,
struct page **cur_page;
pgprot_t attr = (noncached) ? PAGE_KERNEL_NOCACHE : PAGE_KERNEL;
- drm_ttm_lock_mm(ttm, 0, 1);
- unmap_vma_pages(ttm, page_offset, num_pages);
- drm_ttm_unlock_mm(ttm, 0, 1);
-
for (i = 0; i < num_pages; ++i) {
cur = page_offset + i;
cur_page = ttm->pages + cur;
@@ -446,7 +442,6 @@ int drm_evict_ttm_region(drm_ttm_backend_list_t * entry)
drm_ttm_lock_mm(ttm, 0, 1);
unmap_vma_pages(ttm, entry->page_offset,
entry->num_pages);
- global_flush_tlb();
drm_ttm_unlock_mm(ttm, 0, 1);
}
be->unbind(entry->be);
@@ -489,6 +484,10 @@ void drm_destroy_ttm_region(drm_ttm_backend_list_t * entry)
be->clear(entry->be);
if (be->needs_cache_adjust(be)) {
int ret = drm_ttm_lock_mmap_sem(ttm);
+ drm_ttm_lock_mm(ttm, 0, 1);
+ unmap_vma_pages(ttm, entry->page_offset,
+ entry->num_pages);
+ drm_ttm_unlock_mm(ttm, 0, 1);
drm_set_caching(ttm, entry->page_offset,
entry->num_pages, 0, 1);
if (!ret)
@@ -792,8 +791,7 @@ int drm_add_ttm(drm_device_t * dev, unsigned size, drm_map_list_t ** maplist)
return -ENOMEM;
}
- list->user_token =
- (list->hash.key << PAGE_SHIFT) + DRM_MAP_HASH_OFFSET;
+ list->user_token = list->hash.key;
list->map = map;
*maplist = list;