diff options
author | Alex Deucher <[email protected]> | 2012-09-28 12:09:16 -0400 |
---|---|---|
committer | Christian König <[email protected]> | 2012-10-01 10:29:50 +0200 |
commit | 918e302a19d960b331c7dddf17b31a3ad3f4a627 (patch) | |
tree | a457b7d3ee24d9d7d8e15875d0454064908ba655 /src/gallium/drivers | |
parent | f1a3de5e9dd8f965fc99cb33e36643b8e8aac018 (diff) |
radeonsi: fix range checking for state regs
end value is exclusive, but in practice we shouldn't
hit this.
Signed-off-by: Alex Deucher <[email protected]>
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r-- | src/gallium/drivers/radeonsi/radeonsi_pm4.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gallium/drivers/radeonsi/radeonsi_pm4.c b/src/gallium/drivers/radeonsi/radeonsi_pm4.c index ea0a1bd1aec..79a2521f339 100644 --- a/src/gallium/drivers/radeonsi/radeonsi_pm4.c +++ b/src/gallium/drivers/radeonsi/radeonsi_pm4.c @@ -57,17 +57,18 @@ void si_pm4_set_reg(struct si_pm4_state *state, unsigned reg, uint32_t val) { unsigned opcode; - if (reg >= SI_CONFIG_REG_OFFSET && reg <= SI_CONFIG_REG_END) { + if (reg >= SI_CONFIG_REG_OFFSET && reg < SI_CONFIG_REG_END) { opcode = PKT3_SET_CONFIG_REG; reg -= SI_CONFIG_REG_OFFSET; - } else if (reg >= SI_SH_REG_OFFSET && reg <= SI_SH_REG_END) { + } else if (reg >= SI_SH_REG_OFFSET && reg < SI_SH_REG_END) { opcode = PKT3_SET_SH_REG; reg -= SI_SH_REG_OFFSET; - } else if (reg >= SI_CONTEXT_REG_OFFSET && reg <= SI_CONTEXT_REG_END) { + } else if (reg >= SI_CONTEXT_REG_OFFSET && reg < SI_CONTEXT_REG_END) { opcode = PKT3_SET_CONTEXT_REG; reg -= SI_CONTEXT_REG_OFFSET; + } else { R600_ERR("Invalid register offset %08x!\n", reg); return; |