When the geometry submitted by a scene exceeds the pages currently available in the Parameter Manager (PM) freelists, the GPU raises an Out-of-Memory (PM_OUT_OF_MEMORY, EVENT_STATUS bit 7 = 0x80) event and pauses the TA stage. The SPM (Smart Parameter Management) subsystem transparently recovers the scene without failing the frame, using three progressive tiers:
ready_pages (reserve pages already pre-allocated by the host).FWCCB_CMD_FREELIST_GROW → KCCB_CMD_FREELIST_GROW_UPDATE).PM_PARTIAL_RENDER_ENABLE, 0x0338 = 1) with on-demand Z/S and MSAA buffers, frees the PM pages, and resumes TA from exactly where it paused.[D])The internal numeric encoding of SPM states is free for the clean-room implementation (it is not part of the shared ABI with the host); only the observable transitions below are normative:
[Idle]
│ EVENT_STATUS bit 7 (PM_OOM = 0x80)
▼
[Waiting for Growth / Waiting for In-Flight 3D]
├── If ready_pages > 0 or host grows freelist ────────────────► [Resume TA without PR]
│ │
└── If freelist reached max_pages / could not grow │
│ (wait for in-flight 3D if any; request Z/S backing if needed)│
▼ │
[Partial Render Running] ──► DM3 executes FRAG_PR (0x0338 = 1) │
│ PIXELBE_END_RENDER (0x08) │
▼ │
[Resume TA post-PR] │
│ │
└─────────────────────► Resume TA hardware ─────────────────────┴──► [Idle]
PM_OUT_OF_MEMORY Event (EVENT_STATUS & 0x80) ([D])Upon receiving EVENT_STATUS bit 7 in the IRQ (HW1) context:
CR[0x0138] = 0x80.local or global) was exhausted and how many pages are allocated.struct rogue_fwif_freelist with the current current_stack_top read from hardware.ready_pages:
freelist.ready_pages > 0, the firmware immediately incorporates these pages into the active freelist (reloads the freelist in the PM via 0x0208 / 0x0200 + 0x20B0/0x20A8, see kick-geometry-ta.md), clears ready_pages, and schedules immediate TA resumption (without Partial Render), while optionally requesting FREELIST_GROW from the host to replenish the reserve.FWCCB_CMD_FREELIST_GROW):
freelist.current_pages + freelist.grow_pages <= freelist.max_pages:
FWCCB_CMD_FREELIST_GROW (0x2ABC0067) with freelist_id and grow_pages, waking the host (hwirq 75).KCCB_CMD_FREELIST_GROW_UPDATE (0x2ABC006E) response (while TA remains paused).new_size > current_pages), the firmware reloads the freelist in the PM and schedules TA resumption without PR.max_pages or the host returned zero growth (allocation failure):HWRTData (Z/S and MSAA scratch) that are not yet
populated:
ROGUE_FWIF_FWCCB_CMD_ZSBUFFER_BACKING (0x2ABC0065) with the buffer
identifier in the payload and wait for ROGUE_FWIF_KCCB_CMD_ZSBUFFER_BACKING_UPDATE
(0x2ABC006C) from the host. In DDK 24.2 the same command appears as
PRBUFFER_BACKING, since it also covers Partial Render buffers;BACKED or has a pending request, do not re-emit (see §5.1).ROGUE_FWIF_CCB_CMD_TYPE_FRAG_PR command for the same HWRTData at highest priority on DM3.[P][D])Partial Render executes nearly the same sequence as a normal 3D kick (kick-compute-and-3d.md). The
firmware knows it is in a PR because the SPM controller state is 4; this state is passed
to the kick as the is_pr parameter.
BCAST[0x0338] = 1 (ROGUE_CR_PM_PARTIAL_RENDER_ENABLE), clear
CR[core*0x80000+0x0388] (3D mem-free disabled) and, unless the command requests otherwise,
enable 0x0388 only when there is one core.
Also publish CR[0x03D8] = rta_ctl.current_render_target and
CR[0x03E0] = 1 when this is the last active RT. BCAST[0x06D0] (pixel merge) comes from
the command (default value 0x1F).PIXELBE_END_RENDER, 0x08):
HWRTDATA_PARTIAL_RENDERED (BIT(3) in hwrtdata.hwrt_data_flags).hwrtdata.state = ROGUE_FWIF_RTDATA_STATE_PARTIALRENDERFINISHED (8).HW1 context.1st PR, 2nd+ PR, and Final Post-PR 3D ([D])The kick is the same in all three cases (same 3D routine, same HWRTData); what changes is a
small set of inputs:
| Input | 1st PR | 2nd+ PR | Final post-PR 3D |
|---|---|---|---|
| Command type | FRAG_PR |
FRAG_PR |
FRAG |
is_pr (SPM state == 4) |
1 |
1 |
0 |
HWRTDATA_PARTIAL_RENDERED (bit 3) |
0 | 1 (set at end of 1st) | 1 |
BCAST[0x0338] |
1 |
1 |
0 |
pds_bgnd[3] → 0x06A0..0x06AC/0x06B8/0x06BC |
pds_bgnd |
pds_bgnd |
pds_pr_bgnd (only with ROGUE_FRAG_FLAGS_SCRATCHBUFFER) |
isp_ctl.PROCESS_EMPTY_TILES (bit 17) |
0 | 0 | 1 (same condition) |
CR[0x0388] (3D mem-free) |
0 (or num_cores == 1) |
same | programmed normally |
isp_zlsctl (Z/S load) |
forced to “do not load” if buffer is not BACKED |
same | loads from already populated buffer |
Counter rta_ctl.sRTANumPartialRenders[RT] |
increments | increments | does not increment |
HWRTData state on completion |
PARTIALRENDERFINISHED (8) |
PARTIALRENDERFINISHED (8) |
3DFINISHED (5) |
Practical takeaways:
HWRTDATA_PARTIAL_RENDERED flag stays set (monotonic) and the per-RT counter increases. This
pair is what the host inspects to know how many partial passes have occurred.pds_pr_bgnd) and sets PROCESS_EMPTY_TILES so it does not re-clear what PR already wrote.CR[0x0F08] & 3 is checked before any store request, and an
HWRTData in PR is not preemptible.[D])In the interrupt handler (HW1), when the OOM-paused TA is ready to resume:
hwrtdata.state = ROGUE_FWIF_RTDATA_STATE_KICK_GEOM (1).CR[0x0328] = 1 (release/resume PM after OOM).CR[0x0CF8] = 1 (resume TE/VDM from the point where it paused).CR[0x0B00] = 0.HWRTData was loaded in the 3D context (HW ctx 1) with state ROGUE_FWIF_RTDATA_STATE_PARTIALRENDERFINISHED (8), save the PM catalogue bases of context 1 and unbind it.hwrtdata.state = ROGUE_FWIF_RTDATA_STATE_KICK_GEOM (1).CR[0x03D0] and CR[0x03D4] (mask ~0x10000 / ~0x100 for primary context, or bits 0x20000 / 0x200 for secondary context).CR[0x0290] = 1 and CR[0x0198] = 1 (post-PR PM list state reinitialization).mask = 1 for primary ctx, 4 for secondary ctx).CR[0x1248/1250/1260] (or 0x1268/1270/1280 for secondary).CR[0x01B8] = 1 → Mandatory poll CR[0x01B8] bit 0 == 0.CR[0x0328] = 1CR[0x0CA8] = 1 (resume TE after PR — distinct from 0x0CF8 used in the non-PR case)CR[0x0B00] = 0.[P][D])[D])The firmware describes on-demand buffers using a stateful descriptor
(RGXFWIF_PRBUFFER_STATE: UNBACKED=0, BACKED=1, BACKING_PENDING=2,
UNBACKING_PENDING=3). The request routine walks a null-terminated list and, per buffer:
if the descriptor says the buffer is unused: do not request (log it)
else if state == BACKED: do not request
else if state == BACKING_PENDING: do not request (request already in flight)
else (UNBACKED, or UNBACKING_PENDING): emit FWCCB 0x2ABC0065 (ZS/PR buffer) with the ID
mark BACKING_PENDING
When the host finishes, it sends KCCB_CMD_ZSBUFFER_BACKING_UPDATE (0x2ABC006C) with the ID; the
firmware marks the buffer as BACKED and the pending PR can be dispatched. The unbacking path
emits ROGUE_FWIF_FWCCB_CMD_PRBUFFER_UNBACKING (0x2ABC0066) when the final 3D render of that
HWRTData completes normally and no other render references the buffer.
[D])The address returned by the host is not written directly by the KCCB handler: it takes effect
on the next 3D kick, which already reads isp_zload_store_base and
isp_stencil_load_store_base from the command and applies:
BCAST[0x0F48] = isp_zlsctl
BCAST[0x0F50]/[0x0F54] = isp_zload_store_base (+ current_rt * zls_stride, via slice patch)
BCAST[0x0F58]/[0x0F5C] = isp_zload_store_base (store — same value on normal kick)
BCAST[0x0F60]/[0x0F64] = isp_stencil_load_store_base
BCAST[0x0F68]/[0x0F6C] = isp_stencil_load_store_base
If the buffer descriptor indicates it is not BACKED at kick time, the firmware forces the
“do not load” bits in isp_zlsctl (0x8002 for depth, 0x4002 for stencil) instead of reading
unpopulated memory.
FWCCB_CMD_ZSBUFFER_UNBACKING (0x2ABC0066, PRBUFFER_UNBACKING in DDK 24.2) is emitted when
HWRTData no longer needs the buffer (end of the final 3D render, or HWRTData teardown), so the
driver can release the physical memory temporarily allocated during Partial Render.
[O])The event is bit 7 (0x80) of ROGUE_CR_EVENT_STATUS, cleared with
CR[0x0138] = 0x80. Decision path:
CR[0x0138] = 0x80; /* event W1C */
if (!ctx->oom_flag) handle_oom(...);
else { mark DM lockup; notify context reset; } /* escalates to HWR */
There is no “which PB” register: the firmware derives it from HWRTData:
fl = (hwrtdata.flags & GLOBAL_PB_NUMBER_BIT0)
? hwrtdata.apsFreeLists[2] /* global */
: hwrtdata.apsFreeLists[1]; /* local */
if fl.ready_pages (+0x30) == 0: /* no reserved pages */
CR[0x0320] = 1 /* terminate/flush TA */
poll(CR[0x0130] & 0x40 == 0x40) /* TA_TERMINATE */
if timeout: DM2 completion flush (data-masters.md §4.1)
oom_bitmap |= 1 << dm ; mark "HWR pending"
else:
grow(fl, fl.current_pages + fl.ready_pages)
CR[0x0328] = 1 /* ack: resume PM/TA */
sample_progress(0x6020)
CR[0x0B00] = 0 /* MTS: reschedule BG */
request new grow from host (freelist grow KCCB)
That is: 0x0328 is the ack that resumes the PM; 0x0320 only appears on
the path where there are no reserved pages and TA must be terminated/flushed.
If an HWR is already in progress, OOM is not handled immediately: the DM is recorded in an internal bitmap and re-evaluated when HWR finishes (the IRQ handler only invokes OOM handling when the HWR state is idle).