Imagination_BXE-2-32

Compute (CDM), fragment (3D) and transfer (TQ) kicks — registers and ordering

Details the compute, fragment and transfer kicks in the same format as the geometry (TA) kick: registers to program, data sources and mandatory ordering dependencies. The code organisation is free.

Notation: CR[off] = primary-core register; BCAST[off] = broadcast write (all cores, bank 0xCFA00000); ROGUE_CR_* names from pvr_rogue_cr_defs.h where public (the header names only a subset; the rest are given by offset). cmd+0xNN = offset from the start of the command header (payload offset = 0xNN − 0x28, see command-structs).

Provenance. D (firmware analysis) confirmed by O (trace milestones: Activate MemCtx, Kick Compute, Kick 3D, Kick 3D TQ). Field names given below come from the public check headers (P).

Compute and 3D program almost everything through broadcast, with data from the command (rogue_fwif_cmd_compute, rogue_fwif_cmd_frag, rogue_fwif_cmd_transfer, whose regs blocks are prepared by the host) and from the context.


Compute kick (CDM / DM 4)

A. Preconditions

B. Command parameters (broadcast)

Register Data
BCAST[0x0480], BCAST[0x0484] cmd+0x50/0x54 = regs.cdm_ctrl_stream_base (64-bit)
BCAST[0x17A8], BCAST[0x17AC] cmd+0x30/0x34 = regs.tpu_border_colour_table (64-bit)
BCAST[0x0498], BCAST[0x049C] cmd+0x58/0x5C = regs.cdm_context_state_base_addr (64-bit)

C. Context-switch resume (only after preemption)

Reloads the saved state from the snapshot buffer: address and size go to the context’s register set, core by core. Trace: CSW id 48 Multicore context resume on DM…, CSW id 3 CDM FWCtx shared alloc size load …, CSW id 29 *** CDM FWCtx … resume from snapshot buffer …, shader state ….

D. Trace and watchdog

E. CDM PDS programs

The values come from the compute context’s context-switch register block (rogue_fwif_cdm_registers_cswitch, which follows the 0x98-byte common context; host prepared):

Register Data
BCAST[ROGUE_CR_CDM_CONTEXT_PDS0] (0x04A8), +4 cdmreg_cdm_context_pds0 (64-bit)
BCAST[ROGUE_CR_CDM_CONTEXT_PDS1] (0x04B0) cdmreg_cdm_context_pds1
BCAST[ROGUE_CR_CDM_TERMINATE_PDS] (0x04B8), +4 cdmreg_cdm_terminate_pds
BCAST[ROGUE_CR_CDM_TERMINATE_PDS1] (0x04C0) cdmreg_cdm_terminate_pds1

F. Trigger

Which rogue_fwif_compute_regs fields are used (answers Q7)

On this GPU (features/BRNs from the device-info block), only the always-present fields are programmed:

Prerequisite: the PDS/USC execution bases must have been programmed at boot, or the CDM faults on its first PDS/USC fetch. See boot-gpu-init.


Fragment kick (3D / DM 3)

The kick with the most registers (ISP, ZS and output configuration).

A. Preconditions

B. ISP configuration (broadcast)

Register Data
BCAST[0x4070] usc_pixel_output_ctrl (O: observed equal)
BCAST[0x4078/0x4080/0x4088/0x4090] usc_clear_register[0..3]
BCAST[0x40A0] (byte) view_idx (cmd+0x7C = regs+68, public offset)
BCAST[0x0F20/0x0F24] rogue_fwif_hwrtdata.rgn_header_dev_addr (O: observed equal to the trace “TE Region headers base”)
BCAST[0x3E40], BCAST[0x0F18] hwrtdata_common.screen_pixel_max (+0x04) and hwrtdata_common.isp_mtile_size (+0x50) (D/O: observed 0x3E40 = 0x00FF_00FF and 0x0F18 = 0x0010_0010 for 256×256)

C. ZS load/store

A partial render has no ZS load/store.

Source of the field names: their offsets in the public rogue_fwif_frag_regs (check header), confirmed against the decompiled 3D kick and black-box observations (open firmware v1.1 and v1.0). Unused rogue_fwif_frag_regs fields on BXE-2-32 are listed under “Occlusion queries and remaining rogue_fwif_frag_regs” below.

Observed during the render (answers Q16l, O)

Black-box runs of the open v1.1 image. The workloads were:

All passed, and there was no recovery. Registers were read from the host, with no writes:

Command fields are at their public rogue_fwif_frag_regs offsets. The client CCB command header in front of the command is 40 bytes on this ABI.

Several ISP registers are only valid while the render runs. The firmware, or the hardware, puts them back when the job ends:

Register During the render After the render
ROGUE_CR_ISP_RENDER (0x0F08) 0 3
0x0F38 isp_ctl 0x21000
0x0F48 isp_zlsctl 0
0x0F88 isp_bgobjvals 0x200

A snapshot taken after a short render misses them; this is why earlier answers listed the ZLS fields as not found.

ZS load/store (item 3)

Command field Register Evidence
isp_zlsctl (64-bit) 0x0F48/0x0F4C equal to the field during the render in every depth test: 0x180AA01E (d32 load), 0x180A201C (d32 clear), 0x1A8EE01E (d24s8 load). It reads 0 after the job, and in a colour-only render it stays 0. The field layout is Mesa’s public ISP_ZLSCTL
isp_zload_store_base 0x0F50/0x0F54 and 0x0F58/0x0F5C (the same address in both pairs) equal in every depth test; written with 0 in a colour-only render. Mesa’s public names point to a load base and a store base
isp_stencil_load_store_base 0x0F60/0x0F64 and 0x0F68/0x0F6C equal in the d24s8 tests. A d32 (no stencil) render writes 0 there. With packed d24s8, depth and stencil have the same address
zls_stride (cmd+468) software per-layer offset added to 0x0F50..0x0F5C (layer * zls_stride) used on RTA renders when layer != 0 (see “Render-target arrays” below); not written directly to a hardware register
fb_cdc_zls not used this core does not have the public REQUIRES_FB_CDC_ZLS_SETUP feature (Mesa device info for 36.29.52.182), and the field was 0 in every command
isp_ctl 0x0F38 0x80031000 / 0x80131000 during the render (the command values), 0x21000 after
isp_bgobjvals 0x0F88 0x1FF / 0x3FF during the render (the command values)

The flags bits. The commands carried:

In every case the ZLS registers (0x0F48..0x0F6C) are written unconditionally from the command fields (plus per-layer zls_stride/sls_stride offsets on RTA and partial-render Z/S store/load bits on FRAG_PR).

0x0F28 (item 4)

Render 0x0F18 (isp_mtile_size) 0x0C20 (geometry, mtile_stride) 0x0F28 (rgn_header_size)
64×64 (depth tests) 0x0004_0004 4 0x10
256×256 (simple_draw, basic_draw) 0x0010_0010 0x10 0x40

PM_3D_MEM_FREE (item 1)

So an implementation that sees the pages return but never sees bit 8 should check that 0x0388 is 1 while the render runs. The spec’s transfer table sets it to 0, and the fragment kick must set it back to 1 (see kick-geometry-ta, Q16k experiment D).

Failing image comparisons (item 5)

dEQP-VK.draw.renderpass.basic_draw.draw.point_list.45 and dEQP-VK.draw.renderpass.basic_draw.misc.flat_b_sat_error pass with the original firmware on this stack.

Registers during the point_list.45 render:

For flat_b_sat_error the capture caught only its read-back transfer; the render uses the same register mapping as above.

The command fields of these renders map as in the tables above and in phase B.

Input-attachment renders (answers Q16m item 1, O, P)

dEQP-VK.renderpasses.renderpass1.suballocation.formats.d32_sfloat.input.clear.dont_care.draw passes on the open v1.1 image. From the trace and register sampling:

D. ISP pipe and output

E. Trace and watchdog

Trace MAIN id 120: Kick 3D: FWCtx … @ …, RTD …, Partial render:…, CSW resume:…. (PID:…, …). Read ROGUE_CR_TIMER, arm the watchdog and record the execution state of DM 3. PM 3D timeouts are in observed-sequences.

F. Trigger

Correction (Q14). Earlier versions of this phase described the trigger as “ISP_RENDER |= 0x10, then 0x0F00 = 1”, with an (ISP_RENDER & 3) == 3 readiness check and, on multicore, a condition on the launch. Re-checked against the open variant: the launch is 0x0F00 = 1 alone, | 0x10 belongs to the resume path, and the & 3 test belongs to the context-store request. The point of the Q8 answer still holds: without 0x0F00 = 1 the pipe never starts.


Transfer kick (TQ_3D / DM 3)

Transfer through the 3D pipeline (blit/resolve) uses the fragment pipe. It is a sub-case of the 3D kick, with its own configuration.

A. Preconditions

Power domain on; BCAST[ROGUE_CR_MULTICORE_FRAGMENT_CTRL_COMMON] = control value (also used for the ISP configuration below); memory context bound to a BIF slot (DM 3, according to a flag at cmd+0xE0 bit 0).

Mandatory gate (Q8). Binding the memory context to the BIF slot (DM 3) must succeed before any ISP/PBE register is written: the whole register-programming block and the trigger are conditional on it (if the BIF activation returns “not done”, the firmware skips the kick entirely and the pipe never starts). This is the same ROGUE_CR_BIF_CAT_BASE_INDEX (PIXEL field) activation as for a 3D kick — a transfer is a sub-case of 3D and needs it too.

B–D. Registers written by the transfer kick

All writes go through the broadcast bank. Unless stated, a value is the host’s rogue_fwif_transfer_regs field, written unchanged.

Provenance. Registers, values and conditions: D. Field roles: P (public header, and public Mesa: csbgen/rogue/cr.xml, include/hwdef/rogue_hw_defs.h, vulkan/pvr_arch_job_transfer.c). Field names are matched by their offsets in the public rogue_fwif_transfer_regs layout.

Register Value Written when
ROGUE_CR_MULTICORE_FRAGMENT_CTRL_COMMON 1 on a single-core GPU (this SoC), or when flags has ROGUE_TRANSFER_FLAGS_SINGLE_CORE; otherwise ((1 << cores) − 1) \| 0x100 always
0x0F88 isp_bgobjvals always
0x06A0/0x06A4 pds_bgnd0_base (64-bit) always
0x06A8/0x06AC pds_bgnd1_base (64-bit) always
0x06B8/0x06BC pds_bgnd3_sizeinfo (64-bit) always
0x0F20/0x0F24 isp_mtile_base (64-bit) only if (isp_render & 3) == 2
0x0F28 isp_rgn only if (isp_render & 3) == 2
0x0FC8 / 0x0FCC 0 / 0xE4 only if (isp_render & 3) == 2
0x4070 usc_pixel_output_ctrl always
0x4078, 0x4080, 0x4088, 0x4090 usc_clear_register0..3 always
0x3E40 frag_screen always
0x0F18 isp_mtile_size always
0x0F10 isp_render_origin always
0x0FD8 tiles in flight = min(((isp_ctl >> 12) & 0xF) + 1, 2) always
ROGUE_CR_ISP_CTL isp_ctl always
0x0F30 isp_aa always
0x0FA8 / 0x0FAC 0x88888888 / 0x88888888 only if (value written to 0x0F30) & 3 != 0
0x0F48 / 0x0F4C 0 / 0 always
0x0628 event_pixel_pds_info always
0x0618 event_pixel_pds_code always
0x0620 event_pixel_pds_data always
0x1510 + 8·n / 0x1550 + 8·n pbe_wordx_mrty[2n] / pbe_wordx_mrty[2n+1] per render target n
0x0388 0 (no public name; PM_3D_MEM_FREE was only seen after renders with 0x0388 = 1, see Q16l) always
CR[0x1020] of each core, then ROGUE_CR_ISP_RENDER \|= 0x10 per-core state saved by the context store, from context_state_addr only when resuming (fw_com_ctx_flags has ROGUE_FWIF_CONTEXT_FLAGS_NEED_RESUME)
ROGUE_CR_ISP_RENDER isp_render always, immediately before the launch
0x0F00 1 (pixel-pipe launch) always, last write

A register listed with a condition is not written when the condition is false. This analysis does not establish what happens if such a register is written anyway.

Ordering. Only these constraints are required:

Everything else in the table may be written in any order. After the launch, the firmware records the kick time and requests a BG pass (ROGUE_CR_MTS_SCHEDULE = 0).

Correction (Q14). Earlier versions of this section placed the isp_render write before the configuration registers and launched with ISP_RENDER |= 0x10. Re-checked against the open variant (the target): ISP_RENDER = isp_render is written just before 0x0F00 = 1, and | 0x10 is done only when resuming, as in the 3D kick (phase F).

Pre-kick firmware job. After every GPU-units initialisation (cold boot, warm boot, HWR re-init), the first kick on any DM (geometry, fragment, transfer or compute) checks the context’s rf_cmd_addr. If it is non-zero, the firmware first runs a compute job from that address on DM 4, waits for COMPUTE_FINISHED and flushes the compute caches. If that job fails, the kick is skipped. The mainline host never sets rf_cmd_addr, so on mainline nothing runs and the kick proceeds.

Output / PBE state

Register Value Content
0x1510 + 8·n (+0/+4) pbe_wordx_mrty[2n] PBE register word 0 of render target n
0x1550 + 8·n (+0/+4) pbe_wordx_mrty[2n+1] PBE register word 1 of render target n

A transfer uses 2 PBE register words per render target, stored as consecutive pairs (public Mesa ROGUE_NUM_PBESTATE_REG_WORDS_FOR_TRANSFER = 2). The remaining entries of the 9-entry pbe_wordx_mrty array are not written. These register words hold format, stride, swizzle and clip. They do not hold the destination address (see below).

Pixel-event program and destination address (answers Q13)

  1. Where the destination address is. It is not in pbe_wordx_mrty. The PBE has two kinds of words. The register words above carry format, stride, swizzle and clip. The state words carry the surface address (address_low/address_high). The host places the state words in the data segment of the end-of-tile pixel-event program it builds for the transfer, and points event_pixel_pds_code/event_pixel_pds_data at that program (P, public Mesa). So the host does leave the address to the end-of-tile emit. The firmware never sees the address and programs no destination register. This corrects the Q12 answer, which said the address was in the PBE register words.
  2. 0x0618/0x0620/0x0628. The transfer kick writes all three, each with the host’s 32-bit value unchanged: 0x0628 ← event_pixel_pds_info, 0x0618 ← event_pixel_pds_code, 0x0620 ← event_pixel_pds_data. Their roles, from the public Mesa field layouts:

    Register Role Fields
    0x0618 pixel-event PDS code address addr bits 31:4, 128-bit granular
    0x0620 pixel-event PDS data address addr bits 31:4, 128-bit granular
    0x0628 pixel-event info const_size 4:0, temp_stride 8:5, usc_sr_size 14:9

    The pixel-event task is skipped when const_size or usc_sr_size is 0. That explains why no PIXELBE_END_RENDER arrives when these registers are left unprogrammed.

    0x0618 is the code address, not a control register, and the code address is not derived from data + size. The 3D kick writes a fixed 0x80 there because rogue_fwif_frag_regs has no event_pixel_pds_code field. It does have event_pixel_pds_info and event_pixel_pds_data (public offsets 60 and 72), and the 3D kick writes them to 0x0628 and 0x0620, which is consistent with the roles above.

    The code and data values are offsets into the PDS heap: they resolve against the PDS execution base (0x0610/0x0614, see boot-gpu-init). The USC end-of-tile program that the PDS program starts lives in the USC heap and resolves against the USC execution base (P, public Mesa).

    The reported host values decode as follows: info = 0x202 gives const_size = 2, temp_stride = 0 and usc_sr_size = 1, so the task runs.

  3. Anything else the pixel-event task needs. The table above is the complete set of registers the transfer kick writes:
    • There is no per-kick shared-register allocation register. The pixel-event task’s shared-register size comes from usc_sr_size in event_pixel_pds_info, and the unit-level shared/temp register setup is done once at boot (0x06D8, 0x4050 in boot-gpu-init).
    • 0x4070 is the USC pixel-output control, loaded from usc_pixel_output_ctrl. It is the same register the 3D kick loads from rogue_fwif_frag_regs.usc_pixel_output_ctrl.
    • 0x0F10 is the render origin. The transfer kick writes the host’s isp_render_origin; the 3D kick writes 0 because rogue_fwif_frag_regs has no such field. Both are correct.

Open point. The analysis does not show which value makes the end-of-tile write land on address 0. The emit takes the address from the pixel-event program’s data at run time, so a write to 0 means the PBE state words, as the GPU reads them, are zero. Hypotheses, consistent with the observations but unverified:

Fields the transfer kick reads (answers Q25). The table above is the whole kick. In particular the firmware does not read isp_xtp_pipe_enable (feature S7_TOP_INFRASTRUCTURE is absent), reads no flags bit except bit 1 (ROGUE_TRANSFER_FLAGS_SINGLE_CORE) and bit 0 (no public name; passed as the secure-context flag when binding the DM 3 memory context), and always writes the PBE words of render targets 0–2 (six of the nine pbe_wordx_mrty entries), whatever the number of targets in use.

On this board (mainline powervr + Mesa), dEQP-VK.api.copy_and_blit.core.image_to_image.simple_tests.* passes 23/23 (0 failures) on the reference firmware (O), so NPOT / offset / mirror copy mismatches are not host/Mesa bugs. While no per-kick transfer field is missing from the table above, texture coordinate rounding and pixel-output behaviour depend on the TPU/PBE/ISP unit defaults programmed at GPU init — specifically BCAST[0x17B8] (TPU filter/truncation mode from sysinit.filter_flags, with bit 1 forced set to yield 0xA or 0x6), BCAST[0x1780] = 0x21, BCAST[0x1788] = 0x20, BCAST[0x178C] = 0x20, BCAST[0x1710/0x1714], BCAST[0x1500] = 0x80, BCAST[0x15A0..0x15DC] = 0, and BCAST[0x0FA0] = 0x88 (all now listed in boot-gpu-init step 9).

Completion: a TQ_3D ends on PIXELBE_END_RENDER (ROGUE_CR_EVENT_STATUS bit 3), the same event as a normal 3D render. 0x06B0 is not written by the transfer kick.


Completion: per-job cache flush (answers Q14)

When a fragment, transfer or compute job finishes, the firmware flushes the caches of that DM’s pipeline before it retires the command. Retiring is the step that applies the fence updates the host waits on. So the host never sees a job as finished before its output has been written back (D).

The order on completion is:

  1. clear the completion event in ROGUE_CR_EVENT_CLEAR (PIXELBE_END_RENDER for 3D and TQ, COMPUTE_FINISHED for compute);
  2. run the flush sequence below;
  3. retire the command (fence updates, then the IRQ to the host).

The flush depends on the context’s DM (rogue_fwif_fwcommoncontext.dm). Transfer contexts use PVR_FWIF_DM_FRAG, so a TQ_3D gets the fragment variant. All writes are broadcast. “Poll” means: wait on every enabled core until the written bit clears.

Step Fragment / transfer (dm = FRAG) Compute (dm = CDM) Geometry (dm = GEOM, answers Q19b)
1 0x4000 = 1 0x4000 = 1 0x4000 = 1
2 0x0688 = 2, poll bit 1 0x0688 = 4, poll bit 2 0x0688 = 1, poll bit 0
3 0x0668 = 3, poll bit 0 0x0668 = 9, poll bit 0 0x0668 = 5, poll bit 0
4 0x1608 = 0x38001, poll bit 0 0x1608 = 0x10001, poll bit 0 0x1608 = 0x10001, poll bit 0
5 0x1480 = 1, 0x1488 = 1 0x1488 = 1 0x1488 = 1
6 ROGUE_CR_MCU_FENCE = 0x00000180_00000000 (DM_PIXEL) ROGUE_CR_MCU_FENCE = 0x00000280_00000000 (DM_COMPUTE) ROGUE_CR_MCU_FENCE = 0x00000080_00000000 (DM_TA)
7 0x1720 = 0x2B, poll 0x1728 bit 0 0x1720 = 0x33, poll 0x1728 bit 0 0x1720 = 0x27, poll 0x1728 bit 0
8 write barrier (execution-environment) — write barrier
9 ROGUE_CR_SLC_CTRL_FLUSH_INVAL = 6 (DM_TA \| DM_PIXEL), poll ROGUE_CR_SLC_STATUS0 bit 2 ROGUE_CR_SLC_CTRL_FLUSH_INVAL = 8 (DM_COMPUTE), poll ROGUE_CR_SLC_STATUS0 bit 2 ROGUE_CR_SLC_CTRL_FLUSH_INVAL = 2 (DM_TA), poll ROGUE_CR_SLC_STATUS0 bit 2

None of 0x4000, 0x0688, 0x0668, 0x1608, 0x1480, 0x1488, 0x1720, 0x1728 has a public name. They are steps of the front-end, USC/PDS, TPU and MCU cache flush that precedes the SLC flush. Their individual roles are inferred, not established.

Render-target arrays (gs_rta_support, firmware v1.1 — answers Q27, Q31, Q33, P/D)

When hwrtdata.rta_ctl.active_render_targets (hwrtdata+0xD8) is non-zero, a single fragment command renders one or more array layers in sequence using rta_ctl (render_target_index at +0xD0, current_render_target at +0xD4, active_render_targets at +0xD8, cumul_active_render_targets at +0xDC [unused], valid_render_targets_fw_addr at +0xE0, rta_num_partial_renders_fw_addr at +0xE4, max_rts at +0xE8):

1. How active_render_targets and valid_render_targets[] are populated (answers Q31)

2. Per-layer 3D kick programming and RENDER_TGT_ID (answers Q27, Q33)

  1. Per-layer region headers (BCAST[0x0F20/0x0F24]):
    layer      = hwrtdata.rta_ctl.current_render_target
    rgn_stride = align_up(hwrtdata_common.rgn_header_size * 6, 4096)
    BCAST[0x0F20/0x0F24] = hwrtdata.rgn_header_dev_addr + rgn_stride * layer
    
  2. Per-layer RENDER_TGT_ID (BCAST[0x03D8], answers Q33): write BCAST[0x03D8] = hwrtdata.rta_ctl.current_render_target (valid_render_targets[render_target_index]) on every 3D kick (once per layer). This is the hardware register that supplies RENDER_TGT_ID (PCO_SR_RENDER_TGT_ID) to the end-of-tile USC program for both 2D array images and 3D (TWIDDLE_3D) images. Omitting BCAST[0x03D8] causes every layer of a 2D array image to write into layer 0.
  3. Per-layer PBE 3D-slice offset (BCAST[0x1550 + 8*n]): when hwrtdata.rta_ctl.max_rts >= 2, for each MRT n (0..7) whose PBE word 0 high half has (word0_hi & 3) == 2 (TWIDDLE_3D), add layer to bits 27:14 of PBE word 1 (BCAST[0x1550 + 8*n] = (val & 0xF0003FFF) | (((word1_lo >> 14) & 0x3FFF) + layer) << 14) as an extra on top of BCAST[0x03D8].
  4. Per-layer ZLS / SLS bases: when layer != 0, add layer * cmd_frag.zls_stride (64-bit) to isp_zload_store_base and layer * cmd_frag.sls_stride (64-bit) to isp_stencil_load_store_base.
  5. Defer PM memory free until the last layer (CR[0x03E0]): on the primary core bank, write CR[0x03E0] = 0 for non-last layers (active_render_targets >= 2 and render_target_index != active_render_targets - 1), and CR[0x03E0] = 1 on the last layer (or when active_render_targets == 0). Also skip PM-MMU invalidation on non-last layers (hwrtdata 3D-done runs it only when active_render_targets < 2 or CR[0x03E0] & 1 != 0).
  6. Layer loop at PIXELBE_END_RENDER (applies to both normal 3D and FRAG_PR):
    • If active_render_targets != 0 and render_target_index < active_render_targets - 1, increment render_target_index, load current_render_target = valid_render_targets[render_target_index], log MAIN id 40 (Kick RTA render %u of %u), and re-kick DM 3 (preserving the partial-render mode for FRAG_PR) before retiring the command or signalling PR executed.
    • On FRAG_PR, if rta_num_partial_renders_fw_addr != 0, increment rta_num_partial_renders[current_render_target]++ at kick time; for subsequent PRs and the final 3D render, the per-layer has_pr flag (controlling forced Z/S load and pds_pr_bgnd) is (hwrtdata.flags & 8) && (rta_num_partial_renders[current_render_target] > 0).
  7. Layered LOAD + vkCmdClearAttachments subset layers (answers Q36, O/D):
    • Observed (O): with the manufacturer open firmware v1.1 (build 6976702 OS) and the same RTA-enabled Mesa build, vkfwtest rta step 3 (subset layer 1 / subset layer 5) fails identically (layers 1 and 5 retain their previous contents, zero faults). The missing clears are on the Mesa pvr side, not in the firmware.
    • Background object registers (D): the fragment kick does nothing per layer to pds_bgnd0..3 (0x06A0..0x06BC), isp_bgobjvals (0x0F88), or 0x0F10 (always 0) for a LOAD render; they are written verbatim from the command on every layer.
    • Layer 0 in the RTC bitmap (D): the firmware never writes to the RTC bitmap (rtc_dev_addr + 0x200) during geometry; bit 0 being set alongside bits 1 and 5 comes from the hardware / host VDM stream (default initial RT 0).
  8. Background-object RENDER_TGT_ID and layered partial renders (answers Q39, D/O):
    • No separate background-task layer register (D): BCAST[0x03D8] is the only hardware register that receives current_render_target before BCAST[0x0F00] = 1. There is no other register or bitfield programmed per layer to pass RENDER_TGT_ID to the PDS/USC background task (normal or partial-render background). All other per-layer adjustments are firmware-computed address/slice offsets (BCAST[0x0F20/0x0F24] region headers, BCAST[0x1550 + 8*n] TWIDDLE_3D zslice, and ZLS/SLS bases).
    • Layered FRAG_PR handling (D): the firmware does not restrict FRAG_PR to layer 0 and does not refuse layered partial renders. At PIXELBE_END_RENDER, FRAG_PR executes the exact same RTA layer loop as a normal 3D render: while render_target_index < active_render_targets - 1, it advances render_target_index and current_render_target = valid_render_targets[render_target_index] and re-kicks DM 3 in PR mode; only after the last layer finishes does it reset render_target_index = 0, flush DM 3, signal PR executed, and set hwrtdata.flags |= 8. Each FRAG_PR kick increments rta_num_partial_renders[current_render_target]++ (when rta_num_partial_renders_fw_addr != 0), and subsequent PR/final kicks evaluate has_pr per layer ((hwrtdata.flags & 8) && (rta_num_partial_renders[layer] > 0)) to choose between pds_pr_bgnd + forced Z/S load and normal pds_bgnd.
    • Observed (O): with the updated Mesa (pvr-bxe-2-32, with VK_SUBPASS_EXTERNAL barriers and the layered-LOAD clear fix) + kernel powervr 1.1.0 (DRM_PVR_DEV_QUERY_FW_INFO_GET) + manufacturer open firmware v1.1 (build 6976702 OS), vkfwtest bigpb-layers passes 4/4 (7525–7544 ms, zero dmesg faults).

Occlusion queries and remaining rogue_fwif_frag_regs (answers Q32, P/D)

  1. isp_oclqry_base (frag_regs + 112, cmd_3d + 0xA8, 64-bit) and isp_oclqry_stride (frag_regs + 80, cmd_3d + 0x88):
    • Condition: (cmd_3d.flags & 0x20) != 0 (bit 5, occlusion query enabled).
    • Register: CR[0x0FC0/0x0FC4] (64-bit, per-core bank). On this single-core GPU, write isp_oclqry_base directly to primary core CR[0x0FC0] (low) and CR[0x0FC4] (high). On multicore, core c receives isp_oclqry_base + c * isp_oclqry_stride.
    • End of render: no extra query-specific flush or write-back register is needed at 3D finished; the standard DM 3 completion cache flush (steps 1–9 above) makes the occlusion counts visible to the host and subsequent GPU commands.
  2. Fields not read by the 3D kick on BXE-2-32: isp_zls_pixels (+84), isp_xtp_pipe_enable (+48), tpu (+56), pixel_phantom (+64), fb_cdc_zls (+144), isp_dummy_stencil_store_base (+424), and isp_dummy_depth_store_base (+432) are not read by the firmware on this GPU.
  3. PBE MSAA resolve (downscale, bit 56 — answers Q34, D/O): the firmware passes all 8 MRT PBE words (0x1510..0x158C) through unchanged (except the TWIDDLE_3D zslice add above). It does not inspect REG_WORD0.downscale (bit 56), does not modify 0x0F30 (ISP_AA) or 0x0FA0, and performs no extra step at PIXELBE_END_RENDER. Observed (O): with the RTA-enabled Mesa build (gs_rta_support on) and the manufacturer open firmware v1.1 (build 6976702 OS), vkfwtest msaa fails identically (4096 of 4096 resolved pixels = 00000000). The failure is on the Mesa pvr side, not in the firmware.

Answers to the three Q14 questions:

  1. Nothing per kick is needed before the first tile can emit. The transfer kick does not do the 3D phase D pipe-reset writes (ISP_RENDER = 0, 0x0618 = 0x80, 0x0F10 = 0); those belong to the 3D kick only. No USC/PDS flush happens at kick time. The only firmware action before a kick is the rf_cmd_addr job after a units initialisation, which does nothing on mainline.
  2. DM 3 state between jobs. The firmware carries no pixel-pipeline state from one job to the next, except the context-switch state of a context being resumed. It relies on every job flushing its DM’s caches at completion, as above. A compute job that ran just before is flushed by the compute variant when it completes, before it is retired.
  3. Yes, there is a firmware action at the end of a TQ that comes before the SLC flush. It is steps 1–8 of the fragment variant above, which run before step 9 (the SLC flush) and before the command is retired. An SLC flush alone (step 9) is not the whole sequence.

Status. That this flush is what the first tile of a multi-tile transfer is missing is consistent with the observations but not proven. The symptoms that fit are a lost output that varies from run to run, with neither an SLC flush nor a delay after PIXELBE_END_RENDER fixing it. The analysis shows that the firmware always runs this sequence before retiring a fragment or transfer job. It does not show which step a missing first tile depends on.


Common skeleton (TA, 3D, TQ, CDM)

make sure the power domain is on
[first kick after a units init] run the rf_cmd_addr job if non-zero (no-op on mainline)
multicore control (BCAST …_CTRL_COMMON)
bind the memory context to a BIF slot               ── before any register-set write
[TA/3D] load the HWRTData into the PM (+ poll handshakes)
program the register set / BCAST with the command fields
[preemption] resume from the snapshot buffer
trace entry (Kick …) + deadline watchdog
record the DM's execution state
TRIGGER (last write):
  - TA:     CR[set+0x400] = 1
  - CDM:    BCAST[0x0478] = 1
  - 3D:     BCAST[0x0F00] = 1                       (ISP_RENDER left at 0 from phase D)
  - TQ:     BCAST[ROGUE_CR_ISP_RENDER] = isp_render ; then BCAST[0x0F00] = 1
  - [resume only, 3D/TQ] ISP_RENDER |= 0x10 after reloading the saved per-core state
ON COMPLETION:
  clear the completion event → per-DM cache flush (see "Completion") → retire the command

Compute: one kick per command, zero workgroups (answers Q10)

The compute kick points the CDM at the host-built control stream (cmd_ctrl_stream_base → BCAST[0x0480/0x0484]) and issues exactly one kick (BCAST[0x0478] = 1) per rogue_fwif_cmd_compute. The firmware does not inspect the work-group dimensions and does not special-case a zero dimension (it neither skips the kick nor loops): the CDM hardware walks the whole control stream in that single run, and any multiple dispatches are encoded inside that one stream (no “several CDM runs” per command). So for empty_workgroup_{x,y,z} the firmware behaves exactly as for empty_workgroup_all — it kicks once and waits for COMPUTE_FINISHED. A difference in outcome between them is therefore not a firmware per-dimension rule; look at the CDM control stream the host/Mesa builds (how a zero-dimension dispatch is encoded and terminated) rather than at the kick path.

Confidence