Skip to content

drm/asahi: g17: four-cluster tiling PTC cap as macOS writes it - #2171

Draft
AxxzyWasTaken wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
AxxzyWasTaken:pr/t6041-tiling-ptc-cap
Draft

AxxzyWasTaken wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
AxxzyWasTaken:pr/t6041-tiling-ptc-cap

Conversation

@AxxzyWasTaken

@AxxzyWasTaken AxxzyWasTaken commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Depends on #2021. This branch sits on #2021's branch, so GitHub shows #2021's four commits first; only the last commit belongs to this PR. I'll rebase it once #2021 lands.

0x0a5a1 carries the tiling PTC cap in bits 32 and up. The 25G83 tiling array writes 0x60 there, the two-cluster M4 Pro value. In my macOS 26.6.2 (25G83) capture on this J616C, taken under a hypervisor while macOS ran a game, the clustered passes have 0x7f, 0x97 or 0xaf there. This gives clustered four-cluster passes 0xaf_0040_0020, the largest of those. TA mode 1, two clusters and other builds keep 0x60.

I don't know how macOS picks among the three values per pass, so taking the largest is my own choice.

Testing

All on a J616C (32-core M4 Max), 25G83:

  • My daily module since 16 Nov, with drm/asahi: g17: tile clustered on the 32-core M4 Max (T6041 25G83) #2021 and other work that isn't in this PR. That build ran Roblox (Vulkan, 11+ minutes, 0 GPU recoveries), Minecraft and, since today's fix for the metadata copies, SCP:SL.
  • Never A/B tested on its own: I have no measurement showing a gain or a fix from it. While I was tracing today's SCP:SL failure, going back to 0x60 failed the same way, so it isn't that failure's cause either.
  • This branch: built (M=drivers/gpu/drm/asahi), not booted as-is. tools/asahi/run-host-tests.py --only g17: 90/90. I couldn't run KUnit (no QEMU here).

Assisted-by: LLM (Anthropic:Claude Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

The production boot stub pins at macOS 27.2 (26B123), so please retarget this to 27.2. The tiling PTC cap here comes from the 26.6.2 (25G83) GPU firmware; please take it from the T6041 GPU image the 27.2 stub loads.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Blockers: 2.

  1. drivers/gpu/drm/asahi/g17/fw/render.rs:708 and :802: 0xaf is picked as "the largest of three values seen", and the PR says it was never A/B tested and showed no gain and no fix (going back to 0x60 failed the same way). That makes it a chosen value with no measured effect on a register whose meaning isn't known. Either find what the per-pass value depends on and compute it from that (the capture already has three values per pass to correlate against the pass geometry and cluster count), or drop this commit until a same-Mac A/B shows it matters.
  2. drivers/gpu/drm/asahi/g17/fw/render.rs:708: the constant hardcodes the low 32 bits (0x0040_0020) a second time instead of taking them from UNK_0A599 (g17/fw/mod.rs:102). If the shared value ever changes, clustered four-cluster passes silently keep the old low bits. Build it as (UNK_0A599 & 0xffff_ffff) | (0xaf << 32), or give the cap field a named shift.

Also checked: multi (render.rs:760) is only Some for non-TA-mode-1 passes with more than two clusters, so the M4 Pro and the TA-mode-1 builds keep 0x60. The branch sits 178 commits behind integration/aurora on top of #2021, which is still open. A test merge with the current base takes the 26B123 entries cleanly, and there T6041 keeps ta_mode_1: true (hw/t6041.rs, BUILD_26B123), so this override never runs on that firmware. CI host-tests pass; the commit has a human Signed-off-by and the body ends with an Assisted-by line.

HW row: J616C (M4 Max), this commit rebased on the landed #2021 and booted as-is, same-Mac A/B with 0x60 against the new value on the firmware the boot stub loads: Roblox 10+ min, Minecraft RD32 fps, 0 GPU recoveries, KUnit asahi_g17_ta_mode passing, 0 AVC, 0 failed units, 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

This branch sits on an earlier version of #2021. #2021's head is now 2ba7a68 with reworked commits, and a test merge against it conflicts in six files. When you rebase, the open points in render.rs still stand. 0xaf needs either a rule derived from the pass (the capture has three values per pass to correlate against) or a same-Mac A/B that shows it matters. The low 32 bits should come from UNK_0A599 rather than being repeated. The current base also has T6041 27.2 (26B123) with ta_mode_1: true, so this path doesn't run on that firmware.

@RyanTheTide

Copy link
Copy Markdown
Contributor

The current head 845bd7f697b3 conflicts in drivers/gpu/drm/asahi/hw/t6041.rs on integration/aurora 5441428d9033. This leaves the proposed PTC cap without a current-tip build. The cap still needs a hardware-backed value and a performance row as discussed above.

@AxxzyWasTaken
AxxzyWasTaken force-pushed the pr/t6041-tiling-ptc-cap branch from 845bd7f to d86cb97 Compare November 23, 2026 09:13
@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Rebased onto the updated #2021 stack (1c420ea8baca, on integration/aurora a4b51cdff0a7) at d86cb97e6234 (resolved the additive context hunk next to v25g83_clustered_free_pages in drivers/gpu/drm/asahi/g17/fw/render.rs). tools/asahi/run-host-tests.py --only g17: 90/90 passed. Keeping in Draft pending #2021 and hardware/performance evaluation.

Assisted-by: LLM (Google:Gemini 4 Neon)

0x0a5a1 carries the tiling PTC cap in bits 32 and up. The 25G83 array
wrote 0x60, the two-cluster M4 Pro value. macOS 26.6.2 on the 32-core
M4 Max writes 0x7f, 0x97 or 0xaf for its passes. Give clustered
four-cluster passes 0xaf, the largest of those.

Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
@AxxzyWasTaken

Copy link
Copy Markdown
Contributor Author

Now that #2021 has merged (e930d7ea0822), rebased cleanly onto integration/aurora (8e0a70e1bd60) at f4ba82ac9b90 as a standalone 1-commit PR (git range-diff identical to d86cb97e6234).

  • tools/asahi/run-host-tests.py --only g17: 90/90 passed
  • Keeping in Draft pending hardware-backed rule and A/B performance row.

Assisted-by: LLM (Google:Gemini 4 Neon)

@AxxzyWasTaken
AxxzyWasTaken force-pushed the pr/t6041-tiling-ptc-cap branch from d86cb97 to f4ba82a Compare November 23, 2026 21:05
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.

2 participants