summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-01-11 19:31:59 +1300
committerEric Anholt <[email protected]>2015-01-15 22:19:25 +1300
commit5d5707707fb10712ba130c2dafb50e8fc92a2bcc (patch)
tree84f5898b1d618a721dc97018e6b36194ad4bd0d3 /src/gallium
parent3820866e40d16f5d05319f0390956fb6e6407239 (diff)
vc4: Don't let pairing happen with badly mismatched unpack flags.
No difference on shader-db, but prevents definite regressions in the blending changes.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/vc4/vc4_qpu.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qpu.c b/src/gallium/drivers/vc4/vc4_qpu.c
index 6bdb3957382..434e664fa83 100644
--- a/src/gallium/drivers/vc4/vc4_qpu.c
+++ b/src/gallium/drivers/vc4/vc4_qpu.c
@@ -403,6 +403,15 @@ writes_a_file(uint64_t inst)
return QPU_GET_FIELD(inst, QPU_WADDR_MUL) < 32;
}
+static bool
+reads_r4(uint64_t inst)
+{
+ return (QPU_GET_FIELD(inst, QPU_ADD_A) == QPU_MUX_R4 ||
+ QPU_GET_FIELD(inst, QPU_ADD_B) == QPU_MUX_R4 ||
+ QPU_GET_FIELD(inst, QPU_MUL_A) == QPU_MUX_R4 ||
+ QPU_GET_FIELD(inst, QPU_MUL_B) == QPU_MUX_R4);
+}
+
uint64_t
qpu_merge_inst(uint64_t a, uint64_t b)
{
@@ -509,6 +518,36 @@ qpu_merge_inst(uint64_t a, uint64_t b)
return 0;
}
+ /* unpacking: Make sure that non-NOP unpacks agree, then deal with
+ * special-case failing of adding a non-NOP unpack to something with a
+ * NOP unpack.
+ */
+ if (!merge_fields(&merge, a, b, QPU_UNPACK_MASK, 0))
+ return 0;
+ bool new_a_unpack = (QPU_GET_FIELD(a, QPU_UNPACK) !=
+ QPU_GET_FIELD(merge, QPU_UNPACK));
+ bool new_b_unpack = (QPU_GET_FIELD(b, QPU_UNPACK) !=
+ QPU_GET_FIELD(merge, QPU_UNPACK));
+ if (!(merge & QPU_PM)) {
+ /* Make sure we're not going to be putting a new
+ * a-file packing on either half.
+ */
+ if (new_a_unpack && QPU_GET_FIELD(a, QPU_RADDR_A) != QPU_R_NOP)
+ return 0;
+
+ if (new_b_unpack && QPU_GET_FIELD(b, QPU_RADDR_A) != QPU_R_NOP)
+ return 0;
+ } else {
+ /* Make sure we're not going to be putting new r4 unpack on
+ * either half.
+ */
+ if (new_a_unpack && reads_r4(a))
+ return 0;
+
+ if (new_b_unpack && reads_r4(b))
+ return 0;
+ }
+
if (ok)
return merge;
else