diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2017-12-20 17:01:08 +0100 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2017-12-22 13:12:49 +0100 |
commit | d3ffa94bb42059dfdeff19a25dddf982ac6b9619 (patch) | |
tree | 14ce240329ac114cd40fcbcc6d0c36a8d6a2ceaa /ttm | |
parent | cff37b3fd17a042e9a948b7b40637e2751c85628 (diff) |
vmwgfx/ttm: Remove the "aliased" argument to ttm_bo_k[un]map_prot
We don't use it currently, so it can be re-added later if needed for
faster cpu buffer moves.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Diffstat (limited to 'ttm')
-rw-r--r-- | ttm/ttm_bo_util.c | 32 |
1 files changed, 11 insertions, 21 deletions
diff --git a/ttm/ttm_bo_util.c b/ttm/ttm_bo_util.c index 0da61da..e385cdd 100644 --- a/ttm/ttm_bo_util.c +++ b/ttm/ttm_bo_util.c @@ -278,28 +278,19 @@ static int ttm_copy_io_page(void *dst, void *src, unsigned long page) #endif static void *ttm_kmap_atomic_prot(struct page *page, - pgprot_t prot, - bool aliased) + pgprot_t prot) { - /* - * If the mapping is not aliased anywhere, we can use a cached mapping - * if caller desires. - */ - if ((!aliased && PageHighMem(page)) || - pgprot_val(prot) == pgprot_val(PAGE_KERNEL)) + if (pgprot_val(prot) == pgprot_val(PAGE_KERNEL)) return kmap_atomic(page); else return __ttm_kmap_atomic_prot(page, prot); } -static void ttm_kunmap_atomic_prot(struct page *page, - void *addr, - pgprot_t prot, - bool aliased) +static void ttm_kunmap_atomic_prot(void *addr, + pgprot_t prot) { - if ((!aliased && PageHighMem(page)) || - pgprot_val(prot) != pgprot_val(PAGE_KERNEL)) { + if (pgprot_val(prot) == pgprot_val(PAGE_KERNEL)) { kunmap_atomic(addr); } else { __ttm_kunmap_atomic(addr); @@ -317,21 +308,20 @@ static int ttm_copy_io_ttm_page(struct ttm_tt *ttm, void *src, return -ENOMEM; src = (void *)((unsigned long)src + (page << PAGE_SHIFT)); - dst = ttm_kmap_atomic_prot(d, prot, true); + dst = ttm_kmap_atomic_prot(d, prot); if (!dst) return -ENOMEM; memcpy_fromio(dst, src, PAGE_SIZE); - ttm_kunmap_atomic_prot(d, dst, prot, true); + ttm_kunmap_atomic_prot(dst, prot); return 0; } static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst, unsigned long page, - pgprot_t prot, - bool aliased) + pgprot_t prot) { struct page *s = ttm->pages[page]; void *src; @@ -340,13 +330,13 @@ static int ttm_copy_ttm_io_page(struct ttm_tt *ttm, void *dst, return -ENOMEM; dst = (void *)((unsigned long)dst + (page << PAGE_SHIFT)); - src = ttm_kmap_atomic_prot(s, prot, true); + src = ttm_kmap_atomic_prot(s, prot); if (!src) return -ENOMEM; memcpy_toio(dst, src, PAGE_SIZE); - ttm_kunmap_atomic_prot(s, src, prot, aliased); + ttm_kunmap_atomic_prot(src, prot); return 0; } @@ -419,7 +409,7 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, pgprot_t prot = ttm_io_prot(old_mem->placement, PAGE_KERNEL); ret = ttm_copy_ttm_io_page(ttm, new_iomap, page, - prot, false); + prot); } else if (new_iomap == NULL) { pgprot_t prot = ttm_io_prot(new_mem->placement, PAGE_KERNEL); |