summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_qpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_qpu.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_qpu.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc4/vc4_qpu.c b/src/gallium/drivers/vc4/vc4_qpu.c
index a551a0fa187..093ca077e6d 100644
--- a/src/gallium/drivers/vc4/vc4_qpu.c
+++ b/src/gallium/drivers/vc4/vc4_qpu.c
@@ -244,3 +244,26 @@ qpu_set_cond_mul(uint64_t inst, uint32_t sig)
return (inst & ~QPU_COND_MUL_MASK) | QPU_SET_FIELD(sig, QPU_COND_MUL);
}
+bool
+qpu_waddr_is_tlb(uint32_t waddr)
+{
+ switch (waddr) {
+ case QPU_W_TLB_COLOR_ALL:
+ case QPU_W_TLB_COLOR_MS:
+ case QPU_W_TLB_Z:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool
+qpu_inst_is_tlb(uint64_t inst)
+{
+ uint32_t sig = QPU_GET_FIELD(inst, QPU_SIG);
+
+ return (qpu_waddr_is_tlb(QPU_GET_FIELD(inst, QPU_WADDR_ADD)) ||
+ qpu_waddr_is_tlb(QPU_GET_FIELD(inst, QPU_WADDR_MUL)) ||
+ sig == QPU_SIG_COLOR_LOAD ||
+ sig == QPU_SIG_WAIT_FOR_SCOREBOARD);
+}