Skip to contentSkip to conversation

drm/ttm: remove overlapping memcpy support

PATCH In review Dave Airlie 2 participants 2 messages Oct 22, 2020

Subsystems (3)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 drm/ttm: remove overlapping memcpy support

From: Dave Airlie <[email protected]>

remove the overlapping memcp support as it's never used.

---
 drivers/gpu/drm/ttm/ttm_bo_util.c | 19 +++----------------
 1 file changed, 3 insertions(+), 16 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_util.c +3 -16
index 0a5694ef1e07..ecb54415d1ca 100644
@@ -180,9 +180,6 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
 	void *new_iomap;
 	int ret;
 	unsigned long i;
-	unsigned long page;
-	unsigned long add = 0;
-	int dir;
 
 	ret = ttm_bo_wait_ctx(bo, ctx);
 	if (ret)
@@ -220,27 +217,17 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
 			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) {
-		page = i * dir + add;
 		if (old_iomap == NULL) {
 			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);
 		} else if (new_iomap == NULL) {
 			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);
 		} else {
-			ret = ttm_copy_io_page(new_iomap, old_iomap, page);
+			ret = ttm_copy_io_page(new_iomap, old_iomap, i);
 		}
 		if (ret)
 			goto out1;
Signature · 6 lines
2.27.0

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by on v1 1/1
#1 lore raw

Am 22.10.20 um 05:11 schrieb Dave Airlie:

Quoted 5 lines

From: Dave Airlie <[email protected]>

remove the overlapping memcp support as it's never used.

Quoted 39 lines
---
  drivers/gpu/drm/ttm/ttm_bo_util.c | 19 +++----------------
  1 file changed, 3 insertions(+), 16 deletions(-)
drivers/gpu/drm/ttm/ttm_bo_util.c +1 -14
index 0a5694ef1e07..ecb54415d1ca 100644
@@ -180,9 +180,6 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
  	void *new_iomap;
  	int ret;
  	unsigned long i;
-	unsigned long page;
-	unsigned long add = 0;
-	int dir;
 
  	ret = ttm_bo_wait_ctx(bo, ctx);
  	if (ret)
@@ -220,27 +217,17 @@ int ttm_bo_move_memcpy(struct ttm_buffer_object *bo,
  			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) {
-		page = i * dir + add;
  		if (old_iomap == NULL) {
  			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);
  		} else if (new_iomap == NULL) {

drivers/gpu/drm/ttm/ttm_bo_util.c int ttm_bo_move_memcpy(struct ttm_buffer_object *bo, · line 233

Quoted 10 lines
drivers/gpu/drm/ttm/ttm_bo_util.c +2 -2
  			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);
  		} else {
-			ret = ttm_copy_io_page(new_iomap, old_iomap, page);
+			ret = ttm_copy_io_page(new_iomap, old_iomap, i);
  		}
  		if (ret)
  			goto out1;

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel