Skip to content

drm/asahi: let a G17 render queue keep 32 commands in flight - #497

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
perf/g17-render-depth32-20261026
Oct 27, 2026
Merged

DjDeveloperr merged 1 commit into
integration/aurorafrom
perf/g17-render-depth32-20261026

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

A logical G17 render queue admitted 16 commands at a time, although its pair already has command records (TA and fragment descriptors, configuration and timestamp slots) for RECORDS = 32. At depth, the firmware runs the renders already announced when it starts a batch, then writes their completions one after another before the next batch. The 16-command window therefore capped each batch: at render depth 32 the median render ran in a batch of 8, at most 14, and the fixed cost of each batch edge fell on few renders.

  • RENDER_DEPTH = 32 = RECORDS; the render scheduler's credits follow it.
  • A build-time DEPTH <= RECORDS check in render memory: every unretired render of a pair holds its own command record.
  • Every structure sized by RENDER_DEPTH was checked:
    • command records are indexed by ordinal % 32;
    • the retirement window at depth 32 is at most 4 × 63 = 252 items, within the 1280-entry item ring;
    • the predecessor, target-slot, retirement-ring, deferred-batch and admission-ref tables scale with the constant.
  • Memory cost: each pair keeps one Generation per command in flight (96 KiB state plus a 16 KiB fragment page). That's 16 more per pair, about 1.75 MiB more per render queue.

Measurements

Neo, one boot, 16 against 32 commands, alternating, three rounds (µs per submission, medians):

row 16 32 change
render.light tri, depth 32 30.41 29.50 −3.0%
render.light tri, depth 64 30.34 29.38 −3.1%

Depth 1/8/16, several queues (depth 2/8) and several processes (depth 2, rechecked over five rounds: −0.2%) are unchanged within run-to-run spread. The GPU time of each render is identical. At depth 32/64 the median render now runs in a batch of 11/15, at most 32; with 16 commands it was 8, at most 14.

An earlier trial with 32 commands showed batches collapsing to 3. That run had a CPU thread polling the completion-stamp lines; without it the collapse doesn't reproduce.

Testing

  • Regression gate passes.
  • Targeted CTS (5368 cases): 4687 pass, 681 not supported, 0 fail, the same as the base.
  • No asahi or G17 kernel errors.

A logical render queue admitted 16 commands at a time, although its pair
has command records (TA and fragment descriptors, configuration and
timestamp slots) for 32. At depth the firmware runs the renders already
announced when it starts a batch, then writes their completions one after
another before it starts the next, so the window bounded every batch: at
render depth 32 the median render ran in a batch of 8, at most 14, and the
fixed cost of each batch edge fell on few renders.

Admit as many commands as a pair has records; the scheduler's credits
follow. At depth 32 and 64 the median render now runs in a batch of 11
and 15, at most 32. Each pair keeps a Generation per command in flight,
16 more of them, about 1.75 MiB more per render queue. A build-time check
keeps the depth within the records.

Measured on Neo in one boot, 16 against 32 commands, alternating, three
rounds (us per submission, medians):

  render.light tri, depth 32       30.41 -> 29.50
  render.light tri, depth 64       30.34 -> 29.38

Shallower depths, several queues or processes and the GPU time of each
render are unchanged within run-to-run spread.
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