@@ -534,11 +534,6 @@ static int amdgpu_move_vram_ram(struct ttm_buffer_object *bo, bool evict,
return r;
}
- /* set caching flags */
- r = ttm_bo_move_to_new_tt_mem(bo, ctx, &tmp_mem);
- if (unlikely(r))
- goto out_cleanup;
-
/* Bind the memory to the GTT space */
r = amdgpu_ttm_backend_bind(bo->bdev, bo->ttm, &tmp_mem);
if (unlikely(r)) {
@@ -588,11 +583,6 @@ static int amdgpu_move_ram_vram(struct ttm_buffer_object *bo, bool evict,
return r;
}
- /* move/bind old memory to GTT space */
- r = ttm_bo_move_to_new_tt_mem(bo, ctx, &tmp_mem);
- if (unlikely(r)) {
- goto out_cleanup;
- }
r = amdgpu_ttm_backend_bind(bo->bdev, bo->ttm, &tmp_mem);
if (unlikely(r))
goto out_cleanup;
@@ -891,10 +891,6 @@ nouveau_bo_move_flipd(struct ttm_buffer_object *bo, bool evict,
if (ret)
return ret;
- ret = ttm_bo_move_to_new_tt_mem(bo, ctx, &tmp_reg);
- if (ret)
- return ret;
-
ret = nouveau_ttm_tt_bind(bo->bdev, bo->ttm, &tmp_reg);
if (ret)
goto out;
@@ -931,9 +927,6 @@ nouveau_bo_move_flips(struct ttm_buffer_object *bo, bool evict,
if (ret)
return ret;
- ret = ttm_bo_move_to_new_tt_mem(bo, ctx, &tmp_reg);
- if (ret)
- goto out;
ret = nouveau_ttm_tt_bind(bo->bdev, bo->ttm, &tmp_reg);
if (ret)
goto out;
@@ -220,10 +220,6 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
if (unlikely(r)) {
return r;
}
- r = ttm_bo_move_to_new_tt_mem(bo, ctx, &tmp_mem);
- if (unlikely(r)) {
- goto out_cleanup;
- }
r = radeon_ttm_tt_bind(bo->bdev, bo->ttm, &tmp_mem);
if (unlikely(r)) {
@@ -260,10 +256,6 @@ static int radeon_move_ram_vram(struct ttm_buffer_object *bo,
int r;
r = ttm_bo_create_tt_tmp(bo, ctx, new_mem, &tmp_mem);
- if (unlikely(r)) {
- return r;
- }
- r = ttm_bo_move_to_new_tt_mem(bo, ctx, &tmp_mem);
if (unlikely(r)) {
goto out_cleanup;
}
@@ -1566,6 +1566,10 @@ int ttm_bo_create_tt_tmp(struct ttm_buffer_object *bo,
if (ret)
return ret;
+ ret = ttm_bo_move_to_new_tt_mem(bo, ctx, new_temp);
+ if (ret)
+ return ret;
+
return 0;
}
EXPORT_SYMBOL(ttm_bo_create_tt_tmp);