Commit a2dcf77f authored by Dave Airlie's avatar Dave Airlie

drm/ttm: minor cleanup to move to system

resource free already sets the domain to system, and old_mem
isn't really needed.
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201020010319.1692445-3-airlied@gmail.com
parent 9764c353
...@@ -68,10 +68,9 @@ int ttm_bo_move_to_new_tt_mem(struct ttm_buffer_object *bo, ...@@ -68,10 +68,9 @@ int ttm_bo_move_to_new_tt_mem(struct ttm_buffer_object *bo,
int ttm_bo_move_to_system(struct ttm_buffer_object *bo, int ttm_bo_move_to_system(struct ttm_buffer_object *bo,
struct ttm_operation_ctx *ctx) struct ttm_operation_ctx *ctx)
{ {
struct ttm_resource *old_mem = &bo->mem;
int ret; int ret;
if (old_mem->mem_type == TTM_PL_SYSTEM) if (bo->mem.mem_type == TTM_PL_SYSTEM)
return 0; return 0;
ret = ttm_bo_wait_ctx(bo, ctx); ret = ttm_bo_wait_ctx(bo, ctx);
...@@ -83,7 +82,6 @@ int ttm_bo_move_to_system(struct ttm_buffer_object *bo, ...@@ -83,7 +82,6 @@ int ttm_bo_move_to_system(struct ttm_buffer_object *bo,
ttm_bo_tt_unbind(bo); ttm_bo_tt_unbind(bo);
ttm_resource_free(bo, &bo->mem); ttm_resource_free(bo, &bo->mem);
old_mem->mem_type = TTM_PL_SYSTEM;
return 0; return 0;
} }
EXPORT_SYMBOL(ttm_bo_move_to_system); EXPORT_SYMBOL(ttm_bo_move_to_system);
......
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