提交 24243212 编写于 作者: M Matthew Auld 提交者: Christian König

drm/ttm: clear the ttm_tt when bo->resource is NULL

In the next few patches, when initially creating a ttm BO, the
bo->resource is NULL, and the driver is then expected to handle the
initial dummy move.  However, if this is created as a system resource
the first ttm_tt we create will always have the clear value set to
false. Previously the initial ttm_tt would be created in
ttm_bo_validate() with the clear parameter always set to true.
Signed-off-by: NMatthew Auld <matthew.auld@intel.com>
Reviewed-by: NChristian König <ckoenig.leichtzumerken@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230130101230.25347-3-matthew.auld@intel.comAcked-by: NNirmoy Das <nirmoy.das@intel.com>
Signed-off-by: NChristian König <christian.koenig@amd.com>
上级 58c7ee06
......@@ -120,8 +120,7 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
bool old_use_tt, new_use_tt;
int ret;
old_use_tt = bo->resource &&
ttm_manager_type(bdev, bo->resource->mem_type)->use_tt;
old_use_tt = !bo->resource || ttm_manager_type(bdev, bo->resource->mem_type)->use_tt;
new_use_tt = ttm_manager_type(bdev, mem->mem_type)->use_tt;
ttm_bo_unmap_virtual(bo);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册