Module: Mesa Branch: main Commit: 8ac16c97cf3340b6a837cb842b86269288d8adc5 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=8ac16c97cf3340b6a837cb842b86269288d8adc5
Author: Simon Perretta <[email protected]> Date: Wed Jan 18 15:41:23 2023 +0000 pvr: Adjust instruction repeat offset Signed-off-by: Simon Perretta <[email protected]> Acked-by: Frank Binns <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20430> --- src/imagination/rogue/passes/rogue_schedule_instr_groups.c | 4 +++- src/imagination/rogue/rogue.c | 1 + src/imagination/rogue/rogue_encode.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/imagination/rogue/passes/rogue_schedule_instr_groups.c b/src/imagination/rogue/passes/rogue_schedule_instr_groups.c index cb288fefa5b..200542ce394 100644 --- a/src/imagination/rogue/passes/rogue_schedule_instr_groups.c +++ b/src/imagination/rogue/passes/rogue_schedule_instr_groups.c @@ -174,9 +174,11 @@ static inline void rogue_instr_group_put(rogue_instr *instr, group->instrs[phase] = instr; group->header.phases |= BITFIELD_BIT(phase); + /* Ensure we're not mixing and matching repeats! */ + assert(group->header.repeat == 0 || group->header.repeat == instr->repeat); + /* Update repeat count. */ group->header.repeat = instr->repeat; - instr->repeat = 0; /* Set end flag. */ group->header.end = instr->end; diff --git a/src/imagination/rogue/rogue.c b/src/imagination/rogue/rogue.c index 3ba5aec62ae..7d062baf724 100644 --- a/src/imagination/rogue/rogue.c +++ b/src/imagination/rogue/rogue.c @@ -559,6 +559,7 @@ static inline void rogue_instr_init(rogue_instr *instr, rogue_block *block) { instr->type = type; + instr->repeat = 1; instr->index = block->shader->next_instr++; instr->block = block; } diff --git a/src/imagination/rogue/rogue_encode.c b/src/imagination/rogue/rogue_encode.c index e932d5219b8..17f781a87b0 100644 --- a/src/imagination/rogue/rogue_encode.c +++ b/src/imagination/rogue/rogue_encode.c @@ -171,7 +171,7 @@ static void rogue_encode_instr_group_header(rogue_instr_group *group, h.end = group->header.end; /* h.crel = ; */ /* Unused for now */ /* h.atom = ; */ /* Unused for now */ - h.rpt = group->header.repeat ? group->header.repeat - 1 : 0; + h.rpt = group->header.repeat - 1; } util_dynarray_append_mem(binary, group->size.header, &h);
