diff options
author | Marek Olšák <marek.olsak@amd.com> | 2023-02-21 11:33:13 -0500 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2023-03-08 18:00:15 +0000 |
commit | 3c705ffac9c8b2c085e56118009bfdfeeb5933c1 (patch) | |
tree | 828e545f3ef70b2b95f0c70ce4502bfb3137491c | |
parent | 6cc56aa7df08aafb352d21bec71bebfa8a533e9f (diff) | |
download | mesa-3c705ffac9c8b2c085e56118009bfdfeeb5933c1.tar.gz |
radeonsi: don't merge SET_* packets that have a different index in si_pm4_state
Oops.
Fixes: c8e2c6faf64 ("radeonsi: use SET_SH_REG_INDEX with index=3 for registers containing CU_EN")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
(cherry picked from commit 3a26d2b1a7f81ae719037cd734ac776a3c6ab65b)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pm4.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pm4.h | 1 |
3 files changed, 4 insertions, 2 deletions
diff --git a/.pick_status.json b/.pick_status.json index 1734e9963ca..2abe49b05b2 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3253,7 +3253,7 @@ "description": "radeonsi: don't merge SET_* packets that have a different index in si_pm4_state", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "c8e2c6faf6448697d949b962179a543ac9c2afee" }, diff --git a/src/gallium/drivers/radeonsi/si_pm4.c b/src/gallium/drivers/radeonsi/si_pm4.c index f8454cd302c..857f60214e2 100644 --- a/src/gallium/drivers/radeonsi/si_pm4.c +++ b/src/gallium/drivers/radeonsi/si_pm4.c @@ -63,13 +63,14 @@ static void si_pm4_set_reg_custom(struct si_pm4_state *state, unsigned reg, uint assert(state->ndw + 2 <= state->max_dw); - if (opcode != state->last_opcode || reg != (state->last_reg + 1)) { + if (opcode != state->last_opcode || reg != (state->last_reg + 1) || idx != state->last_idx) { si_pm4_cmd_begin(state, opcode); state->pm4[state->ndw++] = reg | (idx << 28); } assert(reg <= UINT16_MAX); state->last_reg = reg; + state->last_idx = idx; state->pm4[state->ndw++] = val; si_pm4_cmd_end(state, false); } diff --git a/src/gallium/drivers/radeonsi/si_pm4.h b/src/gallium/drivers/radeonsi/si_pm4.h index 4d1770a96d8..a0c50e6a3f0 100644 --- a/src/gallium/drivers/radeonsi/si_pm4.h +++ b/src/gallium/drivers/radeonsi/si_pm4.h @@ -47,6 +47,7 @@ struct si_pm4_state { uint16_t last_pm4; uint16_t ndw; /* number of dwords in pm4 */ uint8_t last_opcode; + uint8_t last_idx; /* For shader states only */ bool is_shader; |