diff options
author | Dave Airlie <airlied@redhat.com> | 2020-09-15 11:16:53 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2020-09-16 09:34:54 +1000 |
commit | 2040ec970e94dde0b94e200ae9bb8f21a61c928f (patch) | |
tree | ee69d70cc3bf124bf28ddc5276fe632c042e1ed8 /drivers/gpu/drm/ttm/ttm_tt.c | |
parent | 395a73f8ba6f00f0e188ac6daa43659520d75498 (diff) |
drm/ttm: split populate out from binding.
Drivers have to call populate themselves now before binding.
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-5-airlied@gmail.com
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_tt.c')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_tt.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/drivers/gpu/drm/ttm/ttm_tt.c b/drivers/gpu/drm/ttm/ttm_tt.c index 381face3cedb..93d65e5e4205 100644 --- a/drivers/gpu/drm/ttm/ttm_tt.c +++ b/drivers/gpu/drm/ttm/ttm_tt.c @@ -312,8 +312,7 @@ void ttm_tt_unbind(struct ttm_bo_device *bdev, struct ttm_tt *ttm) } int ttm_tt_bind(struct ttm_bo_device *bdev, - struct ttm_tt *ttm, struct ttm_resource *bo_mem, - struct ttm_operation_ctx *ctx) + struct ttm_tt *ttm, struct ttm_resource *bo_mem) { int ret = 0; @@ -323,10 +322,6 @@ int ttm_tt_bind(struct ttm_bo_device *bdev, if (ttm_tt_is_bound(ttm)) return 0; - ret = ttm_tt_populate(bdev, ttm, ctx); - if (ret) - return ret; - ret = bdev->driver->ttm_tt_bind(bdev, ttm, bo_mem); if (unlikely(ret != 0)) return ret; @@ -455,6 +450,9 @@ int ttm_tt_populate(struct ttm_bo_device *bdev, { int ret; + if (!ttm) + return -EINVAL; + if (ttm_tt_is_populated(ttm)) return 0; @@ -466,6 +464,7 @@ int ttm_tt_populate(struct ttm_bo_device *bdev, ttm_tt_add_mapping(bdev, ttm); return ret; } +EXPORT_SYMBOL(ttm_tt_populate); static void ttm_tt_clear_mapping(struct ttm_tt *ttm) { |