From 40aea06bd01c1e5b97e71d5674c2b35b50515615 Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Thu, 4 Sep 2025 11:08:21 -0400 Subject: [PATCH] nouveau/push: Fix SET_OBJECT handling My first attempt to fix it ended up stomping classes to zero because it happened too eary. Now it happens after we have the whole method parsed but before we go searching for strings. Fixes: 8e93a763a36f ("nouveau/push: Handle more recent versions of 6F") Part-of: --- src/nouveau/headers/nv_push.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/nouveau/headers/nv_push.c b/src/nouveau/headers/nv_push.c index 13aef368f75..cee6e74b131 100644 --- a/src/nouveau/headers/nv_push.c +++ b/src/nouveau/headers/nv_push.c @@ -109,13 +109,6 @@ vk_push_print(FILE *fp, const struct nv_push *push, fprintf(fp, "HDR %x subch %i", hdr, subchan); } - if (mthd == 0) { /* SET_OBJECT */ - curr_subchans[subchan] = value & 0xffff; - } - int class_id = curr_subchans[subchan]; - int cls_hi = (class_id & 0xff00) >> 8; - int cls_lo = class_id & 0xff; - cur++; const char *mthd_name = ""; @@ -174,6 +167,16 @@ vk_push_print(FILE *fp, const struct nv_push *push, } while (count--) { + if (!is_immd) + value = *cur; + + if (mthd == 0) { /* SET_OBJECT */ + curr_subchans[subchan] = value & 0xffff; + } + int class_id = curr_subchans[subchan]; + int cls_hi = (class_id & 0xff00) >> 8; + int cls_lo = class_id & 0xff; + if (!is_tert) { if (mthd < 0x100) { if (cls_hi >= 0xc5) @@ -250,9 +253,6 @@ vk_push_print(FILE *fp, const struct nv_push *push, } } - if (!is_immd) - value = *cur; - fprintf(fp, "\tmthd %04x %s\n", mthd, mthd_name); if (mthd < 0x100) { if (cls_hi >= 0xb0)