aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/vmwgfx
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2020-10-20 11:03:18 +1000
committerDave Airlie <airlied@redhat.com>2020-10-21 13:44:28 +1000
commit6d820003295977f865257f1845bcdebc5dab4fb5 (patch)
treeefc350a2cdc7df99d2ac7c1a17fce656d2333c5a /drivers/gpu/drm/vmwgfx
parentdrm/ttm: remove move to new and inline into remainging place. (diff)
downloadlinux-dev-6d820003295977f865257f1845bcdebc5dab4fb5.tar.xz
linux-dev-6d820003295977f865257f1845bcdebc5dab4fb5.zip
drm/ttm: drop move notify around move.
The drivers now do this in the move callback. move_notify is still needed in the destroy path. 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-7-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/vmwgfx')
-rw-r--r--drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
index 6e07ea982961..fd82c9ba2d77 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_buffer.c
@@ -737,6 +737,8 @@ static int vmw_move(struct ttm_buffer_object *bo,
struct ttm_resource_manager *new_man = ttm_manager_type(bo->bdev, new_mem->mem_type);
int ret;
+ vmw_move_notify(bo, evict, new_mem);
+
if (old_man->use_tt && new_man->use_tt) {
if (bo->mem.mem_type == TTM_PL_SYSTEM) {
ttm_bo_assign_mem(bo, new_mem);
@@ -744,15 +746,23 @@ static int vmw_move(struct ttm_buffer_object *bo,
}
ret = ttm_bo_wait_ctx(bo, ctx);
if (ret)
- return ret;
+ goto fail;
vmw_ttm_unbind(bo->bdev, bo->ttm);
ttm_resource_free(bo, &bo->mem);
ttm_bo_assign_mem(bo, new_mem);
return 0;
} else {
- return ttm_bo_move_memcpy(bo, ctx, new_mem);
+ ret = ttm_bo_move_memcpy(bo, ctx, new_mem);
+ if (ret)
+ goto fail;
}
+ return 0;
+fail:
+ swap(*new_mem, bo->mem);
+ vmw_move_notify(bo, false, new_mem);
+ swap(*new_mem, bo->mem);
+ return ret;
}
struct ttm_bo_driver vmw_bo_driver = {