m1n1.agx.context: BufferManager fixes, add explicit counter management

Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
Asahi Lina 2022-08-17 13:45:09 +09:00
parent c94c020197
commit 8647e1102c

View file

@ -180,7 +180,7 @@ class GPUBufferManager:
self.block_ctl = self.block_ctl_obj.push().regmap()
self.counter_obj = agx.kshared.new(BufferManagerCounter)
self.counter_obj.count = 1
self.counter_obj.count = 0
self.counter = self.counter_obj.push().regmap()
self.misc_obj = agx.kshared.new(BufferManagerMisc)
@ -206,9 +206,6 @@ class GPUBufferManager:
info.block_size = self.block_size
info.counter = self.counter_obj
info.misc = self.misc_obj
info.unkptr_d8 = context.uobj.buf(0x80, "BufferManager unk")
self.populate()
self.block_ctl_obj.pull()
@ -217,6 +214,10 @@ class GPUBufferManager:
info.push()
def increment(self):
self.counter_obj.count += 1
self.counter_obj.push()
def populate(self):
idx = self.block_ctl.wptr.val
total = self.block_ctl.total.val