radeonsi/gfx12: remove CP DMA workarounds because CP DMA is never used on gfx12

except for cache prefetches.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31168>
This commit is contained in:
Marek Olšák 2024-08-21 15:39:54 -04:00
parent c5ee7ca4d6
commit c90d4e0d57
2 changed files with 8 additions and 8 deletions

View file

@ -187,6 +187,7 @@ void si_cp_dma_clear_buffer(struct si_context *sctx, struct radeon_cmdbuf *cs,
uint64_t va = (sdst ? sdst->gpu_address : 0) + offset;
bool is_first = true;
assert(!sctx->screen->info.cp_sdma_ge_use_system_memory_scope);
assert(size && size % 4 == 0);
if (user_flags & SI_OP_SYNC_GE_BEFORE)
@ -198,10 +199,6 @@ void si_cp_dma_clear_buffer(struct si_context *sctx, struct radeon_cmdbuf *cs,
if (user_flags & SI_OP_SYNC_PS_BEFORE)
sctx->flags |= SI_CONTEXT_PS_PARTIAL_FLUSH;
/* TODO: Range-invalidate GL2 or always use compute shaders */
if (sctx->screen->info.cp_sdma_ge_use_system_memory_scope)
sctx->flags |= SI_CONTEXT_INV_L2;
/* Mark the buffer range of destination as valid (initialized),
* so that transfer_map knows it should wait for the GPU when mapping
* that range. */
@ -303,6 +300,7 @@ void si_cp_dma_copy_buffer(struct si_context *sctx, struct pipe_resource *dst,
unsigned gds_flags = (dst ? 0 : CP_DMA_DST_IS_GDS) | (src ? 0 : CP_DMA_SRC_IS_GDS);
bool is_first = true;
assert(!sctx->screen->info.cp_sdma_ge_use_system_memory_scope);
assert(size);
if (dst) {
@ -364,10 +362,6 @@ void si_cp_dma_copy_buffer(struct si_context *sctx, struct pipe_resource *dst,
if ((dst || src) && !(user_flags & SI_OP_SKIP_CACHE_INV_BEFORE))
sctx->flags |= si_get_flush_flags(sctx, coher, cache_policy);
/* TODO: Range-flush GL2 for src and range-invalidate GL2 for dst, or always use compute shaders */
if (sctx->screen->info.cp_sdma_ge_use_system_memory_scope)
sctx->flags |= SI_CONTEXT_INV_L2;
if (sctx->flags)
si_mark_atom_dirty(sctx, &sctx->atoms.s.cache_flush);

View file

@ -215,6 +215,12 @@ void si_test_dma_perf(struct si_screen *sscreen)
}
} else if (method == METHOD_CP_DMA) {
/* CP DMA */
if (sscreen->info.cp_sdma_ge_use_system_memory_scope) {
/* The CP DMA code doesn't implement this case. */
success = false;
continue;
}
if (is_copy) {
si_cp_dma_copy_buffer(sctx, dst, src, dst_offset, src_offset, size,
SI_OP_SYNC_BEFORE_AFTER, SI_COHERENCY_SHADER, L2_LRU);