Skip to content

drm/asahi: g18: back the parameter buffer with 30 blocks (10 s GPU stalls on the M6 Mac mini) - #2241

Closed
sithglan wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
sithglan:thomas/g18-pb-overprovision
Closed

sithglan wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
sithglan:thomas/g18-pb-overprovision

Conversation

@sithglan

Copy link
Copy Markdown
Contributor

On the J873 (M6 Mac mini), zooming into Google Maps in Firefox or Chromium stalls the GPU for 10 s, and the browser's submit then fails with EIO:

G18_EVENT role=0 ordinal=3517032 type=6 payload=[3, 0, 0, 0, 0]
G18_APP_WAIT frame=3517033 ms=1000 ... (repeats until 10000)
G18_JOB_WATCHDOG application completion ms=10000: requesting recovery
G18_APP_JOB_FAILED error=Error(5) recovery epoch=1 host=true ...

Event type 6 is the firmware's TVB grow request (the M5 TvbGrowEventRecord layout: VM slot 3, buffer slot 0, counter, subpipe, halt count = recovery epoch). The G18 parameter buffer has 8 blocks (4 MiB) and no runtime growth, so nothing answers and the tiler waits until the watchdog recovers.

I tried answering with a "not grown" device-control reply (opcode 8 on the primary control ring plus the 0x84/0x11 doorbell, as the M5 driver does at its maximum). The firmware consumes it (PB state +0x70 goes to 1), but the tiler stays stalled. Real growth, the M5 commit_growth path, would mean writing the G18 block table and shared header, whose words are still marked [OPEN]. So this PR does what render_policy::PB_BLOCKS already planned ("overprovision >=8; no PB growth"): it uses that constant and sets it to 30 blocks (15 MiB). That fills the 16 MiB graphics-pb window after the page list, metrics, scene scratch and discard page, with no address-map changes.

Tests on the M6, with the J873 #10 stack (integration 0abc2f3 plus the J873g PRs), whose g18 code matches the integration tip in the three files touched here. The integration tip with this commit compiles.

  • Headless GLES test, N triangles of about 200 px into 2560x1440:

    stalls at renders fine at
    8 blocks 60000 20000
    30 blocks 150000 100000 (7 ms per frame)
  • The rendered image matches llvmpipe except for 25 single pixels at triangle edges. Small scenes that never come close to overflowing show the same 28-49 such pixels.

  • Two GL clients submitting tiny frames in turn, so the job switches client VMs on most submits: 2x2000 frames take 2.63-2.75 s with 30 blocks and 2.70-2.86 s with 8. A single client takes 2.33 s in both cases.

  • The desktop (sway, three displays) runs normally on the 30-block module.

Workloads above about 3.75x the old limit still stall. Going further needs a wider graphics-pb window (Mesa reserves COMPACT_BIAS + [32 MiB, 2 GiB) for the kernel) or real growth.

The G18 render path gives the tiler a parameter buffer of 8 blocks
(4 MiB) and has no runtime growth. When a scene needs more, the firmware
posts event type 6 (TVB grow request, the M5 TvbGrowEventRecord layout)
and the tiler waits for the host. Nothing answers, so the frame stalls
until the 10 s job watchdog requests a recovery, and the client's submit
fails with EIO. Zooming into Google Maps in Firefox or Chromium on the
J873 (M6 Mac mini) hits this.

Answering the request with a "not grown" device-control reply (opcode
8, as the M5 driver does at its maximum) does not help: the firmware
consumes the record, but the tiler stays stalled.

So overprovision, as render_policy::PB_BLOCKS already planned, and use
that constant: 30 blocks (15 MiB) fill the 16 MiB graphics-pb VA window
after the page list, metrics, scene scratch and discard page.

A headless GLES test drawing N triangles of about 200 px into 2560x1440
used to stall at 60000 triangles. Now it renders 100000 in 7 ms and
first stalls between 100000 and 150000. The image matches llvmpipe
apart from single edge pixels, as it does for small scenes. Two clients
submitting tiny frames in turn show no measurable change in submit time
(2.63-2.75 s for 2x2000 frames, 2.70-2.86 s before).

Signed-off-by: Thomas Glanzmann <thomas@glanzmann.de>
@sithglan

Copy link
Copy Markdown
Contributor Author

Superseded by #2242: 30 blocks were not enough for Google Maps, so the driver now grows the parameter buffer when the firmware asks.

@sithglan sithglan closed this Nov 19, 2026
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