From 2d5784c8254b4a0e3e04dd0f1e46ab1eb85612dd Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 26 Nov 2014 17:01:59 -0800 Subject: vc4: Add another check for invalid TLB scoreboard handling. This was caught by an assertion in the simulator. --- src/gallium/drivers/vc4/vc4_qpu.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'src/gallium/drivers/vc4/vc4_qpu.c') 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); +} -- cgit v1.2.3