Mesa (master): broadcom/compiler: ensure 3-slot delay between unifa and ldunifa

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Feb 12 08:32:59 UTC 2021


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

Author: Iago Toral Quiroga <itoral at igalia.com>
Date:   Thu Feb 11 12:15:17 2021 +0100

broadcom/compiler: ensure 3-slot delay between unifa and ldunifa

Reviewed-by: Alejandro Piñeiro <apinheiro at igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8980>

---

 src/broadcom/compiler/qpu_schedule.c | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/src/broadcom/compiler/qpu_schedule.c b/src/broadcom/compiler/qpu_schedule.c
index 3a818d64d96..31f707f63d6 100644
--- a/src/broadcom/compiler/qpu_schedule.c
+++ b/src/broadcom/compiler/qpu_schedule.c
@@ -455,6 +455,7 @@ struct choose_scoreboard {
         int last_stallable_sfu_reg;
         int last_stallable_sfu_tick;
         int last_ldvary_tick;
+        int last_unifa_write_tick;
         int last_uniforms_reset_tick;
         int last_thrsw_tick;
         bool tlb_locked;
@@ -799,6 +800,13 @@ choose_instruction_to_schedule(const struct v3d_device_info *devinfo,
                         continue;
                 }
 
+                /* We need to have 3 delay slots between a write to unifa and
+                 * a follow-up ldunifa.
+                 */
+                if ((inst->sig.ldunifa || inst->sig.ldunifarf) &&
+                    scoreboard->tick - scoreboard->last_unifa_write_tick <= 3)
+                        continue;
+
                 /* "An instruction must not read from a location in physical
                  *  regfile A or B that was written to by the previous
                  *  instruction."
@@ -905,10 +913,13 @@ choose_instruction_to_schedule(const struct v3d_device_info *devinfo,
 
 static void
 update_scoreboard_for_magic_waddr(struct choose_scoreboard *scoreboard,
-                                  enum v3d_qpu_waddr waddr)
+                                  enum v3d_qpu_waddr waddr,
+                                  const struct v3d_device_info *devinfo)
 {
         if (v3d_qpu_magic_waddr_is_sfu(waddr))
                 scoreboard->last_magic_sfu_write_tick = scoreboard->tick;
+        else if (devinfo->ver >= 40 && waddr == V3D_QPU_WADDR_UNIFA)
+                scoreboard->last_unifa_write_tick = scoreboard->tick;
 }
 
 static void
@@ -1585,6 +1596,7 @@ v3d_qpu_schedule_instructions(struct v3d_compile *c)
         struct choose_scoreboard scoreboard;
         memset(&scoreboard, 0, sizeof(scoreboard));
         scoreboard.last_ldvary_tick = -10;
+        scoreboard.last_unifa_write_tick = -10;
         scoreboard.last_magic_sfu_write_tick = -10;
         scoreboard.last_uniforms_reset_tick = -10;
         scoreboard.last_thrsw_tick = -10;



More information about the mesa-commit mailing list