freedreno/crashdec: Fix apparent off-by-one with ROQ size

I have multiple examples where this register is too large by one
when comparing to the ROQ read/write pointers in CP_ROQ_*_STAT and the
ROQ data itself, as if it includes the dword most recently read too. I
have an example where it's off by 2 compared to the read pointer, but
the read pointer is also off by 1 itself judging by the SQE program
counter, so that may just be them not getting synchronized. This
off-by-one was getting in the way of figuring out exactly IB2 was being
processed in the next commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19551>
This commit is contained in:
Connor Abbott 2022-10-17 18:39:16 +02:00 committed by Marge Bot
parent ce7225c0f9
commit 4060cf5772
2 changed files with 5 additions and 3 deletions

View file

@ -1670,7 +1670,7 @@ registers:
00000000 0xb622: 00000000
00000000 0xb623: 00000000
got rb_base=1000000001000
IB1: 100000000, 6
IB1: 100000000, 5
IB2: 0, 0
found ring!
got cmdszdw=27

View file

@ -359,8 +359,10 @@ dump_cmdstream(void)
* by name rather than hard-coding this.
*/
if (is_a6xx()) {
options.ibs[1].rem += regval("CP_ROQ_AVAIL_IB1") >> 16;
options.ibs[2].rem += regval("CP_ROQ_AVAIL_IB2") >> 16;
uint32_t ib1_rem = regval("CP_ROQ_AVAIL_IB1") >> 16;
uint32_t ib2_rem = regval("CP_ROQ_AVAIL_IB2") >> 16;
options.ibs[1].rem += ib1_rem ? ib1_rem - 1 : 0;
options.ibs[2].rem += ib2_rem ? ib2_rem - 1 : 0;
}
printf("IB1: %" PRIx64 ", %u\n", options.ibs[1].base, options.ibs[1].rem);