Mesa (staging/19.1): radeonsi: init sctx->dma_copy before using it
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 4 14:25:30 UTC 2019
Module: Mesa
Branch: staging/19.1
Commit: b518b74093878d406b28008c8db55c20a75f0066
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=b518b74093878d406b28008c8db55c20a75f0066
Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date: Fri May 31 14:39:46 2019 +0200
radeonsi: init sctx->dma_copy before using it
Commit a1378639ab19 reordered context functions initializations but broke
sctx->b.resource_copy_region init when using AMD_DEBUG=forcedma.
In this case sctx->dma_copy was assigned a value after being used in:
sctx->b.resource_copy_region = sctx->dma_copy;
This commit moves the FORCE_DMA special case after sctx->dma_copy initialization.
See https://bugs.freedesktop.org/show_bug.cgi?id=110422
Signed-off-by: Marek Olšák <marek.olsak at amd.com>
(cherry picked from commit 4583f09caa5aef719a1eec282f24a86c789cbba6)
---
src/gallium/drivers/radeonsi/si_pipe.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index b0e0ca7af05..7dd4a7378f1 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -514,9 +514,6 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
si_init_fence_functions(sctx);
si_init_state_compute_functions(sctx);
- if (sscreen->debug_flags & DBG(FORCE_DMA))
- sctx->b.resource_copy_region = sctx->dma_copy;
-
/* Initialize graphics-only context functions. */
if (sctx->has_graphics) {
si_init_context_texture_functions(sctx);
@@ -541,6 +538,9 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
else
si_init_dma_functions(sctx);
+ if (sscreen->debug_flags & DBG(FORCE_DMA))
+ sctx->b.resource_copy_region = sctx->dma_copy;
+
sctx->sample_mask = 0xffff;
/* Initialize multimedia functions. */
More information about the mesa-commit
mailing list