From 5068dec5deb3d02693a7d7b1579b1738237e3b6d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 28 Jan 2019 19:49:56 -0500 Subject: [PATCH] radeonsi: clear allocator_zeroed_memory with SDMA MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit so that it can be used in parallel IBs. This also removes the SO_FILLED_SIZE hack. Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeonsi/si_buffer.c | 4 ++++ src/gallium/drivers/radeonsi/si_compute_blit.c | 9 +-------- src/gallium/drivers/radeonsi/si_pipe.c | 6 +++--- src/gallium/drivers/radeonsi/si_pipe.h | 2 +- 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_buffer.c b/src/gallium/drivers/radeonsi/si_buffer.c index 03c11cb7013..bac561de2cb 100644 --- a/src/gallium/drivers/radeonsi/si_buffer.c +++ b/src/gallium/drivers/radeonsi/si_buffer.c @@ -242,6 +242,10 @@ bool si_alloc_resource(struct si_screen *sscreen, res->gpu_address, res->gpu_address + res->buf->size, res->buf->size); } + + if (res->b.b.flags & SI_RESOURCE_FLAG_CLEAR) + si_screen_clear_buffer(sscreen, &res->b.b, 0, res->bo_size, 0); + return true; } diff --git a/src/gallium/drivers/radeonsi/si_compute_blit.c b/src/gallium/drivers/radeonsi/si_compute_blit.c index 1ea0d7517df..f5e9c02dd10 100644 --- a/src/gallium/drivers/radeonsi/si_compute_blit.c +++ b/src/gallium/drivers/radeonsi/si_compute_blit.c @@ -275,15 +275,8 @@ static void si_pipe_clear_buffer(struct pipe_context *ctx, const void *clear_value, int clear_value_size) { - enum si_coherency coher; - - if (dst->flags & SI_RESOURCE_FLAG_SO_FILLED_SIZE) - coher = SI_COHERENCY_CP; - else - coher = SI_COHERENCY_SHADER; - si_clear_buffer((struct si_context*)ctx, dst, offset, size, (uint32_t*)clear_value, - clear_value_size, coher); + clear_value_size, SI_COHERENCY_SHADER); } void si_copy_buffer(struct si_context *sctx, diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 439b550c4cf..98059ddbf8b 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -430,9 +430,9 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, } sctx->allocator_zeroed_memory = - u_suballocator_create(&sctx->b, sscreen->info.gart_page_size, - 0, PIPE_USAGE_DEFAULT, - SI_RESOURCE_FLAG_SO_FILLED_SIZE, true); + u_suballocator_create(&sctx->b, sscreen->info.gart_page_size, + 0, PIPE_USAGE_DEFAULT, + SI_RESOURCE_FLAG_CLEAR, false); if (!sctx->allocator_zeroed_memory) goto fail; diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index 1af3c5ff9b7..b01d5744752 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -109,7 +109,7 @@ #define SI_RESOURCE_FLAG_UNMAPPABLE (PIPE_RESOURCE_FLAG_DRV_PRIV << 4) #define SI_RESOURCE_FLAG_READ_ONLY (PIPE_RESOURCE_FLAG_DRV_PRIV << 5) #define SI_RESOURCE_FLAG_32BIT (PIPE_RESOURCE_FLAG_DRV_PRIV << 6) -#define SI_RESOURCE_FLAG_SO_FILLED_SIZE (PIPE_RESOURCE_FLAG_DRV_PRIV << 7) +#define SI_RESOURCE_FLAG_CLEAR (PIPE_RESOURCE_FLAG_DRV_PRIV << 7) enum si_clear_code { -- 2.30.2