iris: Emit CS Stall before Instruction Cache flush for gen12 WA
authorJordan Justen <jordan.l.justen@intel.com>
Thu, 16 Jan 2020 21:16:24 +0000 (13:16 -0800)
committerMarge Bot <eric+marge@anholt.net>
Tue, 28 Jan 2020 21:57:17 +0000 (21:57 +0000)
Before flushing the instruction cache with a pipe control, we need to
use a CS Stall pipe control.

Ref: GEN:BUG:1409226450
Rework: Add stall-at-scoreboard (Lionel)
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3457>

src/gallium/drivers/iris/iris_state.c

index 5fbb24bdf7f92c196b447480c04512d060ad3b87..1b856335f61bfba350e047e6ce8b8dada6e01565 100644 (file)
@@ -6848,6 +6848,18 @@ iris_emit_raw_pipe_control(struct iris_batch *batch,
                                  0, NULL, 0, 0);
    }
 
+   /* GEN:BUG:1409226450, Wait for EU to be idle before pipe control which
+    * invalidates the instruction cache
+    */
+   if (GEN_GEN == 12 && (flags & PIPE_CONTROL_INSTRUCTION_INVALIDATE)) {
+      iris_emit_raw_pipe_control(batch,
+                                 "workaround: CS stall before instruction "
+                                 "cache invalidate",
+                                 PIPE_CONTROL_CS_STALL |
+                                 PIPE_CONTROL_STALL_AT_SCOREBOARD, bo, offset,
+                                 imm);
+   }
+
    if (GEN_GEN == 9 && IS_COMPUTE_PIPELINE(batch) && post_sync_flags) {
       /* Project: SKL / Argument: LRI Post Sync Operation [23]
        *