vc4: Add QPU scheduling to handle MUL rotate sources.
authorEric Anholt <eric@anholt.net>
Thu, 25 Aug 2016 20:40:27 +0000 (13:40 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 26 Aug 2016 00:24:11 +0000 (17:24 -0700)
We need MUL rotates to do ddx/ddy support.

src/gallium/drivers/vc4/vc4_qpu_schedule.c

index 1caee51a58168e81998c4557a73b721d77f23346..25adbe671030e40c163d9f7c07820d335cd454d6 100644 (file)
@@ -486,6 +486,19 @@ reads_too_soon_after_write(struct choose_scoreboard *scoreboard, uint64_t inst)
                 }
         }
 
+        if (sig == QPU_SIG_SMALL_IMM &&
+            QPU_GET_FIELD(inst, QPU_SMALL_IMM) >= QPU_SMALL_IMM_MUL_ROT) {
+                uint32_t mux_a = QPU_GET_FIELD(inst, QPU_MUL_A);
+                uint32_t mux_b = QPU_GET_FIELD(inst, QPU_MUL_B);
+
+                if (scoreboard->last_waddr_a == mux_a + QPU_W_ACC0 ||
+                    scoreboard->last_waddr_a == mux_b + QPU_W_ACC0 ||
+                    scoreboard->last_waddr_b == mux_a + QPU_W_ACC0 ||
+                    scoreboard->last_waddr_b == mux_b + QPU_W_ACC0) {
+                        return true;
+                }
+        }
+
         if (reads_uniform(inst) &&
             scoreboard->tick - scoreboard->last_uniforms_reset_tick <= 2) {
                 return true;