Power, HWR, statistics and trace
Power management (src/power.c)
update_pow_state() keeps sysdata.pow_state accurate: ON while any
DM is busy or any context has pending commands, FORCED_IDLE under a host
forced-idle request, and IDLE otherwise.
pow_handle() handles KCCB_POW requests and signals completion by
writing 1 to *fwptr(osdata.power_sync_fw_addr):
FORCED_IDLE_REQ(force/timeout): setsg.forced_idle = true,pow_state = FORCED_IDLE, sync =1.FORCED_IDLE_REQ(cancel): clearsg.forced_idle, restorespow_state = IDLE, sync =1.OFF_REQ: tracesPOW_59andMAIN_145/MAIN_144, callstlb_flush_dynamic(), setspow_state = OFF, masks the CP0 timer interrupt, setsg.powered_off = true, sync =1.NUM_UNITS_CHANGE/APM_LATENCY_CHANGE: acknowledges with sync =1.
Per-job dust power (POW_RASCALDUST) is not needed because mainline
powervr does not enable it; dusts are powered on at boot and after HWR.
Hardware recovery (src/hwr.c)
Triggered by either:
EVENT_STATUS.MMU_PAGE_FAULT(kick_events()first tracesHWR_80withBIF_FAULT_BANK0_MMU_STATUSandREQ_STATUS), orhwr_watchdog()on the 1 ms timer tick whenever a DM has been busy for longer than its context’smax_deadline_ms(30 s from mainline host, 30 s fallback; E021).
hwr_recover() executes the reset sequence (docsClean/BXE-2-32/hardware-recovery,
verified in E019 at ~0.28 ms):
Clear
HARDWARE_OKand setRESET_IN_PROGRESSinsysdata.hwr_state_flags.Flush and invalidate the SLC and wait for idle.
Clear
PM_PARTIAL_RENDER_ENABLE = 0.Pulse
SOFT_RESETvia broadcast:0x13FFFC1D/0xFFEFFE00→0(leaves the MIPS core and MTS wrapper running).Re-run
gpu_power_on(),gpu_units_init()andbif_rebuild().Clear all GPU events and discard the running command on every busy DM (its trailing UFO updates still execute so host fences complete).
Record a
rogue_hwrinfoentry and queue a FWCCBCONTEXT_RESET_NOTIFICATIONfor each discarded command (E025).Restore
HARDWARE_OK | DM_RUNNING_OK, incrementCR_DBG_HWR_COUNT, and reschedule.
Traces emitted during recovery: HWR_32, HWR_28, HWR_61,
MAIN_27, HWR_14, HWR_25 and HWR_62.
Statistics and HWR reporting (src/stats.c)
Verified in E025:
Time correlation: appends an entry to
gpu_util_fwcb.time_corr[]at every boot and onKCCB_CORECLKSPEEDCHANGE, then bumpstime_corr_seq_count.Utilisation: accumulates elapsed nanoseconds into
stats_counters[ACTIVE | BLOCKED | IDLE], updateslast_word = time | state, updatessysdata.start_idle_timeon idle, and tracesPOW_2,POW_22andDBG_20.HWR log & FWCCB: populates
rogue_hwrinfo(first 8 entries kept, last 8 ring-buffered, plus per-DM counters) and sends FWCCBCONTEXT_RESET_NOTIFICATION(105).
Trace points emitted (src/util.c)
SFID |
Event |
|---|---|
|
Pre-init MTS register snapshot; |
|
Dust power on; |
|
End of firmware init |
|
KCCB command picked / return value |
|
|
|
Task dispatched to a DM |
|
Memory context bound to a BIF slot |
|
Compute kick / compute finished |
|
3D transfer ( |
|
UFO update |
|
Bad cCCB command / unimplemented task retired immediately |
|
Clock speed change |
|
Idle timer and power-state transitions |
|
|
|
MMU fault dump and HWR sequence |
|
FWCCB ring full |