The FWCCB (Firmware Command Control Buffer) is the unidirectional ring buffer through which the firmware sends asynchronous notifications to the Linux driver (pvr_ccb.c), such as freelist grow requests (OOM/SPM), on-demand Z/S buffer backing, HWR alerts, firmware page faults, and freelist reconstruction requests.
[P][D])The FWCCB uses the same struct rogue_fwif_ccb_ctl (144 bytes, write_offset at +0x00, read_offset at +0x80, wrap_mask at +0x84, cmd_size at +0x88) as the KCCB, with reversed roles:
write_offset).read_offset inside the IRQ handler/worker).cmd_size): 88 bytes (struct rogue_fwif_fwccb_cmd: cmd_type at +0x00, fwccb_flags at +0x04, cmd_data at +0x08).((write_offset + 1) & wrap_mask) == read_offset.[D])((write_offset + 1) & wrap_mask) != read_offset.
cmd_type (0x2ABC0000 | id), fwccb_flags, and the corresponding payload at firmware_ccb_fw_addr + (write_offset * cmd_size).write_offset.fwccb_ctl.write_offset = (write_offset + 1) & wrap_mask.0xBFC01800 = 1, ehb, sync) and trigger the host interrupt (target OSID → APLIC hwirq 75).[P][D])The codes match enum rogue_fwif_fwccb_cmd_type (pvr_rogue_fwif.h) exactly:
Public Command (ROGUE_FWIF_FWCCB_CMD_*) |
ID (0x2ABC00..) |
Member in cmd_data |
When the Firmware Must Emit |
|---|---|---|---|
ZSBUFFER_BACKING |
0x2ABC0065 (101) |
cmd_zs_buffer_backing |
During SPM/Partial Render when the render target needs physical backing for on-demand Z/S or MSAA |
ZSBUFFER_UNBACKING |
0x2ABC0066 (102) |
cmd_zs_buffer_backing |
After the full render completes and the on-demand Z/S buffer is no longer needed |
FREELIST_GROW |
0x2ABC0067 (103) |
cmd_free_list_gs |
During PM Out-of-Memory (EVENT_STATUS bit 7) to ask the host to allocate more pages to the freelist (see partial-render-spm.md) |
FREELISTS_RECONSTRUCTION |
0x2ABC0068 (104) |
cmd_freelists_reconstruction |
After an HWR reset when one or more freelists are left in an inconsistent state and must be reconstructed by the host (see hardware-recovery.md) |
CONTEXT_RESET_NOTIFICATION |
0x2ABC0069 (105) |
cmd_context_reset_notification |
Whenever a context is reset due to HWR, timeout, or unrecoverable fatal OOM error (GUILTY_LOCKUP, INNOCENT_LOCKUP, GUILTY_OVERRUNING, INNOCENT_OVERRUNING, HARD_CONTEXT_SWITCH, GPU_ECC_HWR) |
DEBUG_DUMP |
0x2ABC006A (106) |
— | Emitted upon detecting HWR respecting osinit.hwr_debug_dump_limit (or ROGUE_FWIF_HWR_DEBUG_DUMP_ALL = 99999 for unlimited), requesting the Linux driver to capture a state/register dump |
UPDATE_STATS |
0x2ABC006B (107) |
cmd_update_stats_data |
Asynchronous context statistics update (e.g., per-process CSW / OOM / reset counters) |
CORE_CLK_RATE_CHANGE |
0x2ABC006C (108) |
cmd_core_clk_rate_change |
Core clock rate change notification (when applicable to the PDVFS/DVFS flow) |
REQUEST_GPU_RESTART |
0x2ABC006D (109) |
— | Unrecoverable hardware error (e.g., persistent failure in HWR soft reset after exhausting retries or fatal poll): requests a full GPU hard reset from the host |
CONTEXT_FW_PF_NOTIFICATION |
0x2ABC0070 (112) |
cmd_fw_pagefault |
Page fault notification in the firmware memory context |
Note on APM (
POW_IDLE): In the mainline contract (pvr_power.c), idle notification for APM does not use a dedicated FWCCB command: the firmware updatessysdata.pow_state = ROGUE_FWIF_POW_IDLE, ensures memory visibility, and triggers the host interrupt (hwirq 75); the driver observespow_state == ROGUE_FWIF_POW_IDLEwith an idle KCCB and sendsKCCB_CMD_POW(ROGUE_FWIF_POW_OFF_REQ).
[D])HW1) (e.g., FREELIST_GROW, DEBUG_DUMP, FREELISTS_RECONSTRUCTION, REQUEST_GPU_RESTART, CONTEXT_RESET_NOTIFICATION, UPDATE_STATS) and BG context (HW0).HW1 can preempt HW0, any FWCCB slot acquisition executed in HW0 must occur with interrupts disabled (DI/EI) around the write_offset reservation critical section, preventing a race between BG and IRQ on the same ring index.