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

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

broadcom/compiler: preserve ordering of unifa/ldunifa sequences

unifa writes the addresss from which follow-up ldunifa loads,
and each ldunifa increments the unifa addeess by 32-bit so the
loads need to be ordered too.

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

---

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

diff --git a/src/broadcom/compiler/qpu_schedule.c 
b/src/broadcom/compiler/qpu_schedule.c
index af864b86e64..3a818d64d96 100644
--- a/src/broadcom/compiler/qpu_schedule.c
+++ b/src/broadcom/compiler/qpu_schedule.c
@@ -83,6 +83,7 @@ struct schedule_state {
         struct schedule_node *last_vpm;
         struct schedule_node *last_unif;
         struct schedule_node *last_rtop;
+        struct schedule_node *last_unifa;
         enum direction dir;
         /* Estimated cycle when the current instruction would start. */
         uint32_t time;
@@ -228,6 +229,11 @@ process_waddr_deps(struct schedule_state *state, struct 
schedule_node *n,
                         add_write_dep(state, &state->last_tmu_write, n);
                         break;
 
+                case V3D_QPU_WADDR_UNIFA:
+                        if (state->devinfo->ver >= 40)
+                                add_write_dep(state, &state->last_unifa, n);
+                        break;
+
                 case V3D_QPU_WADDR_NOP:
                         break;
 
@@ -400,6 +406,10 @@ calculate_deps(struct schedule_state *state, struct 
schedule_node *n)
         if (vir_has_uniform(qinst))
                 add_write_dep(state, &state->last_unif, n);
 
+        /* Both unifa and ldunifa must preserve ordering */
+        if (inst->sig.ldunifa || inst->sig.ldunifarf)
+                add_write_dep(state, &state->last_unifa, n);
+
         if (v3d_qpu_reads_flags(inst))
                 add_read_dep(state, state->last_sf, n);
         if (v3d_qpu_writes_flags(inst))

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

Reply via email to