broadcom/compiler: don't check for GFXH-1633 on V3D 4.2.x
authorIago Toral Quiroga <itoral@igalia.com>
Thu, 11 Feb 2021 10:52:13 +0000 (11:52 +0100)
committerMarge Bot <eric+marge@anholt.net>
Fri, 12 Feb 2021 08:24:21 +0000 (08:24 +0000)
This has been fixed since V3D 4.2.14 (Rpi4), which is the hardware
we are targetting. Our version resolution doesn't allow us to check
for 4.2 versions lower than .14, but that is okay because the
simulator would still validate this in any case.

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

src/broadcom/compiler/qpu_validate.c

index a2de9f5..ec9ed66 100644 (file)
@@ -124,17 +124,25 @@ qpu_validate_inst(struct v3d_qpu_validate_state *state, struct qinst *qinst)
                 fail_instr(state, "LDUNIF after a LDVARY");
         }
 
-        /* GFXH-1633 */
-        bool last_reads_ldunif = (state->last && (state->last->sig.ldunif ||
-                                                  state->last->sig.ldunifrf));
-        bool last_reads_ldunifa = (state->last && (state->last->sig.ldunifa ||
-                                                   state->last->sig.ldunifarf));
-        bool reads_ldunif = inst->sig.ldunif || inst->sig.ldunifrf;
-        bool reads_ldunifa = inst->sig.ldunifa || inst->sig.ldunifarf;
-        if ((last_reads_ldunif && reads_ldunifa) ||
-            (last_reads_ldunifa && reads_ldunif)) {
-                fail_instr(state,
-                           "LDUNIF and LDUNIFA can't be next to each other");
+        /* GFXH-1633 (fixed since V3D 4.2.14, which is Rpi4)
+         *
+         * FIXME: This would not check correctly for V3D 4.2 versions lower
+         * than V3D 4.2.14, but that is not a real issue because the simulator
+         * will still catch this, and we are not really targetting any such
+         * versions anyway.
+         */
+        if (state->c->devinfo->ver < 42) {
+                bool last_reads_ldunif = (state->last && (state->last->sig.ldunif ||
+                                                          state->last->sig.ldunifrf));
+                bool last_reads_ldunifa = (state->last && (state->last->sig.ldunifa ||
+                                                           state->last->sig.ldunifarf));
+                bool reads_ldunif = inst->sig.ldunif || inst->sig.ldunifrf;
+                bool reads_ldunifa = inst->sig.ldunifa || inst->sig.ldunifarf;
+                if ((last_reads_ldunif && reads_ldunifa) ||
+                    (last_reads_ldunifa && reads_ldunif)) {
+                        fail_instr(state,
+                                   "LDUNIF and LDUNIFA can't be next to each other");
+                }
         }
 
         int tmu_writes = 0;