Commit 64a87088 authored by Dave Airlie's avatar Dave Airlie

drm/ttm: remove overlapping memcpy support

remove the overlapping memcp support as it's never used.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201022031152.1916925-1-airlied@gmail.com
parent 37b254f1
...@@ -180,9 +180,6 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, ...@@ -180,9 +180,6 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
void *new_iomap; void *new_iomap;
int ret; int ret;
unsigned long i; unsigned long i;
unsigned long page;
unsigned long add = 0;
int dir;
ret = ttm_bo_wait_ctx(bo, ctx); ret = ttm_bo_wait_ctx(bo, ctx);
if (ret) if (ret)
...@@ -220,27 +217,17 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, ...@@ -220,27 +217,17 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
goto out1; goto out1;
} }
add = 0;
dir = 1;
if ((old_mem->mem_type == new_mem->mem_type) &&
(new_mem->start < old_mem->start + old_mem->size)) {
dir = -1;
add = new_mem->num_pages - 1;
}
for (i = 0; i < new_mem->num_pages; ++i) { for (i = 0; i < new_mem->num_pages; ++i) {
page = i * dir + add;
if (old_iomap == NULL) { if (old_iomap == NULL) {
pgprot_t prot = ttm_io_prot(bo, old_mem, PAGE_KERNEL); pgprot_t prot = ttm_io_prot(bo, old_mem, PAGE_KERNEL);
ret = ttm_copy_ttm_io_page(ttm, new_iomap, page, ret = ttm_copy_ttm_io_page(ttm, new_iomap, i,
prot); prot);
} else if (new_iomap == NULL) { } else if (new_iomap == NULL) {
pgprot_t prot = ttm_io_prot(bo, new_mem, PAGE_KERNEL); pgprot_t prot = ttm_io_prot(bo, new_mem, PAGE_KERNEL);
ret = ttm_copy_io_ttm_page(ttm, old_iomap, page, ret = ttm_copy_io_ttm_page(ttm, old_iomap, i,
prot); prot);
} else { } else {
ret = ttm_copy_io_page(new_iomap, old_iomap, page); ret = ttm_copy_io_page(new_iomap, old_iomap, i);
} }
if (ret) if (ret)
goto out1; goto out1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment