diff mbox series

[09/45] drm/ttm: make move callback compulstory

Message ID 20200924051845.397177-10-airlied@gmail.com (mailing list archive)
State New, archived
Headers show
Series TTM move refactoring | expand

Commit Message

Dave Airlie Sept. 24, 2020, 5:18 a.m. UTC
From: Dave Airlie <airlied@redhat.com>

All drivers should have a move callback now so make it compulsory.

Signed-off-by: Dave Airlie <airlied@redhat.com>
---
 drivers/gpu/drm/ttm/ttm_bo.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

Comments

Christian König Sept. 24, 2020, 11:15 a.m. UTC | #1
Am 24.09.20 um 07:18 schrieb Dave Airlie:
> From: Dave Airlie <airlied@redhat.com>
>
> All drivers should have a move callback now so make it compulsory.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   drivers/gpu/drm/ttm/ttm_bo.c | 13 +------------
>   1 file changed, 1 insertion(+), 12 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
> index 6d1520255fc1..6a7f4c028801 100644
> --- a/drivers/gpu/drm/ttm/ttm_bo.c
> +++ b/drivers/gpu/drm/ttm/ttm_bo.c
> @@ -270,18 +270,7 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
>   	if (bdev->driver->move_notify)
>   		bdev->driver->move_notify(bo, evict, mem);
>   
> -	if (old_man->use_tt && new_man->use_tt) {
> -		if (bo->mem.mem_type == TTM_PL_SYSTEM) {
> -			ttm_bo_assign_mem(bo, mem);
> -			ret = 0;
> -		} else
> -			ret = ttm_bo_move_ttm(bo, ctx, mem);
> -	}
> -	else if (bdev->driver->move)
> -		ret = bdev->driver->move(bo, evict, ctx, mem);
> -	else
> -		ret = ttm_bo_move_memcpy(bo, ctx, mem);
> -
> +	ret = bdev->driver->move(bo, evict, ctx, mem);
>   	if (ret) {
>   		if (bdev->driver->move_notify) {
>   			swap(*mem, bo->mem);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index 6d1520255fc1..6a7f4c028801 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -270,18 +270,7 @@  static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
 	if (bdev->driver->move_notify)
 		bdev->driver->move_notify(bo, evict, mem);
 
-	if (old_man->use_tt && new_man->use_tt) {
-		if (bo->mem.mem_type == TTM_PL_SYSTEM) {
-			ttm_bo_assign_mem(bo, mem);
-			ret = 0;
-		} else
-			ret = ttm_bo_move_ttm(bo, ctx, mem);
-	}
-	else if (bdev->driver->move)
-		ret = bdev->driver->move(bo, evict, ctx, mem);
-	else
-		ret = ttm_bo_move_memcpy(bo, ctx, mem);
-
+	ret = bdev->driver->move(bo, evict, ctx, mem);
 	if (ret) {
 		if (bdev->driver->move_notify) {
 			swap(*mem, bo->mem);