2022-08-17 05:48:53 +00:00
|
|
|
#!/usr/bin/env python3
|
|
|
|
# SPDX-License-Identifier: MIT
|
|
|
|
|
|
|
|
import sys, pathlib, time
|
|
|
|
sys.path.append(str(pathlib.Path(__file__).resolve().parents[1]))
|
|
|
|
|
|
|
|
import atexit, sys
|
|
|
|
|
|
|
|
from m1n1.agx import AGX
|
|
|
|
from m1n1.agx.render import *
|
|
|
|
|
|
|
|
from m1n1.setup import *
|
2022-08-31 02:01:06 +00:00
|
|
|
from m1n1 import asm
|
2022-08-17 05:48:53 +00:00
|
|
|
|
|
|
|
p.pmgr_adt_clocks_enable("/arm-io/gfx-asc")
|
|
|
|
p.pmgr_adt_clocks_enable("/arm-io/sgx")
|
|
|
|
|
|
|
|
agx = AGX(u)
|
2022-08-31 02:01:06 +00:00
|
|
|
sgx = agx.sgx_dev
|
2022-08-17 05:48:53 +00:00
|
|
|
|
2022-08-31 02:01:06 +00:00
|
|
|
try:
|
|
|
|
agx.start()
|
|
|
|
agx.uat.dump(0)
|
2022-08-17 05:48:53 +00:00
|
|
|
|
2022-08-31 02:01:06 +00:00
|
|
|
print("==========================================")
|
|
|
|
print("## After init")
|
|
|
|
print("==========================================")
|
|
|
|
mon.poll()
|
|
|
|
agx.poll_objects()
|
|
|
|
|
|
|
|
ctx = GPUContext(agx)
|
|
|
|
ctx.bind(63)
|
|
|
|
|
|
|
|
f = GPUFrame(ctx, sys.argv[1], track=False)
|
|
|
|
|
|
|
|
r = GPURenderer(ctx, 8, bm_slot=0, queue=1)
|
|
|
|
print("==========================================")
|
|
|
|
print("## Submitting")
|
|
|
|
print("==========================================")
|
|
|
|
|
|
|
|
w = r.submit(f.cmdbuf)
|
2022-08-17 05:48:53 +00:00
|
|
|
|
2022-08-31 02:01:06 +00:00
|
|
|
print("==========================================")
|
|
|
|
print("## Submitted")
|
|
|
|
print("==========================================")
|
2022-08-17 05:48:53 +00:00
|
|
|
|
2022-08-31 02:01:06 +00:00
|
|
|
print("==========================================")
|
|
|
|
print("## Run")
|
|
|
|
print("==========================================")
|
2022-08-17 05:48:53 +00:00
|
|
|
|
2022-08-31 02:01:06 +00:00
|
|
|
r.run()
|
2022-08-17 05:48:53 +00:00
|
|
|
|
2022-08-31 02:01:06 +00:00
|
|
|
while not r.ev_3d.fired:
|
|
|
|
agx.asc.work()
|
|
|
|
agx.poll_channels()
|
2022-08-17 05:48:53 +00:00
|
|
|
|
2022-08-31 02:01:06 +00:00
|
|
|
r.wait()
|
2022-08-17 05:48:53 +00:00
|
|
|
|
2022-08-31 02:01:06 +00:00
|
|
|
time.sleep(3)
|
2022-08-17 05:48:53 +00:00
|
|
|
|
2022-08-31 02:01:06 +00:00
|
|
|
finally:
|
|
|
|
agx.poll_objects()
|
|
|
|
p.reboot()
|