From 4b929ae9f0c61c3e022267100ff530a032a31c60 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Thu, 11 Feb 2021 11:52:13 +0100 Subject: [PATCH] broadcom/compiler: don't check for GFXH-1633 on V3D 4.2.x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Part-of: --- src/broadcom/compiler/qpu_validate.c | 30 ++++++++++++++++++---------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/broadcom/compiler/qpu_validate.c b/src/broadcom/compiler/qpu_validate.c index a2de9f56328..ec9ed66650c 100644 --- a/src/broadcom/compiler/qpu_validate.c +++ b/src/broadcom/compiler/qpu_validate.c @@ -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;