Skip to content

Commit 35f819d

Browse files
xinhui panChristianKoenigAMD
authored andcommitted
drm/ttm: Skip swapout if ttm object is not populated
Swapping a ttm object which has no backend pages makes no sense. Suggested-by: Christian König <[email protected]> Signed-off-by: xinhui pan <[email protected]> Reviewed-by: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] CC: [email protected] Signed-off-by: Christian König <[email protected]>
1 parent 7cfc4ea commit 35f819d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/ttm/ttm_device.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ int ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,
145145
list_for_each_entry(bo, &man->lru[j], lru) {
146146
uint32_t num_pages;
147147

148-
if (!bo->ttm ||
148+
if (!bo->ttm || !ttm_tt_is_populated(bo->ttm) ||
149149
bo->ttm->page_flags & TTM_PAGE_FLAG_SG ||
150150
bo->ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)
151151
continue;

0 commit comments

Comments
 (0)