Module: Mesa
Branch: 18.0
Commit: cd52573fac3a1715291da5c450738e9565aa4652
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=cd52573fac3a1715291da5c450738e9565aa4652

Author: Marek Olšák <[email protected]>
Date:   Tue Apr 17 15:28:04 2018 -0400

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 <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>

---

 bin/.cherry-ignore                     | 3 +++
 src/gallium/drivers/radeonsi/si_pipe.c | 9 ++++++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/bin/.cherry-ignore b/bin/.cherry-ignore
index 71bc8167ed..fca2ad2910 100644
--- a/bin/.cherry-ignore
+++ b/bin/.cherry-ignore
@@ -21,3 +21,6 @@ ac4437b20b87c7285b89466f05b51518ae616873 automake: small 
cleanup after the meson
 #        b2f2236dc565dd1460f0 and c62cf1f165919bc74296 which did not land in
 #        branch.
 880c1718b6d14b33fe5ba918af70fea5be890c6b omx: always define 
ENABLE_ST_OMX_{BELLAGIO,TIZONIA}
+
+# stable: There is a specific port for this patch for stable branch.
+d15fb766aa3c98ffbe16d050b2af4804e4b12c57 radeonsi/gfx9: fix a hang with an 
empty first IB
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c 
b/src/gallium/drivers/radeonsi/si_pipe.c
index 676d199618..3014910623 100644
--- a/src/gallium/drivers/radeonsi/si_pipe.c
+++ b/src/gallium/drivers/radeonsi/si_pipe.c
@@ -26,6 +26,7 @@
 #include "si_shader_internal.h"
 #include "sid.h"
 
+#include "radeon/r600_cs.h"
 #include "radeon/radeon_uvd.h"
 #include "util/hash_table.h"
 #include "util/u_log.h"
@@ -333,9 +334,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_cs(sctx);
-
        if (sctx->b.chip_class >= GFX9) {
                sctx->wait_mem_scratch = (struct r600_resource*)
                        pipe_buffer_create(screen, 0, PIPE_USAGE_DEFAULT, 4);
@@ -351,6 +349,9 @@ 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->b, &sctx->b.gfx,
+                                         sctx->wait_mem_scratch,
+                                         RADEON_USAGE_WRITE, 
RADEON_PRIO_FENCE);
        }
 
        /* CIK cannot unbind a constant buffer (S_BUFFER_LOAD doesn't skip loads
@@ -423,6 +424,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_cs(sctx);
        return &sctx->b.b;
 fail:
        fprintf(stderr, "radeonsi: Failed to create a context.\n");

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to