Skip to content

Commit 3a08446

Browse files
committed
drm/amdgpu/ttm: handle tt moves properly.
The core move code currently handles use_tt moves, for amdgpu this was being handled also in the driver, but not using the same paths. If moving between TT/SYSTEM (all the use_tt paths on amdgpu) use the core move function. Eventually the core will be flipped over to calling the driver. Reviewed-by: Christian König <[email protected]> Signed-off-by: Dave Airlie <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 6236d95 commit 3a08446

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -671,14 +671,16 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, bool evict,
671671
ttm_bo_move_null(bo, new_mem);
672672
return 0;
673673
}
674-
if ((old_mem->mem_type == TTM_PL_TT &&
675-
new_mem->mem_type == TTM_PL_SYSTEM) ||
676-
(old_mem->mem_type == TTM_PL_SYSTEM &&
677-
new_mem->mem_type == TTM_PL_TT)) {
678-
/* bind is enough */
674+
if (old_mem->mem_type == TTM_PL_SYSTEM &&
675+
new_mem->mem_type == TTM_PL_TT) {
679676
ttm_bo_move_null(bo, new_mem);
680677
return 0;
681678
}
679+
680+
if (old_mem->mem_type == TTM_PL_TT &&
681+
new_mem->mem_type == TTM_PL_SYSTEM)
682+
return ttm_bo_move_ttm(bo, ctx, new_mem);
683+
682684
if (old_mem->mem_type == AMDGPU_PL_GDS ||
683685
old_mem->mem_type == AMDGPU_PL_GWS ||
684686
old_mem->mem_type == AMDGPU_PL_OA ||

0 commit comments

Comments
 (0)