mirror of
https://github.com/AsahiLinux/m1n1
synced 2024-11-22 22:53:04 +00:00
m1n1.fw.agx: More compute and blit stuff
Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
parent
074892377c
commit
9e93bd70e4
3 changed files with 116 additions and 1 deletions
|
@ -350,6 +350,71 @@ class WorkCommandTA(ConstructClass):
|
|||
Ver("V >= V13_0B4", "pad_5e0" / Default(HexDump(Bytes(0x18)), bytes(0x18))),
|
||||
)
|
||||
|
||||
class WorkCommandBlit(ConstructClass):
|
||||
subcon = Struct(
|
||||
"addr" / Tell,
|
||||
"magic" / Const(0x2, Int32ul),
|
||||
Ver("V >= V13_0B4", "counter" / Int64ul),
|
||||
"context_id" / Int32ul,
|
||||
"event_control_addr" / Hex(Int64ul),
|
||||
"event_control" / ROPointer(this.event_control_addr, EventControl),
|
||||
"unk_10" / Hex(Int32ul),
|
||||
"unk_14" / Int32ul,
|
||||
"unk_18" / Int64ul,
|
||||
"unk_20" / Int64ul,
|
||||
"unk_28" / Int64ul,
|
||||
"unk_30" / Int64ul,
|
||||
"unk_38" / Int64ul,
|
||||
"unk_40" / Int64ul,
|
||||
"unk_48" / HexDump(Bytes(0xa0)),
|
||||
"unkptr_e8" / Int64ul,
|
||||
"unk_f0" / Int64ul,
|
||||
"unkptr_f8" / Int64ul,
|
||||
"pipeline_base" / Int64ul,
|
||||
"unk_108" / Int64ul,
|
||||
"unk_110" / HexDump(Bytes(0x248)),
|
||||
"unk_358" / Int32ul,
|
||||
"unk_35c" / Int32ul,
|
||||
"unk_360" / Int32ul,
|
||||
"unk_364" / Int32ul,
|
||||
"unk_368" / Float32l,
|
||||
"unk_36c" / Float32l,
|
||||
"unk_370" / Int64ul,
|
||||
"unk_378" / Int64ul,
|
||||
"unk_380" / Int64ul,
|
||||
"unk_388" / Int64ul,
|
||||
"unk_390" / HexDump(Bytes(0xd8)),
|
||||
"unk_468" / Int64ul,
|
||||
"unk_470" / Int64ul,
|
||||
"unk_478" / Int32ul,
|
||||
"unk_47c" / Int32ul,
|
||||
"unk_480" / Int64ul,
|
||||
"unk_488" / Int64ul,
|
||||
"microsequence_ptr" / Hex(Int64ul),
|
||||
"microsequence_size" / Hex(Int32ul),
|
||||
"microsequence" / ROPointer(this.microsequence_ptr, MicroSequence),
|
||||
"unkptr_49c" / HexDump(Bytes(0x114)),
|
||||
"job_meta" / JobMeta,
|
||||
"unk_5d8" / Int32ul,
|
||||
"unk_stamp_ptr" / Int64ul,
|
||||
"unk_stamp_val" / Int32ul,
|
||||
"unk_5ec" / Int32ul,
|
||||
"encoder_params" / EncoderParams,
|
||||
"unk_618" / Int32ul,
|
||||
"ts1" / TimeStamp,
|
||||
"ts2" / TimeStamp,
|
||||
"ts3" / TimeStamp,
|
||||
"unk_634" / Int32ul,
|
||||
"unk_638" / Int32ul,
|
||||
"unk_63c" / Int32ul,
|
||||
"unk_640" / Int32ul,
|
||||
"client_sequence" / Int8ul,
|
||||
"pad_645" / Default(HexDump(Bytes(0x3)), bytes(0x3)),
|
||||
"unk_648" / Int32ul,
|
||||
"unk_64c" / Int8ul,
|
||||
"pad_64d" / Default(HexDump(Bytes(0x7)), bytes(0x7)),
|
||||
)
|
||||
|
||||
class UnknownWorkCommand(ConstructClass):
|
||||
subcon = Struct(
|
||||
"magic" / Hex(Int32ul),
|
||||
|
@ -368,6 +433,7 @@ class CmdBufWork(ConstructClass):
|
|||
"cmd" / Switch(this.cmdid, {
|
||||
0: WorkCommandTA,
|
||||
1: WorkCommand3D,
|
||||
2: WorkCommandBlit,
|
||||
3: WorkCommandCP,
|
||||
4: WorkCommandBarrier,
|
||||
6: WorkCommandInitBM,
|
||||
|
|
|
@ -713,7 +713,9 @@ class StartComputeCmd(ConstructClass):
|
|||
"computeinfo2" / ROPointer(this.computeinfo2_addr, ComputeInfo2),
|
||||
"unk_44" / Int32ul,
|
||||
"uuid" / Int32ul,
|
||||
"padding" / Bytes(0x154 - 0x4c),
|
||||
"attachments" / Array(16, Attachment),
|
||||
"num_attachments" / Int32ul,
|
||||
"padding" / Bytes(4),
|
||||
Ver("V >= V13_0B4", "unk_flag_addr" / Int64ul),
|
||||
Ver("V >= V13_0B4", "counter" / Int64ul),
|
||||
Ver("V >= V13_0B4", "event_ctrl_buf_addr" / Int64ul),
|
||||
|
@ -748,6 +750,47 @@ class FinalizeComputeCmd(ConstructClass):
|
|||
Ver("V >= V13_0B4", "pad_79" / ZPadding(7)),
|
||||
)
|
||||
|
||||
class StartBlitCmd(ConstructClass):
|
||||
subcon = Struct(
|
||||
"magic" / Const(0x26, Int32ul),
|
||||
"unkptr_4" / Int64ul,
|
||||
"unkptr_c" / Int64ul,
|
||||
"unk_14" / Int64ul,
|
||||
"unkptr_1c" / Int64ul,
|
||||
"unkptr_24" / Int64ul,
|
||||
"context_id" / Int32ul,
|
||||
"unk_30" / Int32ul,
|
||||
"submission_id" / Int32ul,
|
||||
"unk_38" / Int32ul,
|
||||
"unk_3c" / Int32ul,
|
||||
"unk_40" / Int32ul,
|
||||
"unkptr_44" / Int64ul,
|
||||
"unkptr_4c" / Int64ul,
|
||||
"uuid" / Int32ul,
|
||||
"unk_2c" / Int32ul,
|
||||
"attachments" / Array(16, Attachment),
|
||||
"num_attachments" / Int32ul,
|
||||
"unk_160" / Int32ul,
|
||||
)
|
||||
|
||||
class FinalizeBlitCmd(ConstructClass):
|
||||
subcon = Struct(
|
||||
"magic" / Const(0x27, Int32ul),
|
||||
"unkptr_4" / Int64ul,
|
||||
"unkptr_c" / Int64ul,
|
||||
"context_id" / Int32ul,
|
||||
"unk_18" / Int32ul,
|
||||
"unkptr_1c" / Int64ul,
|
||||
"uuid" / Int32ul,
|
||||
"unk_28" / Int32ul,
|
||||
"stamp_addr" / Int64ul,
|
||||
"stamp" / ROPointer(this.stamp_addr, StampCounter),
|
||||
"stamp_value" / Int32ul,
|
||||
"unk_38" / HexDump(Bytes(0x24)),
|
||||
"restart_branch_offset" / Int32sl, # relative
|
||||
"unk_60" / Int32ul,
|
||||
)
|
||||
|
||||
class EndCmd(ConstructClass):
|
||||
subcon = Struct(
|
||||
"magic" / Const(0x18, Int8ul),
|
||||
|
@ -818,6 +861,8 @@ class MicroSequence(ConstructValueClass):
|
|||
0x23: FinalizeTACmd,
|
||||
0x24: Start3DCmd,
|
||||
0x25: Finalize3DCmd,
|
||||
0x26: StartBlitCmd,
|
||||
0x27: FinalizeBlitCmd,
|
||||
0x29: StartComputeCmd,
|
||||
0x2a: FinalizeComputeCmd,
|
||||
}, default=Error)
|
||||
|
|
|
@ -654,6 +654,10 @@ class AGXTracer(ASCTracer):
|
|||
# 3D
|
||||
if not self.encoder_id_filter(wi.cmd.struct_6.encoder_id):
|
||||
return True
|
||||
if wi.cmd.magic == 3:
|
||||
# CP
|
||||
if not self.encoder_id_filter(wi.cmd.encoder_params.encoder_id):
|
||||
return True
|
||||
for wi in work_items:
|
||||
self.log(str(wi))
|
||||
if msg.queue_type == 2:
|
||||
|
|
Loading…
Reference in a new issue