aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-10-19 17:13:13 +1000
committerDave Airlie <airlied@redhat.com>2020-10-20 05:04:04 +1000
commitc37d951cb42aa340513c0bc2df10b7324fa0d856 (patch)
tree83d533b60aed4bde40bbaf2171e3cb06e7fcc8dc /drivers/gpu/drm/radeon
parentdrm/ttm: use new move interface for known system->ttm moves (diff)
downloadlinux-dev-c37d951cb42aa340513c0bc2df10b7324fa0d856.tar.xz
linux-dev-c37d951cb42aa340513c0bc2df10b7324fa0d856.zip
drm/ttm: add move old to system to drivers.
Uninline ttm_bo_move_ttm. Eventually want to unhook the unbind out. 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-5-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r--drivers/gpu/drm/radeon/radeon_ttm.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index 9437d29248fd..426643120e3a 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -244,7 +244,11 @@ static int radeon_move_vram_ram(struct ttm_buffer_object *bo,
if (unlikely(r)) {
goto out_cleanup;
}
- r = ttm_bo_move_ttm(bo, ctx, new_mem);
+ r = ttm_bo_move_to_system(bo, ctx);
+ if (unlikely(r))
+ goto out_cleanup;
+
+ ttm_bo_assign_mem(bo, new_mem);
out_cleanup:
ttm_resource_free(bo, &tmp_mem);
return r;
@@ -319,9 +323,14 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, bool evict,
}
if (old_mem->mem_type == TTM_PL_TT &&
- new_mem->mem_type == TTM_PL_SYSTEM)
- return ttm_bo_move_ttm(bo, ctx, new_mem);
+ new_mem->mem_type == TTM_PL_SYSTEM) {
+ r = ttm_bo_move_to_system(bo, ctx);
+ if (r)
+ return r;
+ ttm_bo_assign_mem(bo, new_mem);
+ return 0;
+ }
if (!rdev->ring[radeon_copy_ring_index(rdev)].ready ||
rdev->asic->copy.copy == NULL) {
/* use memcpy */