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

drm/ttm: move initializing ttm->sg into ttm_tt_init_fields

Better to set this with all other fields as well.
Signed-off-by: NChristian König <christian.koenig@amd.com>
Reviewed-by: NRoger He <Hongbo.He@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 dde5da23
...@@ -77,9 +77,6 @@ int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc) ...@@ -77,9 +77,6 @@ int ttm_tt_create(struct ttm_buffer_object *bo, bool zero_alloc)
if (unlikely(bo->ttm == NULL)) if (unlikely(bo->ttm == NULL))
return -ENOMEM; return -ENOMEM;
if (bo->type == ttm_bo_type_sg)
bo->ttm->sg = bo->sg;
return 0; return 0;
} }
...@@ -245,6 +242,7 @@ void ttm_tt_init_fields(struct ttm_tt *ttm, struct ttm_buffer_object *bo, ...@@ -245,6 +242,7 @@ void ttm_tt_init_fields(struct ttm_tt *ttm, struct ttm_buffer_object *bo,
ttm->page_flags = page_flags; ttm->page_flags = page_flags;
ttm->state = tt_unpopulated; ttm->state = tt_unpopulated;
ttm->swap_storage = NULL; ttm->swap_storage = NULL;
ttm->sg = bo->sg;
} }
int ttm_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo, int ttm_tt_init(struct ttm_tt *ttm, struct ttm_buffer_object *bo,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册