m1n1.trace.agx: Dump some buffers on G14X from register values

Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
Asahi Lina 2023-04-26 17:20:46 +09:00
parent 6902cb6210
commit 311385e645

View file

@ -760,7 +760,17 @@ class AGXTracer(ASCTracer):
context = wi0.context_id
def read(off, size):
return self.uat.ioread(context, off & 0x7fff_ffff_ffff_ffff, size)
data = b""
while size > 0:
boundary = (off + 0x4000) & ~0x3fff
block = min(size, boundary - off)
try:
data += self.uat.ioread(context, off & 0x7fff_ffff_ffff_ffff, block)
except Exception:
break
off += block
size -= block
return data
#chexdump(kread(wi0.addr, 0x600), print_fn=self.log)
self.log(f" context_id = {context:#x}")
@ -810,6 +820,22 @@ class AGXTracer(ASCTracer):
# self.log(f" TILES {xt} {yt} {blocks} {size:#x}")
#self.uat.dump(context, self.log)
regs = getattr(wi0, "registers", None)
if regs is not None:
for reg in regs:
if reg.number == 0x1c920: # meta1
self.log(f" meta1 @ {reg.data:#x}:")
data = read(reg.data, 0x41000)
chexdump(data, print_fn=self.log)
elif reg.number == 0x1c041: # clustering tilemaps
self.log(f" cl_tilemaps @ {reg.data:#x}:")
data = read(reg.data, 0x100000)
chexdump(data, print_fn=self.log)
elif reg.number == 0x1c039: # tilemaps
self.log(f" tilemap @ {reg.data:#x}:")
data = read(reg.data, 0x100000)
chexdump(data, print_fn=self.log)
def handle_3d(self, wi):
self.log(f"Got 3D WI{wi.cmdid:d}")
if wi.cmdid != 1: