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

Author: Iago Toral Quiroga <[email protected]>
Date:   Thu Feb 11 12:09:28 2021 +0100

broadcom/compiler: disallow unifa overlap with thread switch/end

Reviewed-by: Alejandro PiƱeiro <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>

---

 src/broadcom/compiler/qpu_schedule.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/broadcom/compiler/qpu_schedule.c 
b/src/broadcom/compiler/qpu_schedule.c
index 2d563d0c5d8..af864b86e64 100644
--- a/src/broadcom/compiler/qpu_schedule.c
+++ b/src/broadcom/compiler/qpu_schedule.c
@@ -1217,6 +1217,23 @@ valid_thrsw_sequence(struct v3d_compile *c, struct 
choose_scoreboard *scoreboard
                         return false;
                 }
 
+                /* unifa and the following 3 instructions can't overlap a
+                 * thread switch/end. The docs further clarify that this means
+                 * the cycle at which the actual thread switch/end happens
+                 * and not when the thrsw instruction is processed, which would
+                 * be after the 2 delay slots following the thrsw instruction.
+                 * This means that we can move up a thrsw up to the instruction
+                 * right after unifa:
+                 *
+                 * unifa, r5
+                 * thrsw
+                 * delay slot 1
+                 * delay slot 2
+                 * Thread switch happens here, 4 instructions away from unifa
+                 */
+                if (v3d_qpu_writes_unifa(c->devinfo, &qinst->qpu))
+                        return false;
+
                 /* Note that the list is circular, so we can only do this up
                  * to instructions_in_sequence.
                  */

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

Reply via email to