drm/ttm: use new move interface for known system->ttm moves
authorDave Airlie <airlied@redhat.com>
Mon, 19 Oct 2020 07:13:12 +0000 (17:13 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 19 Oct 2020 19:04:04 +0000 (05:04 +1000)
In all 3 drivers there is a case where the driver knows the
bo is in SYSTEM so don't call the api that checks that.

Reviewed-by: Ben Skeggs <bskeggs@redhat.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201019071314.1671485-4-airlied@gmail.com
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
drivers/gpu/drm/nouveau/nouveau_bo.c
drivers/gpu/drm/radeon/radeon_ttm.c
drivers/gpu/drm/ttm/ttm_bo_util.c

index 8cdec58b9106e484ed7a89b0bfebdc97c19257e2..f8c9d66d3ef7b72097bb13305c55afb254843d7e 100644 (file)
@@ -601,11 +601,11 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, bool evict,
        }
 
        /* move/bind old memory to GTT space */
-       r = ttm_bo_move_ttm(bo, ctx, &tmp_mem);
+       r = ttm_bo_move_to_new_tt_mem(bo, ctx, &tmp_mem);
        if (unlikely(r)) {
                goto out_cleanup;
        }
-
+       ttm_bo_assign_mem(bo, &tmp_mem);
        /* copy to VRAM */
        r = amdgpu_move_blit(bo, evict, new_mem, old_mem);
        if (unlikely(r)) {
index 4ccb3329014b4756f09d9f7294bb63911911b2e4..63baa9367851e0fb36ebc53643e90d47661196dc 100644 (file)
@@ -927,10 +927,11 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict,
        if (ret)
                return ret;
 
-       ret = ttm_bo_move_ttm(bo, ctx, &tmp_reg);
+       ret = ttm_bo_move_to_new_tt_mem(bo, ctx, &tmp_reg);
        if (ret)
                goto out;
 
+       ttm_bo_assign_mem(bo, &tmp_reg);
        ret = nouveau_bo_move_m2mf(bo, true, ctx, new_reg);
        if (ret)
                goto out;
index d6f42fbc81f4c2e2b25c3cf41de265a26c3718bf..9437d29248fd32d3827ba0544a30d9b144a36606 100644 (file)
@@ -275,10 +275,11 @@ static int radeon_move_ram_vram(struct ttm_buffer_object *bo,
        if (unlikely(r)) {
                return r;
        }
-       r = ttm_bo_move_ttm(bo, ctx, &tmp_mem);
+       r = ttm_bo_move_to_new_tt_mem(bo, ctx, &tmp_mem);
        if (unlikely(r)) {
                goto out_cleanup;
        }
+       ttm_bo_assign_mem(bo, &tmp_mem);
        r = radeon_move_blit(bo, true, new_mem, old_mem);
        if (unlikely(r)) {
                goto out_cleanup;
index 4a461226b6bad4caff310dff42624d1de4551a95..7ea0482c1aeeb37f42e8c57a6ed5235dae1ec665 100644 (file)
@@ -64,6 +64,7 @@ int ttm_bo_move_to_new_tt_mem(struct ttm_buffer_object *bo,
 
        return 0;
 }
+EXPORT_SYMBOL(ttm_bo_move_to_new_tt_mem);
 
 static int ttm_bo_move_to_system(struct ttm_buffer_object *bo,
                                 struct ttm_operation_ctx *ctx)