experiments/agx_renderframe.py: Rework based on the other demos

Signed-off-by: Asahi Lina <lina@asahilina.net>
This commit is contained in:
Asahi Lina 2022-08-31 11:01:06 +09:00
parent fddb8d63e0
commit 0e8a522845

View file

@ -10,33 +10,54 @@ from m1n1.agx import AGX
from m1n1.agx.render import *
from m1n1.setup import *
from m1n1 import asm
p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
p.pmgr_adt_clocks_enable("/arm-io/sgx")
agx = AGX(u)
mon = RegMonitor(u, ascii=True, bufsize=0x8000000)
agx.mon = mon
sgx = agx.sgx_dev
#mon.add(sgx.gpu_region_base, sgx.gpu_region_size, "contexts")
#mon.add(sgx.gfx_shared_region_base, sgx.gfx_shared_region_size, "gfx-shared")
#mon.add(sgx.gfx_handoff_base, sgx.gfx_handoff_size, "gfx-handoff")
#mon.add(agx.initdasgx.gfx_handoff_base, sgx.gfx_handoff_size, "gfx-handoff")
try:
agx.start()
agx.uat.dump(0)
atexit.register(p.reboot)
agx.start()
print("==========================================")
print("## After init")
print("==========================================")
mon.poll()
agx.poll_objects()
ctx = GPUContext(agx)
ctx.bind(2)
ctx = GPUContext(agx)
ctx.bind(63)
renderer = GPURenderer(ctx, 256, bm_slot=2, queue=1)
f = GPUFrame(ctx, sys.argv[1], track=False)
f = GPUFrame(ctx, sys.argv[1], track=False)
r = GPURenderer(ctx, 8, bm_slot=0, queue=1)
print("==========================================")
print("## Submitting")
print("==========================================")
renderer.submit(f.cmdbuf)
renderer.wait()
w = r.submit(f.cmdbuf)
time.sleep(2)
print("==========================================")
print("## Submitted")
print("==========================================")
print("==========================================")
print("## Run")
print("==========================================")
r.run()
while not r.ev_3d.fired:
agx.asc.work()
agx.poll_channels()
r.wait()
time.sleep(3)
finally:
agx.poll_objects()
p.reboot()