Mesa (master): broadcom/vc5: Implement GFXH-1742 workaround (emit 2 dummy stores on 4.x).

Eric Anholt anholt at kemper.freedesktop.org
Thu Apr 26 18:30:42 UTC 2018


Module: Mesa
Branch: master
Commit: 57ceb95c842215880b7cb416fbdb9545276cfc05
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=57ceb95c842215880b7cb416fbdb9545276cfc05

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Apr 25 14:18:52 2018 -0700

broadcom/vc5: Implement GFXH-1742 workaround (emit 2 dummy stores on 4.x).

This should fix help with intermittent GPU hangs in tests switching
formats while rendering small frames.  Unfortunately, it didn't help with
the tests I'm having troubles with.

---

 src/gallium/drivers/vc5/vc5_rcl.c | 35 +++++++++++++++++++++++++++--------
 1 file changed, 27 insertions(+), 8 deletions(-)

diff --git a/src/gallium/drivers/vc5/vc5_rcl.c b/src/gallium/drivers/vc5/vc5_rcl.c
index 7f804aa27a..7d32d9ad0e 100644
--- a/src/gallium/drivers/vc5/vc5_rcl.c
+++ b/src/gallium/drivers/vc5/vc5_rcl.c
@@ -715,20 +715,39 @@ v3dX(emit_rcl)(struct vc5_job *job)
                 coords.tile_row_number = 0;
         }
 
+        /* Emit an initial clear of the tile buffers.  This is necessary for
+         * any buffers that should be cleared (since clearing normally happens
+         * at the *end* of the generic tile list), but it's also nice to clear
+         * everything so the first tile doesn't inherit any contents from some
+         * previous frame.
+         *
+         * Also, implement the GFXH-1742 workaround.  There's a race in the HW
+         * between the RCL updating the TLB's internal type/size and the
+         * spawning of the QPU instances using the TLB's current internal
+         * type/size.  To make sure the QPUs get the right state,, we need 1
+         * dummy store in between internal type/size changes on V3D 3.x, and 2
+         * dummy stores on 4.x.
+         */
 #if V3D_VERSION < 40
         cl_emit(&job->rcl, STORE_TILE_BUFFER_GENERAL, store) {
                 store.buffer_to_store = NONE;
         }
 #else
-        cl_emit(&job->rcl, END_OF_LOADS, end);
-        cl_emit(&job->rcl, STORE_TILE_BUFFER_GENERAL, store) {
-                store.buffer_to_store = NONE;
-        }
-        cl_emit(&job->rcl, CLEAR_TILE_BUFFERS, clear) {
-                clear.clear_z_stencil_buffer = true;
-                clear.clear_all_render_targets = true;
+        for (int i = 0; i < 2; i++) {
+                if (i > 0)
+                        cl_emit(&job->rcl, TILE_COORDINATES, coords);
+                cl_emit(&job->rcl, END_OF_LOADS, end);
+                cl_emit(&job->rcl, STORE_TILE_BUFFER_GENERAL, store) {
+                        store.buffer_to_store = NONE;
+                }
+                if (i == 0) {
+                        cl_emit(&job->rcl, CLEAR_TILE_BUFFERS, clear) {
+                                clear.clear_z_stencil_buffer = true;
+                                clear.clear_all_render_targets = true;
+                        }
+                }
+                cl_emit(&job->rcl, END_OF_TILE_MARKER, end);
         }
-        cl_emit(&job->rcl, END_OF_TILE_MARKER, end);
 #endif
 
         cl_emit(&job->rcl, FLUSH_VCD_CACHE, flush);




More information about the mesa-commit mailing list