Commit 05f8d250 authored by Christian König's avatar Christian König

drm/ttm: move swapin out of page alloc backend

This is not related to allocating the backing store in any way.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/396947/
parent d1cb1f25
......@@ -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);
......
......@@ -975,14 +975,6 @@ int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev,
--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);
......
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment