broadcom/compiler: fix end of TMU sequence check
We may be pipelining TMU writes and reads, in which case we can see both TMUWT and LDTMU at the end of a TMU sequence, so we should not assume that a TMUWT always terminates a sequence. Also, we had a bug where we were using inst instead of scan_inst to check if we find another TMUWT after the curent instruction. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15041>
This commit is contained in:

committed by
Marge Bot

parent
40e091267d
commit
92d819aaa0
@@ -44,23 +44,22 @@ static bool
|
|||||||
is_end_of_tmu_sequence(const struct v3d_device_info *devinfo,
|
is_end_of_tmu_sequence(const struct v3d_device_info *devinfo,
|
||||||
struct qinst *inst, struct qblock *block)
|
struct qinst *inst, struct qblock *block)
|
||||||
{
|
{
|
||||||
if (inst->qpu.type == V3D_QPU_INSTR_TYPE_ALU &&
|
/* Only tmuwt and ldtmu can finish TMU sequences */
|
||||||
inst->qpu.alu.add.op == V3D_QPU_A_TMUWT) {
|
bool is_tmuwt = inst->qpu.type == V3D_QPU_INSTR_TYPE_ALU &&
|
||||||
return true;
|
inst->qpu.alu.add.op == V3D_QPU_A_TMUWT;
|
||||||
}
|
bool is_ldtmu = inst->qpu.sig.ldtmu;
|
||||||
|
if (!is_tmuwt && !is_ldtmu)
|
||||||
if (!inst->qpu.sig.ldtmu)
|
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* Check if this is the last tmuwt or ldtmu in the sequence */
|
||||||
list_for_each_entry_from(struct qinst, scan_inst, inst->link.next,
|
list_for_each_entry_from(struct qinst, scan_inst, inst->link.next,
|
||||||
&block->instructions, link) {
|
&block->instructions, link) {
|
||||||
if (scan_inst->qpu.sig.ldtmu)
|
is_tmuwt = scan_inst->qpu.type == V3D_QPU_INSTR_TYPE_ALU &&
|
||||||
return false;
|
scan_inst->qpu.alu.add.op == V3D_QPU_A_TMUWT;
|
||||||
|
is_ldtmu = scan_inst->qpu.sig.ldtmu;
|
||||||
|
|
||||||
if (inst->qpu.type == V3D_QPU_INSTR_TYPE_ALU &&
|
if (is_tmuwt || is_ldtmu)
|
||||||
inst->qpu.alu.add.op == V3D_QPU_A_TMUWT) {
|
return false;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (qinst_writes_tmu(devinfo, scan_inst))
|
if (qinst_writes_tmu(devinfo, scan_inst))
|
||||||
return true;
|
return true;
|
||||||
|
Reference in New Issue
Block a user