v3d: Fix detection of the last ldtmu before a new TMU op.
authorEric Anholt <eric@anholt.net>
Thu, 25 Apr 2019 19:29:55 +0000 (12:29 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 26 Apr 2019 19:42:30 +0000 (12:42 -0700)
We were looking at the start instruction, instead of scanning through the
list of following instructions to find any more ldtmus.

src/broadcom/compiler/vir_register_allocate.c

index 32b9a8abe8e6d1849e415bdea48645cca0840009..1b58bb9c42016dd5466dcb1e73f7c4569698bbbb 100644 (file)
 static bool
 is_last_ldtmu(struct qinst *inst, struct qblock *block)
 {
-        list_for_each_entry_from(struct qinst, scan_inst, inst,
+        list_for_each_entry_from(struct qinst, scan_inst, inst->link.next,
                                  &block->instructions, link) {
-                if (inst->qpu.sig.ldtmu)
+                if (scan_inst->qpu.sig.ldtmu)
                         return false;
-                if (v3d_qpu_writes_tmu(&inst->qpu))
+                if (v3d_qpu_writes_tmu(&scan_inst->qpu))
                         return true;
         }