Commit 5068dec5 authored by Marek Olšák's avatar Marek Olšák
Browse files

radeonsi: clear allocator_zeroed_memory with SDMA



so that it can be used in parallel IBs.

This also removes the SO_FILLED_SIZE hack.
Reviewed-by: default avatarNicolai Hähnle <nicolai.haehnle@amd.com>
parent 7d4c9356
......@@ -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;
}
......
......@@ -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,
......
......@@ -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;
......
......@@ -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
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment