radeonsi: init sctx->dma_copy before using it

Commit a1378639ab 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@amd.com>
(cherry picked from commit 4583f09caa)
This commit is contained in:
Pierre-Eric Pelloux-Prayer 2019-05-31 14:39:46 +02:00 committed by Juan A. Suarez Romero
parent 51998d720b
commit 5394f1578c

View file

@ -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. */