From f8070b3dc290d9917effa97c7eb7ca1559c872bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 12 Mar 2023 18:13:31 -0400 Subject: [PATCH] radeonsi: add AMD_DEBUG=nowcstream to enable caching for stream_uploader Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_pipe.c | 5 ++++- src/gallium/drivers/radeonsi/si_pipe.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 9bd7041b60e..c83716d2953 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -87,6 +87,7 @@ static const struct debug_named_value radeonsi_debug_options[] = { /* Driver options: */ {"nowc", DBG(NO_WC), "Disable GTT write combining"}, + {"nowcstream", DBG(NO_WC_STREAM), "Disable GTT write combining for streaming uploads"}, {"check_vm", DBG(CHECK_VM), "Check VM faults and dump debug info."}, {"reserve_vmid", DBG(RESERVE_VMID), "Force VMID reservation per context."}, {"shadowregs", DBG(SHADOW_REGS), "Enable CP register shadowing."}, @@ -563,7 +564,9 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, unsign */ bool is_apu = !sscreen->info.has_dedicated_vram; sctx->b.stream_uploader = - u_upload_create(&sctx->b, 1024 * 1024, 0, PIPE_USAGE_STREAM, + u_upload_create(&sctx->b, 1024 * 1024, 0, + sscreen->debug_flags & DBG(NO_WC_STREAM) ? PIPE_USAGE_STAGING + : PIPE_USAGE_STREAM, SI_RESOURCE_FLAG_32BIT); /* same flags as const_uploader */ if (!sctx->b.stream_uploader) { fprintf(stderr, "radeonsi: can't create stream_uploader\n"); diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index f518b913c77..65cc10a5a80 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -224,6 +224,7 @@ enum /* Driver options: */ DBG_NO_WC, + DBG_NO_WC_STREAM, DBG_CHECK_VM, DBG_RESERVE_VMID, DBG_SHADOW_REGS,