Skip to content

Commit c0e2508

Browse files
hghimiraThomas Hellström
authored andcommitted
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 <[email protected]> Cc: Thomas Hellström <[email protected]> Fixes: 65ef8db ("drm/xe/xe2: Update emit_pte to use compression enabled PAT index") Signed-off-by: Himal Prasad Ghimiray <[email protected]> Reviewed-by: Thomas Hellström <[email protected]> Signed-off-by: Thomas Hellström <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] (cherry picked from commit 6a02867) Signed-off-by: Thomas Hellström <[email protected]>
1 parent 981460d commit c0e2508

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

drivers/gpu/drm/xe/xe_migrate.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ static void emit_pte(struct xe_migrate *m,
472472
/* Indirect access needs compression enabled uncached PAT index */
473473
if (GRAPHICS_VERx100(xe) >= 2000)
474474
pat_index = is_comp_pte ? xe->pat.idx[XE_CACHE_NONE_COMPRESSION] :
475-
xe->pat.idx[XE_CACHE_NONE];
475+
xe->pat.idx[XE_CACHE_WB];
476476
else
477477
pat_index = xe->pat.idx[XE_CACHE_WB];
478478

@@ -760,14 +760,14 @@ struct dma_fence *xe_migrate_copy(struct xe_migrate *m,
760760
if (src_is_vram && xe_migrate_allow_identity(src_L0, &src_it))
761761
xe_res_next(&src_it, src_L0);
762762
else
763-
emit_pte(m, bb, src_L0_pt, src_is_vram, true, &src_it, src_L0,
764-
src);
763+
emit_pte(m, bb, src_L0_pt, src_is_vram, copy_system_ccs,
764+
&src_it, src_L0, src);
765765

766766
if (dst_is_vram && xe_migrate_allow_identity(src_L0, &dst_it))
767767
xe_res_next(&dst_it, src_L0);
768768
else
769-
emit_pte(m, bb, dst_L0_pt, dst_is_vram, true, &dst_it, src_L0,
770-
dst);
769+
emit_pte(m, bb, dst_L0_pt, dst_is_vram, copy_system_ccs,
770+
&dst_it, src_L0, dst);
771771

772772
if (copy_system_ccs)
773773
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,
10091009
if (clear_vram && xe_migrate_allow_identity(clear_L0, &src_it))
10101010
xe_res_next(&src_it, clear_L0);
10111011
else
1012-
emit_pte(m, bb, clear_L0_pt, clear_vram, true, &src_it, clear_L0,
1013-
dst);
1012+
emit_pte(m, bb, clear_L0_pt, clear_vram, clear_system_ccs,
1013+
&src_it, clear_L0, dst);
10141014

10151015
bb->cs[bb->len++] = MI_BATCH_BUFFER_END;
10161016
update_idx = bb->len;

0 commit comments

Comments
 (0)