This document lists the exact layouts and compile-time verified offsets (pvr_rogue_fwif_check.h, pvr_rogue_fwif_shared_check.h, pvr_rogue_mips_check.h) of structures in shared memory between the mainline drivers/gpu/drm/imagination driver and the MIPS firmware on the SpacemiT K3 (36.56.104.183).
All offsets below are normative ([P]), little-endian, with natural 8-byte alignment on u64 pointers (__aligned(8)).
pvr_rogue_fwif_shared_check.h)struct rogue_fwif_dma_addr — 16 bytes| Offset | Type | Field | Description |
|—:|—|—|—|
| 0x00 | u64 | dev_addr | GPU virtual address (40 bits) |
| 0x08 | u32 | fw_addr | MIPS virtual address in FW Heap (32 bits) |
struct rogue_fwif_ufo — 8 bytes| Offset | Type | Field | Description |
|—:|—|—|—|
| 0x00 | u32 | addr | fw_addr of the 32-bit synchronization value |
| 0x04 | u32 | value | Expected value (check) or value to write (update) |
struct rogue_fwif_cleanup_ctl — 8 bytes| Offset | Type | Field | Description |
|—:|—|—|—|
| 0x00 | u32 | submitted_commands | Counter incremented by host when submitting work referencing the object |
| 0x04 | u32 | executed_commands | Counter incremented by firmware upon completing work; object can only be freed when executed == submitted |
struct rogue_fwif_cccb_ctl — 32 bytes| Offset | Type | Field | Description |
|—:|—|—|—|
| 0x00 | u32 | write_offset (Woff) | Written by host after packing commands into the cCCB |
| 0x04 | u32 | read_offset (Roff) | Written by firmware as commands are consumed/retired |
| 0x08 | u32 | dep_offset (Doff) | Written by firmware when advancing past dependency barriers |
| 0x0C | u32 | wrap_mask | cccb_size - 1 (power of 2 minus 1) |
| 0x10 | u32 | read_offset2 | Auxiliary read offset |
| 0x14 | u32 | read_offset3 | Auxiliary offset |
| 0x18 | u32 | read_offset4 | Auxiliary offset |
pvr_rogue_fwif_check.h)struct rogue_fwif_connection_ctl — 16 bytes| Offset | Type | Field | Description |
|—:|—|—|—|
| 0x00 | u32 | connection_fw_state | State confirmed by firmware |
| 0x04 | u32 | connection_os_state | OS state written by host |
| 0x08 | u32 | alive_fw_token | Liveness token updated by firmware |
| 0x0C | u32 | alive_os_token | Liveness token updated by host |
struct rogue_fwif_osinit — 104 bytes (0x68)| Offset | Type | Field | Description |
|—:|—|—|—|
| 0x00 | u32 | kernel_ccbctl_fw_addr | fw_addr of KCCB struct rogue_fwif_ccb_ctl |
| 0x04 | u32 | kernel_ccb_fw_addr | fw_addr of KCCB command buffer |
| 0x08 | u32 | kernel_ccb_rtn_slots_fw_addr | fw_addr of KCCB return slots array |
| 0x0C | u32 | firmware_ccbctl_fw_addr | fw_addr of FWCCB struct rogue_fwif_ccb_ctl |
| 0x10 | u32 | firmware_ccb_fw_addr | fw_addr of FWCCB command buffer |
| 0x14 | u32 | work_est_firmware_ccbctl_fw_addr | Optional (Work Estimation) |
| 0x18 | u32 | work_est_firmware_ccb_fw_addr | Optional |
| 0x1C | u32 | rogue_fwif_hwr_info_buf_ctl_fw_addr | fw_addr of struct rogue_fwif_hwrinfobuf |
| 0x20 | u32 | hwr_debug_dump_limit | HWR dump limit (ROGUE_FWIF_HWR_DEBUG_DUMP_ALL = 99999) |
| 0x24 | u32 | fw_os_data_fw_addr | fw_addr of struct rogue_fwif_osdata |
| 0x28 | struct | rogue_comp_checks | struct rogue_fwif_compchecks (mutual ABI/BVNC verification) |
struct rogue_fwif_sysinit — 544 bytes (0x220)Exact offsets verified in pvr_rogue_fwif_check.h:
| Offset | Type | Field | Role on K3 (36.56.104.183) |
|---|---|---|---|
0x000 |
u64 |
fault_phys_addr |
Physical address of the fault/dummy page |
0x008 |
u64 |
pds_exec_base |
PDS execution base → written to BCAST[0x0610/0x0614] |
0x010 |
u64 |
usc_exec_base |
USC execution base → written to BCAST[0x4008/0x4010/0x4028] |
0x018 |
u64 |
fbcdc_state_table_base |
FBCDC table (when applicable) |
0x020 |
u64 |
fbcdc_large_state_table_base |
FBCDC large table |
0x028 |
u64 |
texture_heap_base |
Texture heap base |
0x030 |
u64 |
hw_perf_filter |
Initial HWPerf filter mask (64 bits) |
0x038 |
u64 |
slc3_fence_dev_addr |
SLC3 fence address |
0x040 |
u64 |
tpu_trilinear_frac_mask |
TPU trilinear mask |
0x050 |
array | sigbuf_ctl |
Per-DM signature buffer control |
0x098 |
struct | pdvfs_opp_info |
OPP/PDVFS table information |
0x120 |
struct | coremem_data_store |
Coremem descriptor |
0x130 |
struct | counter_dump_ctl |
Counter dump control |
0x138 |
u32 |
filter_flags |
Filter flags |
0x13C |
u32 |
runtime_cfg_fw_addr |
fw_addr of struct rogue_fwif_runtime_cfg |
0x140 |
u32 |
trace_buf_ctl_fw_addr |
fw_addr of struct rogue_fwif_tracebuf |
0x144 |
u32 |
fw_sys_data_fw_addr |
fw_addr of struct rogue_fwif_sysdata |
0x148 |
u32 |
gpu_util_fw_cb_ctl_fw_addr |
fw_addr of struct rogue_fwif_gpu_util_fwcb |
0x14C |
u32 |
reg_cfg_fw_addr |
Optional list of register overrides applied at init |
0x150 |
u32 |
hwperf_ctl_fw_addr |
HWPerf control |
0x154 |
u32 |
align_checks |
Pointer to ABI alignment checks |
0x158 |
u32 |
initial_core_clock_speed |
Initial frequency in Hz (e.g., 409600000) |
0x15C |
u32 |
active_pm_latency_ms |
APM latency in ms (default 100) |
0x160 |
u32 |
firmware_started |
Boot handshake: firmware writes 1 with barrier after completing init |
0x164 |
u32 |
marker_val |
Diagnostic marker |
0x168 |
u64 |
firmware_started_timestamp |
ROGUE_CR_TIMER value captured at end of boot |
0x16C |
u32 |
jones_disable_mask |
Jones disable mask |
0x170 |
u32 |
firmware_perf |
Firmware performance configuration |
0x174 |
u32 |
core_clock_rate_fw_addr |
Pointer to clock rate |
0x178 |
u32 |
gpio_validation_mode |
GPIO validation mode |
0x17C |
struct | bvnc_km_feature_flags |
Kernel BVNC feature flags |
0x21C |
u32 |
tfbc_compression_control |
TFBC compression control |
Note for the clean team: Directly include the public layouts from
pvr_rogue_fwif.hand validate withOFFSET_CHECK/SIZE_CHECKfrompvr_rogue_fwif_check.hin the MIPS build to guarantee bit-exact binary compatibility.
sysdata, osdata, runtime_cfg) ([P])struct rogue_fwif_sysdata — 3624 bytes (0xE28)Maintained in real time by the firmware and read by the host for diagnostics, APM, and HWR:
config_flags (+0x00) and config_flags_ext (+0x04): operational flags (ROGUE_FWIF_INICFG_*: DISABLE_CLKGATING_EN, HWR_EN, CTXSWITCH_*, HWPERF_EN).pow_state (+0x08): current power state (ROGUE_FWIF_POW_OFF=0, POW_ON=1, POW_FORCED_IDLE=2, POW_IDLE=3).hw_perf_ridx (+0x0C), hw_perf_widx (+0x10), hw_perf_wrap_count (+0x14), hw_perf_size (+0x18), hw_perf_drop_count (+0x1C): HWPerf ring state.cr_poll_addr[MAX_THREAD_NUM] (+0xDD4 / 3540), cr_poll_mask (+0xDDC), cr_poll_count (+0xDE4): diagnostics of the last CR register in an extended poll wait.start_idle_time (+0xDF0): CR_TIMER timestamp of idle entry.hwr_state_flags (+0xDF8) and hwr_recovery_flags[PVR_FWIF_DM_MAX] (+0xDFC): global and per-DM HWR state.fw_sys_data_flags (+0xE20) and mc_config (+0xE24).struct rogue_fwif_osdata — 584 bytes (0x248)fw_os_config_flags (+0x00): per-OS configuration flags.interrupt_count (+0x230), kccb_cmds_executed (+0x238): progress counters.power_sync_fw_addr (+0x23C): shared power-off synchronization address.fw_os_data_flags (+0x240): OSID state flags.struct rogue_fwif_runtime_cfg — 72 bytes (0x48)Updated by the host (via KCCB_CMD_CORECLKSPEEDCHANGE or directly):
active_pm_latency_ms (+0x00): current APM latency in ms.runtime_cfg_flags (+0x04): runtime flags.active_pm_latency_persistant (+0x08): preserves APM latency across reboots when != 0.core_clock_speed (+0x0C): current GPU frequency in Hz (used to convert active_pm_latency_ms and HWR deadlines into CR_TIMER ticks).default_dusts_num_init (+0x10): number of clusters/dusts to power up (1 on K3 BXM-4-64).phr_mode (+0x14), hcs_deadline_ms (+0x18), wdg_period_us (+0x1C), osid_priority[8] (+0x20), hwperf_buf_fw_addr (+0x40).[P])struct rogue_fwif_fwmemcontext — 32 bytes (0x20)| Offset | Type | Field | Description |
|—:|—|—|—|
| 0x00 | u64 | pc_dev_paddr | Physical address (36 bits, 4 KiB-aligned) of the GPU MMU Page Catalogue (PC) |
| 0x08 | u32 | page_cat_base_reg_set | Assigned BIF bank index (0..6 corresponding to BIF_CAT_BASE1..7, or unassigned) |
| 0x0C | u32 | breakpoint_addr | Breakpoint address (optional) |
| 0x10 | u32 | bp_handler_addr | Breakpoint handler (optional) |
| 0x14 | u32 | breakpoint_ctl | Breakpoint control |
| 0x18 | u32 | fw_mem_ctx_flags | Memory context flags |
struct rogue_fwif_fwcommoncontext — 152 bytes (0x98)Represents a submission queue (a GEOM, FRAG, or CDM context):
ccbctl_fw_addr (+0x00): fw_addr of struct rogue_fwif_cccb_ctl (32 B).ccb_fw_addr (+0x04): fw_addr of the cCCB ring buffer.ccb_meta_dma_addr (+0x08): struct rogue_fwif_dma_addr (16 B).context_state_addr (+0x18): fw_addr of the CSW state structure (e.g., struct rogue_fwif_geom_registers_caswitch for TA, or compute state for CDM).fw_com_ctx_flags (+0x1C): common context flags.priority (+0x20), priority_seq_num (+0x24): scheduling priority.stats_num_stores (+0x30), stats_num_out_of_memory (+0x34), stats_num_partial_renders (+0x38): statistics.dm (+0x3C): Data Master of the context (PVR_FWIF_DM_GEOM=2, FRAG=3, CDM=4).max_deadline_ms (+0x68), read_offset_needs_reset (+0x6C), last_failed_ufo (+0x80).fw_mem_context_fw_addr (+0x88): fw_addr of struct rogue_fwif_fwmemcontext.server_common_context_id (+0x8C), pid (+0x90), geom_oom_disabled (+0x94).[P])struct rogue_fwif_hwrtdata — 384 bytes (0x180)Represents an in-flight render target instance (TA + 3D):
pm_mlist_dev_addr (+0x00), vce_cat_base (+0x08), te_cat_base (+0x48), alist_cat_base (+0x88), pm_alist_stack_pointer (+0x98), pm_mlist_stack_pointer (+0xA0): Parameter Manager catalogue bases and stack pointers.hwrt_data_common_fw_addr (+0xA4): pointer to struct rogue_fwif_hwrtdata_common (dimensions, mtile_stride, te_screen, screen_pixel_max, multi_sample_ctl, etc.).hwrt_data_flags (+0xA8): public flags defined in pvr_rogue_fwif.h:
HWRTDATA_HAS_LAST_GEOM (BIT(2)): last geometry kick has already been submitted/completed.HWRTDATA_PARTIAL_RENDERED (BIT(3)): at least one Partial Render was executed on this HWRTData.HWRTDATA_DISABLE_TILE_REORDERING (BIT(4)).state (+0xAC): enum rogue_fwif_rtdata_state (NONE=0, KICK_GEOM=1, KICK_GEOM_FIRST=2, GEOM_FINISHED=3, KICK_FRAG=4, FRAG_FINISHED=5, FRAG_CONTEXT_STORED=6, GEOM_OUTOFMEM=7, PARTIALRENDERFINISHED=8, HWR=9).freelists_fw_addr (+0xB0): fw_addr pointers to the freelists (local and global).vheap_table_dev_addr (+0xC8): GPU virtual address of the PM VHeap table.rta_ctl (+0xD0): Render Target Array control (current_rt, active_render_targets, valid_render_targets).tail_ptrs_dev_addr (+0xF0), macrotile_array_dev_addr (+0xF8), rgn_header_dev_addr (+0x100), rtc_dev_addr (+0x108).geom_caches_need_zeroing (+0x114), cleanup_state (+0x140, struct rogue_fwif_cleanup_ctl).struct rogue_fwif_freelist — 64 bytes (0x40)| Offset | Type | Field | Description |
|—:|—|—|—|
| 0x00 | u64 | freelist_dev_addr | GPU virtual base of the freelist page buffer |
| 0x08 | u64 | current_dev_addr | Current virtual address of the freelist stack |
| 0x10 | u32 | current_stack_top | Current stack top in PM (CR 0x0224 in context 0/2; CR[0x0230] = top << 22 in context 1) |
| 0x14 | u32 | max_pages | Maximum page capacity |
| 0x18 | u32 | grow_pages | Growth increment in case of OOM |
| 0x1C | u32 | current_pages | Pages currently available to PM |
| 0x20 | u32 | allocated_page_count | Count of allocated pages |
| 0x24 | u32 | allocated_mmu_page_count | Count of PM MMU table pages |
| 0x28 | u32 | freelist_id | Unique identifier used in FWCCB FREELIST_GROW / FREELISTS_RECONSTRUCTION requests |
| 0x2C | u32 | grow_pending | Indicates whether a grow operation is in progress |
| 0x30 | u32 | ready_pages | Reserve pages ready for immediate use on OOM (before triggering PR) |
| 0x34 | u32 | freelist_flags | Freelist state flags |
| 0x38 | u32 | pm_global_pb | Global parameter buffer indicator |
[P])| Structure | Size | Purpose |
|---|---|---|
struct rogue_fwif_hwrinfobuf |
2336 bytes | Ring of HWR fault records per DM (hwr_counter at +2176, write_index at +2180, dd_req_count at +2184, per-DM counters at +2192..2300) |
struct rogue_fwif_tracebuf |
864 bytes | Control structure (log_type at +0, per-thread tracebuf at +8, tracebuf_size_in_dwords at +856, tracebuf_flags at +860), pointing to the 12000-dword circular buffer |
struct rogue_fwif_gpu_util_fwcb |
10280 bytes | time_corr ring (+0) + time_corr_seq_count (+10240) + gpu_util_flags (+10244) + last_word (+10248) + stats_counters (+10256) for utilization calculation and DVFS |
struct rogue_mips_state |
684 bytes | Exception/NMI dump: 11 CP0 regs (0x00..0x28), tlb[16] (0x2C, 256 B), remap[32] (0x12C, 384 B) |