drm/ttm: add move to system into drivers

This moves the to system move into the drivers, and moves all
the unbinds in the move path under driver control

Note: radeon/nouveau already wait so don't duplicate it.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020010319.1692445-4-airlied@gmail.com
This commit is contained in:
Dave Airlie
2020-10-20 11:03:15 +10:00
parent a2dcf77f75
commit 29a1d482e4
6 changed files with 26 additions and 36 deletions

View File

@@ -742,9 +742,12 @@ static int vmw_move(struct ttm_buffer_object *bo,
ttm_bo_assign_mem(bo, new_mem);
return 0;
}
ret = ttm_bo_move_to_system(bo, ctx);
ret = ttm_bo_wait_ctx(bo, ctx);
if (ret)
return ret;
vmw_ttm_unbind(bo->bdev, bo->ttm);
ttm_resource_free(bo, &bo->mem);
ttm_bo_assign_mem(bo, new_mem);
return 0;
} else {