提交 e44fcf71 编写于 作者: C Christian König 提交者: Alex Deucher

drm/ttm: add default implementations for ttm_tt_(un)populate

Use ttm_pool_populate/ttm_pool_unpopulate if the driver doesn't provide
a function.
Signed-off-by: NChristian König <christian.koenig@amd.com>
Reviewed-by: NMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 cd277585
......@@ -410,7 +410,10 @@ int ttm_tt_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
if (ttm->state != tt_unpopulated)
return 0;
ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
if (ttm->bdev->driver->ttm_tt_populate)
ret = ttm->bdev->driver->ttm_tt_populate(ttm, ctx);
else
ret = ttm_pool_populate(ttm, ctx);
if (!ret)
ttm_tt_add_mapping(ttm);
return ret;
......@@ -436,5 +439,8 @@ void ttm_tt_unpopulate(struct ttm_tt *ttm)
return;
ttm_tt_clear_mapping(ttm);
ttm->bdev->driver->ttm_tt_unpopulate(ttm);
if (ttm->bdev->driver->ttm_tt_unpopulate)
ttm->bdev->driver->ttm_tt_unpopulate(ttm);
else
ttm_pool_unpopulate(ttm);
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册