summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2018-04-17 15:28:04 -0400
committerMarek Olšák <marek.olsak@amd.com>2018-04-18 14:42:06 -0400
commitd15fb766aa3c98ffbe16d050b2af4804e4b12c57 (patch)
tree6775b5859487dc75b14f3af64124eaccaf6df6d8
parentd28c24650110c130008be3d3fe584520ff00ceb1 (diff)
radeonsi/gfx9: fix a hang with an empty first IB
This packet causes the no-op IB detection to fail, so the IB is always submitted. Also fix the no-op IB detection by moving the begin call. Cc: 18.0 <mesa-stable@lists.freedesktop.org> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
-rw-r--r--src/gallium/drivers/radeonsi/si_pipe.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c
index 466546b76b..bf88346ca1 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -474,9 +474,6 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
sctx->sample_mask.sample_mask = 0xffff;
- /* these must be last */
- si_begin_new_gfx_cs(sctx);
-
if (sctx->chip_class >= GFX9) {
sctx->wait_mem_scratch = (struct r600_resource*)
pipe_buffer_create(screen, 0, PIPE_USAGE_DEFAULT, 4);
@@ -492,6 +489,8 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
radeon_emit(cs, sctx->wait_mem_scratch->gpu_address);
radeon_emit(cs, sctx->wait_mem_scratch->gpu_address >> 32);
radeon_emit(cs, sctx->wait_mem_number);
+ radeon_add_to_buffer_list(sctx, cs, sctx->wait_mem_scratch,
+ RADEON_USAGE_WRITE, RADEON_PRIO_FENCE);
}
/* CIK cannot unbind a constant buffer (S_BUFFER_LOAD doesn't skip loads
@@ -564,6 +563,8 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen,
util_dynarray_init(&sctx->resident_img_needs_color_decompress, NULL);
util_dynarray_init(&sctx->resident_tex_needs_depth_decompress, NULL);
+ /* this must be last */
+ si_begin_new_gfx_cs(sctx);
return &sctx->b;
fail:
fprintf(stderr, "radeonsi: Failed to create a context.\n");