Commit c0e2508c authored by Himal Prasad Ghimiray's avatar Himal Prasad Ghimiray Committed by Thomas Hellström

drm/xe/xe2: Use XE_CACHE_WB pat index

The pat table entry associated with XE_CACHE_WB is coherent whereas
XE_CACHE_NONE is non coherent. Migration expects the coherency
with cpu therefore use the coherent entry XE_CACHE_WB for
buffers not supporting compression. For read/write to flat ccs region
the issue is not related to coherency with cpu. The hardware expects
the pat index associated with GPUVA for indirect access to be
compression enabled hence use XE_CACHE_NONE_COMPRESSION.

v2
- Fix the argument to emit_pte, pass the bool directly. (Thomas)

v3
- Rebase
- Update commit message (Matt)

v4
- Add a Fixes: tag. (Thomas)

Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Fixes: 65ef8dba ("drm/xe/xe2: Update emit_pte to use compression enabled PAT index")
Signed-off-by: default avatarHimal Prasad Ghimiray <himal.prasad.ghimiray@intel.com>
Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240119041826.1670496-1-himal.prasad.ghimiray@intel.com
(cherry picked from commit 6a028675)
Signed-off-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
parent 981460d8
...@@ -472,7 +472,7 @@ static void emit_pte(struct xe_migrate *m, ...@@ -472,7 +472,7 @@ static void emit_pte(struct xe_migrate *m,
/* Indirect access needs compression enabled uncached PAT index */ /* Indirect access needs compression enabled uncached PAT index */
if (GRAPHICS_VERx100(xe) >= 2000) if (GRAPHICS_VERx100(xe) >= 2000)
pat_index = is_comp_pte ? xe->pat.idx[XE_CACHE_NONE_COMPRESSION] : pat_index = is_comp_pte ? xe->pat.idx[XE_CACHE_NONE_COMPRESSION] :
xe->pat.idx[XE_CACHE_NONE]; xe->pat.idx[XE_CACHE_WB];
else else
pat_index = xe->pat.idx[XE_CACHE_WB]; pat_index = xe->pat.idx[XE_CACHE_WB];
...@@ -760,14 +760,14 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m, ...@@ -760,14 +760,14 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
if (src_is_vram && xe_migrate_allow_identity(src_L0, &src_it)) if (src_is_vram && xe_migrate_allow_identity(src_L0, &src_it))
xe_res_next(&src_it, src_L0); xe_res_next(&src_it, src_L0);
else else
emit_pte(m, bb, src_L0_pt, src_is_vram, true, &src_it, src_L0, emit_pte(m, bb, src_L0_pt, src_is_vram, copy_system_ccs,
src); &src_it, src_L0, src);
if (dst_is_vram && xe_migrate_allow_identity(src_L0, &dst_it)) if (dst_is_vram && xe_migrate_allow_identity(src_L0, &dst_it))
xe_res_next(&dst_it, src_L0); xe_res_next(&dst_it, src_L0);
else else
emit_pte(m, bb, dst_L0_pt, dst_is_vram, true, &dst_it, src_L0, emit_pte(m, bb, dst_L0_pt, dst_is_vram, copy_system_ccs,
dst); &dst_it, src_L0, dst);
if (copy_system_ccs) if (copy_system_ccs)
emit_pte(m, bb, ccs_pt, false, false, &ccs_it, ccs_size, src); emit_pte(m, bb, ccs_pt, false, false, &ccs_it, ccs_size, src);
...@@ -1009,8 +1009,8 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m, ...@@ -1009,8 +1009,8 @@ struct dma_fence *xe_migrate_clear(struct xe_migrate *m,
if (clear_vram && xe_migrate_allow_identity(clear_L0, &src_it)) if (clear_vram && xe_migrate_allow_identity(clear_L0, &src_it))
xe_res_next(&src_it, clear_L0); xe_res_next(&src_it, clear_L0);
else else
emit_pte(m, bb, clear_L0_pt, clear_vram, true, &src_it, clear_L0, emit_pte(m, bb, clear_L0_pt, clear_vram, clear_system_ccs,
dst); &src_it, clear_L0, dst);
bb->cs[bb->len++] = MI_BATCH_BUFFER_END; bb->cs[bb->len++] = MI_BATCH_BUFFER_END;
update_idx = bb->len; update_idx = bb->len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment