drm/ttm: Skip swapout if ttm object is not populated
Subsystems (3)
PATCH 1/1 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]>
--- drivers/gpu/drm/ttm/ttm_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_device.c +1 -1
@@ -145,7 +145,7 @@ int ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,list_for_each_entry (bo, &man->lru[j], lru) {uint32_t num_pages; -if (!bo->ttm || +if (!bo->ttm || !ttm_tt_is_populated (bo->ttm) || bo->ttm->page_flags &TTM_PAGE_FLAG_SG || bo->ttm->page_flags &TTM_PAGE_FLAG_SWAPPED )continue ;
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Am 21.05.21 um 10:31 schrieb xinhui pan:
Quoted 4 lines
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]>
Going to add a CC: stable and pushing that to drm-misc-fixes in a minute.
Quoted 17 lines
--- drivers/gpu/drm/ttm/ttm_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/ttm/ttm_device.c +1
-1@@ -145,7 +145,7 @@ int ttm_device_swapout(struct ttm_device *bdev, struct ttm_operation_ctx *ctx,list_for_each_entry (bo, &man->lru[j], lru) {uint32_t num_pages; -if (!bo->ttm || +if (!bo->ttm || !ttm_tt_is_populated (bo->ttm) || bo->ttm->page_flags &TTM_PAGE_FLAG_SG || bo->ttm->page_flags &TTM_PAGE_FLAG_SWAPPED )continue ;