From ac2b4aa08f5f51dcbb287c127e0c70571cdba6b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 21 Dec 2020 01:34:38 -0500 Subject: [PATCH] radeonsi: unify uploaders on APUs too const_uploader and stream_uploader point to the same uploader. Reviewed-by: Pierre-Eric Pelloux-Prayer Part-of: --- src/gallium/drivers/radeonsi/si_pipe.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index cd8f52a88cf..9c904b077b6 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -499,15 +499,21 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, unsign goto fail; /* Initialize public allocators. */ + /* Unify uploaders as follows: + * - dGPUs with Smart Access Memory: there is only one uploader instance writing to VRAM. + * - APUs: There is only one uploader instance writing to RAM. VRAM has the same perf on APUs. + * - Other chips: The const uploader writes to VRAM and the stream uploader writes to RAM. + */ bool smart_access_memory = sscreen->info.smart_access_memory; + bool is_apu = !sscreen->info.has_dedicated_vram; sctx->b.stream_uploader = u_upload_create(&sctx->b, 1024 * 1024, 0, - smart_access_memory ? PIPE_USAGE_DEFAULT : PIPE_USAGE_STREAM, + smart_access_memory && !is_apu ? PIPE_USAGE_DEFAULT : PIPE_USAGE_STREAM, SI_RESOURCE_FLAG_32BIT); /* same flags as const_uploader */ if (!sctx->b.stream_uploader) goto fail; - if (smart_access_memory) { + if (smart_access_memory || is_apu) { sctx->b.const_uploader = sctx->b.stream_uploader; } else { sctx->b.const_uploader =