Skip to content

Commit e485382

Browse files
drm/ttm: fix ttm_bo_swapout
Commit 7120a44 ("drm/ttm: Double check mem_type of BO while eviction") made ttm_bo_evict_swapout_allowable() function actually check the placement, but we always used a dummy placement in ttm_bo_swapout. Fix this by using the real placement instead. Signed-off-by: Christian König <christian.koenig@amd.com> Fixes: 7120a44 ("drm/ttm: Double check mem_type of BO while eviction") Reviewed-by: Pan, Xinhui <Xinhui.Pan@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20211202103828.44573-1-christian.koenig@amd.com
1 parent 679d94c commit e485382

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/ttm/ttm_bo.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
11031103
* as an indication that we're about to swap out.
11041104
*/
11051105
memset(&place, 0, sizeof(place));
1106-
place.mem_type = TTM_PL_SYSTEM;
1106+
place.mem_type = bo->resource->mem_type;
11071107
if (!ttm_bo_evict_swapout_allowable(bo, ctx, &place, &locked, NULL))
11081108
return -EBUSY;
11091109

@@ -1135,6 +1135,7 @@ int ttm_bo_swapout(struct ttm_buffer_object *bo, struct ttm_operation_ctx *ctx,
11351135
struct ttm_place hop;
11361136

11371137
memset(&hop, 0, sizeof(hop));
1138+
place.mem_type = TTM_PL_SYSTEM;
11381139
ret = ttm_resource_alloc(bo, &place, &evict_mem);
11391140
if (unlikely(ret))
11401141
goto out;

0 commit comments

Comments
 (0)