summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/xe/xe_migrate.c
diff options
context:
space:
mode:
authorMatthew Auld <matthew.auld@intel.com>2023-05-25 14:45:43 +0300
committerRodrigo Vivi <rodrigo.vivi@intel.com>2023-12-20 02:34:04 +0300
commita2f9f4ff07aac81e80ff1e0913fdbfdde6ba6665 (patch)
treed9c8407421e0b29ce69f26495e4bac1f635eca44 /drivers/gpu/drm/xe/xe_migrate.c
parent38453f826db89045d505c2122fd8e25cd6099007 (diff)
downloadlinux-a2f9f4ff07aac81e80ff1e0913fdbfdde6ba6665.tar.xz
drm/xe/migrate: retain CCS aux state for vram -> vram
There is no mention that migrate_copy() will skip copying the CCS aux state for all types of vram -> vram transfers. Currently we don't need such a facility but might be surprising if we ever do. v2: (Lucas): - s/lmem/vram/ in the commit message - Tidy up the code a bit; use one emit_copy_ccs() v3: - Reword the commit message Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Lucas De Marchi <lucas.demarchi@intel.com> Acked-by: Nirmoy Das <nirmoy.das@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_migrate.c')
-rw-r--r--drivers/gpu/drm/xe/xe_migrate.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/drm/xe/xe_migrate.c b/drivers/gpu/drm/xe/xe_migrate.c
index 7d0a23577d36..9a676287e741 100644
--- a/drivers/gpu/drm/xe/xe_migrate.c
+++ b/drivers/gpu/drm/xe/xe_migrate.c
@@ -552,11 +552,19 @@ static u32 xe_migrate_ccs_copy(struct xe_migrate *m,
if (xe_device_has_flat_ccs(gt_to_xe(gt)) && !copy_ccs && dst_is_vram) {
/*
- * If the bo doesn't have any CCS metadata attached, we still
- * need to clear it for security reasons.
+ * If the src is already in vram, then it should already
+ * have been cleared by us, or has been populated by the
+ * user. Make sure we copy the CCS aux state as-is.
+ *
+ * Otherwise if the bo doesn't have any CCS metadata attached,
+ * we still need to clear it for security reasons.
*/
- emit_copy_ccs(gt, bb, dst_ofs, true, m->cleared_vram_ofs, false,
- dst_size);
+ u64 ccs_src_ofs = src_is_vram ? src_ofs : m->cleared_vram_ofs;
+
+ emit_copy_ccs(gt, bb,
+ dst_ofs, true,
+ ccs_src_ofs, src_is_vram, dst_size);
+
flush_flags = MI_FLUSH_DW_CCS;
} else if (copy_ccs) {
if (!src_is_vram)