drm/ttm: make move callback compulstory
authorDave Airlie <airlied@redhat.com>
Tue, 6 Oct 2020 00:06:44 +0000 (10:06 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 7 Oct 2020 05:42:00 +0000 (15:42 +1000)
All drivers should have a move callback now so make it compulsory.

Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201006000644.1005758-6-airlied@gmail.com
drivers/gpu/drm/ttm/ttm_bo.c

index e11e8eaa6602c8a9a0ec10c710f6a6f6584daad8..88d215de9ae192cdb4c31599a1a58954273134ec 100644 (file)
@@ -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);