Skip to content

Commit 61678c4

Browse files
committed
m1n1.fw.agx: Add compute changes for G14X
Signed-off-by: Asahi Lina <[email protected]>
1 parent 34df836 commit 61678c4

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

proxyclient/m1n1/fw/agx/cmdqueue.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,15 @@ class WorkCommandCP(ConstructClass):
144144
"context_id" / Hex(Int32ul),
145145
"event_control_addr" / Hex(Int64ul),
146146
"event_control" / ROPointer(this.event_control_addr, EventControl),
147-
"unk_buf" / HexDump(Bytes(0x54)),
148-
"compute_info" / ComputeInfo,
149-
"unk_b8" / HexDump(Bytes(0x1e8 - 0xcc)),
147+
"unk_2c" / Int32ul,
148+
Ver("G >= G14X", "registers" / Array(128, RegisterDefinition)),
149+
Ver("G >= G14X", "unk_g14x" / Default(Array(64, Int32ul), [0]*64)),
150+
Ver("G < G14X", "unk_buf" / HexDump(Bytes(0x50))),
151+
Ver("G < G14X", "compute_info" / ComputeInfo),
152+
"registers_addr" / Int64ul,
153+
"register_count" / Int16ul,
154+
"registers_length" / Int16ul,
155+
"unk_pad" / HexDump(Bytes(0x24)),
150156
"microsequence_ptr" / Hex(Int64ul),
151157
"microsequence_size" / Hex(Int32ul),
152158
"microsequence" / ROPointer(this.microsequence_ptr, MicroSequence),

proxyclient/m1n1/fw/agx/microsequence.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -696,14 +696,15 @@ class ComputeInfo(ConstructClass):
696696
"iogpu_deflake_5" / Int64ul, # size 8, null
697697
"pipeline_base" / Int64ul, # 0x11_00000000: Used for certain "short" pointers like pipelines (and shaders?)
698698
"unk_38" / Int64ul, # always 0x8c60
699-
"unk_40" / Int32ul, # 0x98000; bit 0: explicit thread layout?
699+
"helper_program" / Int32ul, # 0x98000; bit 0: enable
700700
"unk_44" / Int32ul, # 0
701701
"compute_layout_addr" / Int64ul, # work layout
702702
"unk_50" / Int32ul, # 0x40 - Size? only if work layout is provided
703703
"unk_54" / Int32ul, # 0
704704
"unk_58" / Int32ul, # 1
705705
"unk_5c" / Int32ul, # 0
706706
"iogpu_unk_40" / Int32ul, # 0x1c
707+
"unk_pad" / ZPadding(0xec),
707708
)
708709

709710
# Related to "IOGPU Misc"
@@ -713,7 +714,9 @@ class ComputeInfo2(ConstructClass):
713714
"unk_0" / HexDump(Bytes(0x24)),
714715
"iogpu_deflake_1" / Int64ul,
715716
"encoder_end" / Int64ul,
716-
"unk_34" / HexDump(Bytes(0x28)),
717+
"unk_34" / HexDump(Bytes(0x20)),
718+
"unk_g14x" / Int32ul,
719+
"unk_58" / Int32ul,
717720
Ver("V < V13_0B4", "unk_5c" / ZPadding(4)),
718721
)
719722

@@ -722,7 +725,7 @@ class StartComputeCmd(ConstructClass):
722725
"magic" / Const(0x29, Int32ul),
723726
"unk_buf_addr" / Int64ul, # Pointer to WorkCommandCP.unk_buf
724727
"computeinfo_addr" / Int64ul,
725-
"computeinfo" / ROPointer(this.computeinfo_addr, ComputeInfo),
728+
Ver("G >= G14X", "registers_addr" / Int64ul),
726729
"stats_ptr" / Int64ul,
727730
"cmdqueue_ptr" / Int64ul,
728731
"context_id" / Int32ul, # 4
@@ -750,7 +753,7 @@ class FinalizeComputeCmd(ConstructClass):
750753
"cmdqueue_ptr" / Int64ul, # points back to the submitinfo
751754
"context_id" / Int32ul,
752755
Ver("V < V13_0B4", "unk_18" / Int32ul),
753-
"unkptr_1c" / Int64ul, # same as ComputeStartCmd.unkptr_3c
756+
"computeinfo2_addr" / Int64ul, # same as ComputeStartCmd.unkptr_3c
754757
"unk_24" / Int32ul,
755758
"uuid" / Int32ul, # uuid for tracking?
756759
"stamp" / Int64ul,

0 commit comments

Comments
 (0)