diff options
author | Dave Airlie <airlied@redhat.com> | 2020-10-19 17:13:10 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-10-20 04:54:01 +1000 |
commit | 87ed94238cb57cacb3d2b889f8e37e05a4da9c71 (patch) | |
tree | 6398b6c48488d2c185dd387bef9e6f90e275fb43 /drivers/gpu/drm/ttm/ttm_bo.c | |
parent | cf40c66005920a6d4932a1a259076459464adf32 (diff) |
drm/ttm: refactor out common code to setup a new tt backed resource
This factors out the code to setup non-system tt.
The same code was used twice in the move paths.
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-2-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_bo.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_bo.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index b97ed6ca8765..cbc74a320db2 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -252,15 +252,9 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo, if (ret) goto out_err; - if (mem->mem_type != TTM_PL_SYSTEM) { - ret = ttm_tt_populate(bdev, bo->ttm, ctx); - if (ret) - goto out_err; - - ret = ttm_bo_tt_bind(bo, mem); - if (ret) - goto out_err; - } + ret = ttm_bo_move_to_new_tt_mem(bo, ctx, mem); + if (ret) + goto out_err; } if (bdev->driver->move_notify) |