Skip to content

Commit 1047bd8

Browse files
author
Thomas Hellström
committed
drm/xe: Fix incorrect migration of backed-up object to VRAM
If an object is backed up to shmem it is incorrectly identified as not having valid data by the move code. This means moving to VRAM skips the -EMULTIHOP step and the bo is cleared. This causes all sorts of weird behaviour on DGFX if an already evicted object is targeted by the shrinker. Fix this by using ttm_tt_is_swapped() to identify backed-up objects. Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/5996 Fixes: 00c8efc ("drm/xe: Add a shrinker for xe bos") Cc: Matthew Brost <[email protected]> Cc: Matthew Auld <[email protected]> Cc: <[email protected]> # v6.15+ Signed-off-by: Thomas Hellström <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent eeb8117 commit 1047bd8

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

drivers/gpu/drm/xe/xe_bo.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,7 @@ static int xe_bo_move(struct ttm_buffer_object *ttm_bo, bool evict,
823823
return ret;
824824
}
825825

826-
tt_has_data = ttm && (ttm_tt_is_populated(ttm) ||
827-
(ttm->page_flags & TTM_TT_FLAG_SWAPPED));
826+
tt_has_data = ttm && (ttm_tt_is_populated(ttm) || ttm_tt_is_swapped(ttm));
828827

829828
move_lacks_source = !old_mem || (handle_system_ccs ? (!bo->ccs_cleared) :
830829
(!mem_type_is_vram(old_mem_type) && !tt_has_data));

0 commit comments

Comments
 (0)