Mesa (master): radeonsi: unify uploaders on APUs too
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Wed Jan 20 22:13:28 UTC 2021
Module: Mesa
Branch: master
Commit: ac2b4aa08f5f51dcbb287c127e0c70571cdba6b4
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ac2b4aa08f5f51dcbb287c127e0c70571cdba6b4
Author: Marek Olšák <marek.olsak at amd.com>
Date: Mon Dec 21 01:34:38 2020 -0500
radeonsi: unify uploaders on APUs too
const_uploader and stream_uploader point to the same uploader.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8600>
---
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 =
More information about the mesa-commit
mailing list