diff options
author | Dave Airlie <airlied@redhat.com> | 2020-09-15 11:34:51 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-09-16 09:35:30 +1000 |
commit | 9e9a153bdf2555a931fd37678a8e44d170a5d943 (patch) | |
tree | 1da6cf699fc948cec069a258edaa55020489e4bb /drivers/gpu/drm/ttm/ttm_tt.c | |
parent | 2040ec970e94dde0b94e200ae9bb8f21a61c928f (diff) | |
download | linux-9e9a153bdf2555a931fd37678a8e44d170a5d943.tar.bz2 |
drm/ttm: move ttm binding/unbinding out of ttm_tt paths.
Move these up to the bo level, moving ttm_tt to just being
backing store. Next step is to move the bound flag out.
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200915024007.67163-6-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_tt.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_tt.c | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 93d65e5e4205..a4f0296effac 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -209,8 +209,6 @@ EXPORT_SYMBOL(ttm_tt_set_placement_caching); void ttm_tt_destroy(struct ttm_bo_device *bdev, struct ttm_tt *ttm) { - ttm_tt_unbind(bdev, ttm); - ttm_tt_unpopulate(bdev, ttm); if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP) && @@ -303,35 +301,6 @@ void ttm_dma_tt_fini(struct ttm_dma_tt *ttm_dma) } EXPORT_SYMBOL(ttm_dma_tt_fini); -void ttm_tt_unbind(struct ttm_bo_device *bdev, struct ttm_tt *ttm) -{ - if (ttm_tt_is_bound(ttm)) { - bdev->driver->ttm_tt_unbind(bdev, ttm); - ttm_tt_set_unbound(ttm); - } -} - -int ttm_tt_bind(struct ttm_bo_device *bdev, - struct ttm_tt *ttm, struct ttm_resource *bo_mem) -{ - int ret = 0; - - if (!ttm) - return -EINVAL; - - if (ttm_tt_is_bound(ttm)) - return 0; - - ret = bdev->driver->ttm_tt_bind(bdev, ttm, bo_mem); - if (unlikely(ret != 0)) - return ret; - - ttm_tt_set_bound(ttm); - - return 0; -} -EXPORT_SYMBOL(ttm_tt_bind); - int ttm_tt_swapin(struct ttm_tt *ttm) { struct address_space *swap_space; |