From dd5e9af78ff2753c9d01554bc45eff150ae029ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 19 Mar 2021 18:39:23 -0400 Subject: [PATCH] radeonsi: remove unused SI_CP_DMA_SKIP_* definitions The existing uses had no effect. Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_cp_dma.c | 35 ++++++++---------------- src/gallium/drivers/radeonsi/si_pipe.c | 2 +- src/gallium/drivers/radeonsi/si_pipe.h | 5 ---- 3 files changed, 13 insertions(+), 29 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_cp_dma.c b/src/gallium/drivers/radeonsi/si_cp_dma.c index 5c1cd39e9b6..a28c30cb835 100644 --- a/src/gallium/drivers/radeonsi/si_cp_dma.c +++ b/src/gallium/drivers/radeonsi/si_cp_dma.c @@ -146,32 +146,22 @@ static void si_cp_dma_prepare(struct si_context *sctx, struct pipe_resource *dst uint64_t remaining_size, unsigned user_flags, enum si_coherency coher, bool *is_first, unsigned *packet_flags) { - /* Fast exit for a CPDMA prefetch. */ - if ((user_flags & SI_CPDMA_SKIP_ALL) == SI_CPDMA_SKIP_ALL) { - *is_first = false; - return; - } - - if (!(user_flags & SI_CPDMA_SKIP_BO_LIST_UPDATE)) { - /* Count memory usage in so that need_cs_space can take it into account. */ - if (dst) - si_context_add_resource_size(sctx, dst); - if (src) - si_context_add_resource_size(sctx, src); - } + /* Count memory usage in so that need_cs_space can take it into account. */ + if (dst) + si_context_add_resource_size(sctx, dst); + if (src) + si_context_add_resource_size(sctx, src); if (!(user_flags & SI_CPDMA_SKIP_CHECK_CS_SPACE)) si_need_gfx_cs_space(sctx, 0); /* This must be done after need_cs_space. */ - if (!(user_flags & SI_CPDMA_SKIP_BO_LIST_UPDATE)) { - if (dst) - radeon_add_to_buffer_list(sctx, &sctx->gfx_cs, si_resource(dst), RADEON_USAGE_WRITE, - RADEON_PRIO_CP_DMA); - if (src) - radeon_add_to_buffer_list(sctx, &sctx->gfx_cs, si_resource(src), RADEON_USAGE_READ, - RADEON_PRIO_CP_DMA); - } + if (dst) + radeon_add_to_buffer_list(sctx, &sctx->gfx_cs, si_resource(dst), RADEON_USAGE_WRITE, + RADEON_PRIO_CP_DMA); + if (src) + radeon_add_to_buffer_list(sctx, &sctx->gfx_cs, si_resource(src), RADEON_USAGE_READ, + RADEON_PRIO_CP_DMA); /* Flush the caches for the first copy only. * Also wait for the previous CP DMA operations. @@ -336,8 +326,7 @@ void si_cp_dma_copy_buffer(struct si_context *sctx, struct pipe_resource *dst, } /* TMZ handling */ - if (unlikely(radeon_uses_secure_bos(sctx->ws) && - !(user_flags & SI_CPDMA_SKIP_TMZ))) { + if (unlikely(radeon_uses_secure_bos(sctx->ws))) { bool secure = src && (si_resource(src)->flags & RADEON_FLAG_ENCRYPTED); assert(!secure || (!dst || (si_resource(dst)->flags & RADEON_FLAG_ENCRYPTED))); if (secure != sctx->ws->cs_is_secure(&sctx->gfx_cs)) { diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index bbfcf422c5c..3fbd3b05d38 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -916,7 +916,7 @@ static void si_test_gds_memory_management(struct si_context *sctx, unsigned allo */ si_cp_dma_clear_buffer( sctx, &cs[i], NULL, 0, alloc_size, 0, - SI_CPDMA_SKIP_BO_LIST_UPDATE | SI_CPDMA_SKIP_CHECK_CS_SPACE | SI_CPDMA_SKIP_GFX_SYNC, 0, + SI_CPDMA_SKIP_CHECK_CS_SPACE | SI_CPDMA_SKIP_GFX_SYNC, 0, 0); ws->cs_add_buffer(&cs[i], gds_bo[i], RADEON_USAGE_READWRITE, domain, 0); diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 5036b47a970..2a63d737050 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -1402,11 +1402,6 @@ void si_init_compute_blit_functions(struct si_context *sctx); #define SI_CPDMA_SKIP_SYNC_AFTER (1 << 1) /* don't wait for DMA after the copy */ #define SI_CPDMA_SKIP_SYNC_BEFORE (1 << 2) /* don't wait for DMA before the copy (RAW hazards) */ #define SI_CPDMA_SKIP_GFX_SYNC (1 << 3) /* don't flush caches and don't wait for PS/CS */ -#define SI_CPDMA_SKIP_BO_LIST_UPDATE (1 << 4) /* don't update the BO list */ -#define SI_CPDMA_SKIP_TMZ (1 << 5) /* don't update tmz state */ -#define SI_CPDMA_SKIP_ALL \ - (SI_CPDMA_SKIP_CHECK_CS_SPACE | SI_CPDMA_SKIP_SYNC_AFTER | SI_CPDMA_SKIP_SYNC_BEFORE | \ - SI_CPDMA_SKIP_GFX_SYNC | SI_CPDMA_SKIP_BO_LIST_UPDATE | SI_CPDMA_SKIP_TMZ) void si_cp_dma_wait_for_idle(struct si_context *sctx, struct radeon_cmdbuf *cs); void si_cp_dma_clear_buffer(struct si_context *sctx, struct radeon_cmdbuf *cs,