radeonsi: Use gfx for TMZ buffer clears

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33601>
This commit is contained in:
David Rosca 2025-02-18 14:45:04 +01:00 committed by Marge Bot
parent dfd5e3da7b
commit 57228c12d5
2 changed files with 8 additions and 4 deletions

View file

@ -191,12 +191,14 @@ bool si_alloc_resource(struct si_screen *sscreen, struct si_resource *res)
}
if (res->b.b.flags & SI_RESOURCE_FLAG_CLEAR) {
struct si_context *ctx = si_get_aux_context(&sscreen->aux_context.compute_resource_init);
struct si_aux_context *auxctx = res->flags & RADEON_FLAG_ENCRYPTED ?
&sscreen->aux_context.general : &sscreen->aux_context.compute_resource_init;
struct si_context *ctx = si_get_aux_context(auxctx);
uint32_t value = 0;
si_clear_buffer(ctx, &res->b.b, 0, res->bo_size, &value, 4, SI_AUTO_SELECT_CLEAR_METHOD,
false);
si_put_aux_context_flush(&sscreen->aux_context.compute_resource_init);
si_put_aux_context_flush(auxctx);
}
return true;

View file

@ -1304,10 +1304,12 @@ static struct si_texture *si_texture_create_object(struct pipe_screen *screen,
/* Execute the clears. */
if (num_clears) {
struct si_context *sctx = si_get_aux_context(&sscreen->aux_context.compute_resource_init);
struct si_aux_context *auxctx = tex->buffer.flags & RADEON_FLAG_ENCRYPTED ?
&sscreen->aux_context.general : &sscreen->aux_context.compute_resource_init;
struct si_context *sctx = si_get_aux_context(auxctx);
si_execute_clears(sctx, clears, num_clears, false);
si_put_aux_context_flush(&sscreen->aux_context.compute_resource_init);
si_put_aux_context_flush(auxctx);
}
/* Initialize the CMASK base register value. */