Skip to content

Commit c4dfa0b

Browse files
sanjayumangmatt-auld
authored andcommitted
drm/xe/migrate: Remove unneeded emit_pte() when copying CCS only
In xe_migrate_copy(), when copy_only_ccs is true, we only need two emit_pte() calls one for the BO and one for the raw CCS storage. However, the current implementation issues three emit_pte() calls, resulting in an unnecessary PTE programming job. This fix removes the redundant emit_pte() call to avoid programming the same PTEs twice and reducing overhead during CCS-only migration. v2: Preserve correct behavior on DG2, which requires both CCS and page copies. Signed-off-by: Sanjay Yadav <sanjay.kumar.yadav@intel.com> Suggested-by: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Matthew Auld <matthew.auld@intel.com> Link: https://lore.kernel.org/r/20250904161423.2448727-1-sanjay.kumar.yadav@intel.com
1 parent 2d1e962 commit c4dfa0b

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -842,11 +842,15 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
842842
batch_size += pte_update_size(m, pte_flags, src, &src_it, &src_L0,
843843
&src_L0_ofs, &src_L0_pt, 0, 0,
844844
avail_pts);
845-
846-
pte_flags = dst_is_vram ? PTE_UPDATE_FLAG_IS_VRAM : 0;
847-
batch_size += pte_update_size(m, pte_flags, dst, &dst_it, &src_L0,
848-
&dst_L0_ofs, &dst_L0_pt, 0,
849-
avail_pts, avail_pts);
845+
if (copy_only_ccs) {
846+
dst_L0_ofs = src_L0_ofs;
847+
} else {
848+
pte_flags = dst_is_vram ? PTE_UPDATE_FLAG_IS_VRAM : 0;
849+
batch_size += pte_update_size(m, pte_flags, dst,
850+
&dst_it, &src_L0,
851+
&dst_L0_ofs, &dst_L0_pt,
852+
0, avail_pts, avail_pts);
853+
}
850854

851855
if (copy_system_ccs) {
852856
xe_assert(xe, type_device);
@@ -876,7 +880,7 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
876880

877881
if (dst_is_vram && xe_migrate_allow_identity(src_L0, &dst_it))
878882
xe_res_next(&dst_it, src_L0);
879-
else
883+
else if (!copy_only_ccs)
880884
emit_pte(m, bb, dst_L0_pt, dst_is_vram, copy_system_ccs,
881885
&dst_it, src_L0, dst);
882886

0 commit comments

Comments
 (0)