drm/ttm: move swapin out of page alloc backend

This is not related to allocating the backing store in any way.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/396947/
This commit is contained in:
Christian König 2020-10-19 18:56:45 +02:00
parent d1cb1f254a
commit 05f8d25097
3 changed files with 8 additions and 16 deletions

View File

@ -1071,14 +1071,6 @@ int ttm_pool_populate(struct ttm_tt *ttm, struct ttm_operation_ctx *ctx)
}
}
if (unlikely(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)) {
ret = ttm_tt_swapin(ttm);
if (unlikely(ret != 0)) {
ttm_pool_unpopulate(ttm);
return ret;
}
}
return 0;
}
EXPORT_SYMBOL(ttm_pool_populate);

View File

@ -975,14 +975,6 @@ skip_huge:
--num_pages;
}
if (unlikely(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)) {
ret = ttm_tt_swapin(ttm);
if (unlikely(ret != 0)) {
ttm_dma_unpopulate(ttm_dma, dev);
return ret;
}
}
return 0;
}
EXPORT_SYMBOL_GPL(ttm_dma_populate);

View File

@ -338,6 +338,14 @@ int ttm_tt_populate(struct ttm_bo_device *bdev,
ttm_tt_add_mapping(bdev, ttm);
ttm->page_flags |= TTM_PAGE_FLAG_PRIV_POPULATED;
if (unlikely(ttm->page_flags & TTM_PAGE_FLAG_SWAPPED)) {
ret = ttm_tt_swapin(ttm);
if (unlikely(ret != 0)) {
ttm_tt_unpopulate(bdev, ttm);
return ret;
}
}
return 0;
}
EXPORT_SYMBOL(ttm_tt_populate);