From ab1377cf9267d9ff79a3b6b8da0dfe8b1784b2a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 3 Dec 2020 17:10:06 -0500 Subject: [PATCH] radeonsi: move si_screen_clear_buffer into si_compute_blit.c w/o SDMA option Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_compute_blit.c | 11 +++++++++++ src/gallium/drivers/radeonsi/si_dma_cs.c | 11 ----------- src/gallium/drivers/radeonsi/si_pipe.h | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c b/src/gallium/drivers/radeonsi/si_compute_blit.c index 80365915bec..b350c9fe3f7 100644 --- a/src/gallium/drivers/radeonsi/si_compute_blit.c +++ b/src/gallium/drivers/radeonsi/si_compute_blit.c @@ -372,6 +372,17 @@ void si_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, uint64_ } } +void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset, + uint64_t size, unsigned value) +{ + struct si_context *ctx = (struct si_context *)sscreen->aux_context; + + simple_mtx_lock(&sscreen->aux_context_lock); + ctx->b.clear_buffer(&ctx->b, dst, offset, size, &value, 4); + sscreen->aux_context->flush(sscreen->aux_context, NULL, 0); + simple_mtx_unlock(&sscreen->aux_context_lock); +} + static void si_pipe_clear_buffer(struct pipe_context *ctx, struct pipe_resource *dst, unsigned offset, unsigned size, const void *clear_value, int clear_value_size) diff --git a/src/gallium/drivers/radeonsi/si_dma_cs.c b/src/gallium/drivers/radeonsi/si_dma_cs.c index 2fa77871918..77dc9d81dc0 100644 --- a/src/gallium/drivers/radeonsi/si_dma_cs.c +++ b/src/gallium/drivers/radeonsi/si_dma_cs.c @@ -317,14 +317,3 @@ void si_flush_dma_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_h si_clear_saved_cs(&saved); } } - -void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset, - uint64_t size, unsigned value) -{ - struct si_context *ctx = (struct si_context *)sscreen->aux_context; - - simple_mtx_lock(&sscreen->aux_context_lock); - si_sdma_clear_buffer(ctx, dst, offset, size, value); - sscreen->aux_context->flush(sscreen->aux_context, NULL, 0); - simple_mtx_unlock(&sscreen->aux_context_lock); -} diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 743f112aa26..7eb286bfa6e 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -1356,6 +1356,8 @@ void si_launch_grid_internal(struct si_context *sctx, struct pipe_grid_info *inf void si_clear_buffer(struct si_context *sctx, struct pipe_resource *dst, uint64_t offset, uint64_t size, uint32_t *clear_value, uint32_t clear_value_size, enum si_coherency coher, bool force_cpdma); +void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset, + uint64_t size, unsigned value); void si_copy_buffer(struct si_context *sctx, struct pipe_resource *dst, struct pipe_resource *src, uint64_t dst_offset, uint64_t src_offset, unsigned size); void si_compute_copy_image(struct si_context *sctx, struct pipe_resource *dst, unsigned dst_level, @@ -1427,8 +1429,6 @@ void si_sdma_copy_buffer(struct si_context *sctx, struct pipe_resource *dst, void si_need_dma_space(struct si_context *ctx, unsigned num_dw, struct si_resource *dst, struct si_resource *src); void si_flush_dma_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_handle **fence); -void si_screen_clear_buffer(struct si_screen *sscreen, struct pipe_resource *dst, uint64_t offset, - uint64_t size, unsigned value); /* si_fence.c */ void si_cp_release_mem(struct si_context *ctx, struct radeon_cmdbuf *cs, unsigned event,