From b3ac456eb1df0976ee4036cd191b557682923d04 Mon Sep 17 00:00:00 2001 From: Iago Toral Quiroga Date: Mon, 24 Apr 2023 08:51:47 +0200 Subject: [PATCH] broadcom/compiler: add a v3d_qpu_instr_is_legacy_sfu helper MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This checks for the deprecated, old-style SFU instructions triggered by magic writes. Reviewed-by: Alejandro Piñeiro cc: mesa-stable Part-of: --- src/broadcom/qpu/qpu_instr.c | 10 ++++++++-- src/broadcom/qpu/qpu_instr.h | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/broadcom/qpu/qpu_instr.c b/src/broadcom/qpu/qpu_instr.c index f793d03..1d9c8e6 100644 --- a/src/broadcom/qpu/qpu_instr.c +++ b/src/broadcom/qpu/qpu_instr.c @@ -660,9 +660,15 @@ v3d_qpu_uses_tlb(const struct v3d_qpu_instr *inst) bool v3d_qpu_uses_sfu(const struct v3d_qpu_instr *inst) { - if (v3d_qpu_instr_is_sfu(inst)) - return true; + return v3d_qpu_instr_is_sfu(inst) || v3d_qpu_instr_is_legacy_sfu(inst); +} +/* Checks whether the instruction implements a SFU operation by the writing + * to specific magic register addresses instead of using SFU ALU opcodes. + */ +bool +v3d_qpu_instr_is_legacy_sfu(const struct v3d_qpu_instr *inst) +{ if (inst->type == V3D_QPU_INSTR_TYPE_ALU) { if (inst->alu.add.op != V3D_QPU_A_NOP && inst->alu.add.magic_write && diff --git a/src/broadcom/qpu/qpu_instr.h b/src/broadcom/qpu/qpu_instr.h index 6c81d60..2e13347 100644 --- a/src/broadcom/qpu/qpu_instr.h +++ b/src/broadcom/qpu/qpu_instr.h @@ -452,6 +452,7 @@ bool v3d_qpu_magic_waddr_is_tsy(enum v3d_qpu_waddr waddr) ATTRIBUTE_CONST; bool v3d_qpu_magic_waddr_loads_unif(enum v3d_qpu_waddr waddr) ATTRIBUTE_CONST; bool v3d_qpu_uses_tlb(const struct v3d_qpu_instr *inst) ATTRIBUTE_CONST; bool v3d_qpu_instr_is_sfu(const struct v3d_qpu_instr *inst) ATTRIBUTE_CONST; +bool v3d_qpu_instr_is_legacy_sfu(const struct v3d_qpu_instr *inst) ATTRIBUTE_CONST; bool v3d_qpu_uses_sfu(const struct v3d_qpu_instr *inst) ATTRIBUTE_CONST; bool v3d_qpu_writes_tmu(const struct v3d_device_info *devinfo, const struct v3d_qpu_instr *inst) ATTRIBUTE_CONST; -- 2.7.4