Skip to content

drm/asahi: halve G17 firmware notifications per render (first-kick word, retire on fragment) - #504

Merged
DjDeveloperr merged 2 commits into
integration/aurorafrom
perf/g17-ta-first-kick-20261026
Oct 27, 2026
Merged

DjDeveloperr merged 2 commits into
integration/aurorafrom
perf/g17-ta-first-kick-20261026

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

The tiling (TA) work descriptor and the fragment work descriptor carry their completion fields in the same order: stamp address, auxiliary stamp address, stamp value, queue, one word that is always zero, then one more word. The fragment descriptor names that last word first_kick and sets it only for its queue pair's first kick (ordinal == 0). The tiling descriptor left it unnamed (unk_8c2) and set it to 1 on every kick.

With the word set on every kick, the firmware also notifies the host when each pass's tiling stage completes. Each render therefore cost two firmware notifications, two mailbox interrupts and two event passes, where retirement needs only the fragment queue's notification.

This series has two commits:

  1. Retire a G17 render pass on its fragment notification (parked earlier as the prerequisite for this change). A pass is selected for observation, and judged to need a rescan, on the fragment queue's notification alone. Without it, the pair selection would still wait for a tiling notification that no longer comes. This is a host-side retirement rule, so it applies to every firmware.
  2. Set the G17 tiling first-kick word on a pair's first kick only. It renames unk_8c2 to first_kick and sets it for ordinal 0, like the fragment stage's word. This applies to the A18 Pro firmware (26A428). The M4 Pro firmware (25G83) keeps the old value on every kick until it is measured there.

Measured effect

Neo (A18 Pro), on a core with AIC2 effective affinity (#447), same Mesa throughout.

GPU firmware notifications. Tracing-free census, 2 s of render.light d32, per submit:

Base This series
GPU mailbox IRQs 2.18 / 2.19 1.10 / 1.10
Cross-CPU function-call IPIs 1.60 / 1.61 0.95 / 0.93
irq-work IPIs 0.59 / 0.60 0.53 / 0.51

macOS on the same machine takes about 1.04 GPU IRQs per render.

Production series against its base: one boot each, 3 rounds, medians in µs per submit.

Row Base This series
render.light tri, queue d8 32.99 29.71 (−9.9%)
render.light tri, queue d32 / d64 29.91 / 29.88 28.25 / 28.23 (−5.5%)
render.light tri, queue d1 105.44 103.48 (−1.9%)
render.light tri, 2 queues / 2 processes 53.79 / 52.16 50.10 / 50.20 (−6.9% / −3.8%)
render.heavy geom 1080p, d4 / d16 (TVB growth, partial renders) 833.33 / 545.85 833.33 / 545.85
render.heavy fill 1080p, d4 559.28 564.33 (+0.9%, within spread)
compute.light, queue d1 105.17 103.39
sync.signal queues d2, timeline / binary 23.47 / 23.47 23.28 / 23.14

The same word toggled alone by a diagnostic switch, in one boot (3 rounds alternating, medians), agrees:

Row Before After
render.light tri, queue d32 / d64 29.67 / 29.67 27.80 / 27.78 (−6.3% / −6.4%)
render.light tri, queue d8 30.98 29.30 (−5.4%)
render.light tri, queue d1 105.26 104.12 (−1.1%)
render.light tri, 2 processes / 2 queues 52.12 / 52.16 49.73 / 49.65 (−4.6% / −4.8%)
compute.light, queue d1 103.39 104.08
sync.signal queues d2, timeline / binary 22.79 / 22.37 22.61 / 22.61

For reference, macOS on the same machine does about 26.8 µs at d32 and 29.9 µs at d8.

Testing

All on the production build (A18 Pro firmware path):

  • Stop-on-error smoke: render.light d1/d32, procs d2, queues d2, compute.light d1 and timeline sync. Clean.
  • Regression gate: PERFORMANCE-REGRESSION-PASS.
  • Targeted CTS (5368 cases): 4687 pass, 681 not supported, 0 fail.
  • Deterministic sample of the renderpass, renderpass2, dynamic_rendering, draw, query_pool and multiview CTS groups (8409 cases): 6394 pass, 2015 not supported, 0 fail.
  • render.heavy geometry and fill rows are unchanged (above).
  • 10-minute stress run with render, render2, geometry, long-ALU, churn and CTS lanes:
    • 0 GPU recoveries, no asahi kernel messages, desktop alive.
    • All geometry, render, render2 and long-ALU iterations ok.
    • CTS lane 40/40 iterations clean.
    • concurrent.cr in the churn lane timed out 3 of 40 times. That matches the base module's rate under the same lanes (2 of 38 in its stress run).
  • The diagnostic run above also passed the gate and targeted CTS, with no GPU errors.

An event pass considered a render pair only once both of its queues had
posted a stamp notification, the tiling queue's and the fragment
queue's. The tiling notification adds nothing a retirement needs: the
fragment kick starts only after its fragment barrier saw the tiling
stamp, and the observation still requires both stamps in memory to cover
the pass. Recovery attribution reads the stamps, and parameter-buffer
growth arrives as its own record.

Select a pair, and decide that it needs a rescan, on the fragment
queue's notification alone, through one helper with KUnit coverage. A
pass whose only news is a tiling stamp no longer borrows the pair for an
observation that cannot retire.
…only

The tiling descriptor has a word at the position of the fragment
descriptor's first-kick word, which the fragment stage sets only on a
queue pair's first kick. The tiling setup set it on every kick. With it
set, the firmware also notifies the host of the tiling queue's
completion on every pass, so each render cost two firmware
notifications, two mailbox interrupts and two event passes, while
retirement needs only the fragment queue's notification (previous
commit).

Name the word first_kick and set it for ordinal 0 only, as for the
fragment stage, on the A18 Pro firmware (26A428). The M4 Pro firmware
(25G83) keeps the old value on every kick until it is measured there.

Measured on Neo in one boot through a diagnostic switch that toggled
only this word (3 rounds each, medians, us per submit):

  GPU mailbox IRQs per submit (render.light d32)    2.18 -> 1.10
  render.light tri queue d1                        105.26 -> 104.12
  render.light tri queue d8                         30.98 -> 29.30
  render.light tri queue d32                        29.67 -> 27.80
  render.light tri queue d64                        29.67 -> 27.78
  render.light tri procs d2                         52.12 -> 49.73
  render.light tri queues d2                        52.16 -> 49.65
  compute.light queue d1                           103.39 -> 104.08
  sync.signal queues d2 timeline / binary   22.79 / 22.37 -> 22.61 / 22.61
@DjDeveloperr
DjDeveloperr merged commit 501e607 into integration/aurora Oct 27, 2026
RyanTheTide added a commit that referenced this pull request Oct 27, 2026
Pin the public #496/#504/#505 ports and distinguish shared retention fixes
from firmware-qualified fault witnesses and descriptor changes. Document
raw observability and the first-fault/idle-floor evidence needed before
claiming achieved-clock, CTS or remaining performance parity.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide deleted the perf/g17-ta-first-kick-20261026 branch November 7, 2026 12:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant