Skip to content

Commit 2424321

Browse files
matt-auldChristianKoenigAMD
authored andcommitted
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: Matthew Auld <[email protected]> Reviewed-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Acked-by: Nirmoy Das <[email protected]> Signed-off-by: Christian König <[email protected]>
1 parent 58c7ee0 commit 2424321

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,7 @@ static int ttm_bo_handle_move_mem(struct ttm_buffer_object *bo,
120120
bool old_use_tt, new_use_tt;
121121
int ret;
122122

123-
old_use_tt = bo->resource &&
124-
ttm_manager_type(bdev, bo->resource->mem_type)->use_tt;
123+
old_use_tt = !bo->resource || ttm_manager_type(bdev, bo->resource->mem_type)->use_tt;
125124
new_use_tt = ttm_manager_type(bdev, mem->mem_type)->use_tt;
126125

127126
ttm_bo_unmap_virtual(bo);

0 commit comments

Comments
 (0)