Skip to content

Commit 51e50e5

Browse files
committed
drm/radeon/ttm: handle ttm moves properly
The core move code currently handles use_tt moves, for radeon 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 radeon) 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 3a08446 commit 51e50e5

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/gpu/drm/radeon/radeon_ttm.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,16 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
316316
ttm_bo_move_null(bo, new_mem);
317317
return 0;
318318
}
319-
if ((old_mem->mem_type == TTM_PL_TT &&
320-
new_mem->mem_type == TTM_PL_SYSTEM) ||
321-
(old_mem->mem_type == TTM_PL_SYSTEM &&
322-
new_mem->mem_type == TTM_PL_TT)) {
323-
/* bind is enough */
319+
if (old_mem->mem_type == TTM_PL_SYSTEM &&
320+
new_mem->mem_type == TTM_PL_TT) {
324321
ttm_bo_move_null(bo, new_mem);
325322
return 0;
326323
}
324+
325+
if (old_mem->mem_type == TTM_PL_TT &&
326+
new_mem->mem_type == TTM_PL_SYSTEM)
327+
return ttm_bo_move_ttm(bo, ctx, new_mem);
328+
327329
if (!rdev->ring[radeon_copy_ring_index(rdev)].ready ||
328330
rdev->asic->copy.copy == NULL) {
329331
/* use memcpy */

0 commit comments

Comments
 (0)