Skip to content

Commit fee58ca

Browse files
matt-auldlucasdemarchi
authored andcommitted
drm/xe/bmg: fix compressed VRAM handling
There looks to be an issue in our compression handling when the BO pages are very fragmented, where we choose to skip the identity map and instead fall back to emitting the PTEs by hand when migrating memory, such that we can hopefully do more work per blit operation. However in such a case we need to ensure the src PTEs are correctly tagged with a compression enabled PAT index on dgpu xe2+, otherwise the copy will simply treat the src memory as uncompressed, leading to corruption if the memory was compressed by the user. To fix this pass along use_comp_pat into emit_pte() on the src side, to indicate that compression should be considered. v2 (Jonathan): tweak the commit message Fixes: 523f191 ("drm/xe/xe_migrate: Handle migration logic for xe2+ dgfx") Signed-off-by: Matthew Auld <[email protected]> Cc: Himal Prasad Ghimiray <[email protected]> Cc: Thomas Hellström <[email protected]> Cc: Akshata Jahagirdar <[email protected]> Cc: <[email protected]> # v6.12+ Reviewed-by: Jonathan Cavitt <[email protected]> Link: https://lore.kernel.org/r/[email protected] (cherry picked from commit f7a2fd7) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent daa099f commit fee58ca

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
863863
if (src_is_vram && xe_migrate_allow_identity(src_L0, &src_it))
864864
xe_res_next(&src_it, src_L0);
865865
else
866-
emit_pte(m, bb, src_L0_pt, src_is_vram, copy_system_ccs,
866+
emit_pte(m, bb, src_L0_pt, src_is_vram, copy_system_ccs || use_comp_pat,
867867
&src_it, src_L0, src);
868868

869869
if (dst_is_vram && xe_migrate_allow_identity(src_L0, &dst_it))

0 commit comments

Comments
 (0)