drm/ttm: remove move to new and inline into remainging place.
authorDave Airlie <airlied@redhat.com>
Tue, 20 Oct 2020 01:03:17 +0000 (11:03 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 21 Oct 2020 03:44:05 +0000 (13:44 +1000)
This show the remaining bind callback, which my next series of
patches will aim to remove.

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

index 593e55879019be3967dc562e612619cf62f919eb..a41be3dba23d397a47e644e6a7eafc5ef454c9a8 100644 (file)
@@ -252,9 +252,15 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
                if (ret)
                        goto out_err;
 
-               ret = ttm_bo_move_to_new_tt_mem(bo, ctx, mem);
-               if (ret)
-                       goto out_err;
+               if (mem->mem_type != TTM_PL_SYSTEM) {
+                       ret = ttm_tt_populate(bo->bdev, bo->ttm, ctx);
+                       if (ret)
+                               goto out_err;
+
+                       ret = bdev->driver->ttm_tt_bind(bo->bdev, bo->ttm, mem);
+                       if (ret)
+                               goto out_err;
+               }
        }
 
        if (bdev->driver->move_notify)
@@ -1492,7 +1498,3 @@ void ttm_bo_tt_destroy(struct ttm_buffer_object *bo)
        bo->ttm = NULL;
 }
 
-int ttm_bo_tt_bind(struct ttm_buffer_object *bo, struct ttm_resource *mem)
-{
-       return bo->bdev->driver->ttm_tt_bind(bo->bdev, bo->ttm, mem);
-}
index 65f042d6da7c443825aa5a0d13a89d009a36ccf6..0a5694ef1e07d51ca750f6a3376507d0c3234617 100644 (file)
@@ -45,26 +45,6 @@ struct ttm_transfer_obj {
        struct ttm_buffer_object *bo;
 };
 
-int ttm_bo_move_to_new_tt_mem(struct ttm_buffer_object *bo,
-                             struct ttm_operation_ctx *ctx,
-                             struct ttm_resource *new_mem)
-{
-       int ret;
-
-       if (new_mem->mem_type == TTM_PL_SYSTEM)
-               return 0;
-
-       ret = ttm_tt_populate(bo->bdev, bo->ttm, ctx);
-       if (unlikely(ret != 0))
-               return ret;
-
-       ret = ttm_bo_tt_bind(bo, new_mem);
-       if (unlikely(ret != 0))
-               return ret;
-
-       return 0;
-}
-
 int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
                       struct ttm_resource *mem)
 {
index fbbcf10670c1acee24b9e784908b2aa999f35f91..0c4efc169f46b326c43a273db90d97028484ef0c 100644 (file)
@@ -560,10 +560,6 @@ int ttm_mem_io_reserve(struct ttm_bo_device *bdev,
 void ttm_mem_io_free(struct ttm_bo_device *bdev,
                     struct ttm_resource *mem);
 
-int ttm_bo_move_to_new_tt_mem(struct ttm_buffer_object *bo,
-                             struct ttm_operation_ctx *ctx,
-                             struct ttm_resource *new_mem);
-
 /**
  * ttm_bo_move_memcpy
  *