Commit 5109d297 authored by Christian König's avatar Christian König

drm/ttm: properly allocate sys resource during swapout

Drop the special handling here.
Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210430092508.60710-3-christian.koenig@amd.com
parent d79025c7
...@@ -1166,14 +1166,16 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx, ...@@ -1166,14 +1166,16 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
if (bo->mem.mem_type != TTM_PL_SYSTEM) { if (bo->mem.mem_type != TTM_PL_SYSTEM) {
struct ttm_operation_ctx ctx = { false, false }; struct ttm_operation_ctx ctx = { false, false };
struct ttm_resource evict_mem; struct ttm_resource evict_mem;
struct ttm_place hop; struct ttm_place place, hop;
memset(&place, 0, sizeof(place));
memset(&hop, 0, sizeof(hop)); memset(&hop, 0, sizeof(hop));
evict_mem = bo->mem; place.mem_type = TTM_PL_SYSTEM;
evict_mem.mm_node = NULL;
evict_mem.placement = 0; ret = ttm_resource_alloc(bo, &place, &evict_mem);
evict_mem.mem_type = TTM_PL_SYSTEM; if (unlikely(ret))
goto out;
ret = ttm_bo_handle_move_mem(bo, &evict_mem, true, &ctx, &hop); ret = ttm_bo_handle_move_mem(bo, &evict_mem, true, &ctx, &hop);
if (unlikely(ret != 0)) { if (unlikely(ret != 0)) {
......
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