Commit 88932a7b authored by Christian König's avatar Christian König Committed by Alex Deucher

drm/ttm: add wait for idle in all drivers bo_move functions

Wait for idle before moving the BO in all drivers implementing
an accelerated move function.

This should keep the current behavior when removing the pre move wait.
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 18885778
...@@ -390,6 +390,10 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo, ...@@ -390,6 +390,10 @@ static int amdgpu_bo_move(struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_mem_reg *old_mem = &bo->mem;
int r; int r;
r = ttm_bo_wait(bo, interruptible, no_wait_gpu);
if (r)
return r;
/* Can't move a pinned BO */ /* Can't move a pinned BO */
abo = container_of(bo, struct amdgpu_bo, tbo); abo = container_of(bo, struct amdgpu_bo, tbo);
if (WARN_ON_ONCE(abo->pin_count > 0)) if (WARN_ON_ONCE(abo->pin_count > 0))
......
...@@ -1289,6 +1289,10 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr, ...@@ -1289,6 +1289,10 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, bool intr,
struct nouveau_drm_tile *new_tile = NULL; struct nouveau_drm_tile *new_tile = NULL;
int ret = 0; int ret = 0;
ret = ttm_bo_wait(bo, intr, no_wait_gpu);
if (ret)
return ret;
if (nvbo->pin_refcnt) if (nvbo->pin_refcnt)
NV_WARN(drm, "Moving pinned object %p!\n", nvbo); NV_WARN(drm, "Moving pinned object %p!\n", nvbo);
......
...@@ -350,6 +350,13 @@ static int qxl_bo_move(struct ttm_buffer_object *bo, ...@@ -350,6 +350,13 @@ static int qxl_bo_move(struct ttm_buffer_object *bo,
struct ttm_mem_reg *new_mem) struct ttm_mem_reg *new_mem)
{ {
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_mem_reg *old_mem = &bo->mem;
int ret;
ret = ttm_bo_wait(bo, interruptible, no_wait_gpu);
if (ret)
return ret;
if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) { if (old_mem->mem_type == TTM_PL_SYSTEM && bo->ttm == NULL) {
qxl_move_null(bo, new_mem); qxl_move_null(bo, new_mem);
return 0; return 0;
......
...@@ -403,6 +403,10 @@ static int radeon_bo_move(struct ttm_buffer_object *bo, ...@@ -403,6 +403,10 @@ static int radeon_bo_move(struct ttm_buffer_object *bo,
struct ttm_mem_reg *old_mem = &bo->mem; struct ttm_mem_reg *old_mem = &bo->mem;
int r; int r;
r = ttm_bo_wait(bo, interruptible, no_wait_gpu);
if (r)
return r;
/* Can't move a pinned BO */ /* Can't move a pinned BO */
rbo = container_of(bo, struct radeon_bo, tbo); rbo = container_of(bo, struct radeon_bo, tbo);
if (WARN_ON_ONCE(rbo->pin_count > 0)) if (WARN_ON_ONCE(rbo->pin_count > 0))
......
...@@ -375,6 +375,12 @@ static int virtio_gpu_bo_move(struct ttm_buffer_object *bo, ...@@ -375,6 +375,12 @@ static int virtio_gpu_bo_move(struct ttm_buffer_object *bo,
bool no_wait_gpu, bool no_wait_gpu,
struct ttm_mem_reg *new_mem) struct ttm_mem_reg *new_mem)
{ {
int ret;
ret = ttm_bo_wait(bo, interruptible, no_wait_gpu);
if (ret)
return ret;
virtio_gpu_move_null(bo, new_mem); virtio_gpu_move_null(bo, new_mem);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment