Skip to content

drm/asahi: g17: M5: bind the task-stage mesh storage on J813-form boards - #3582

Merged
RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
m0d16l14n1:fix/g17-m5-task-mesh-storage
Nov 29, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
m0d16l14n1:fix/g17-m5-task-mesh-storage

Conversation

@m0d16l14n1

Copy link
Copy Markdown
Contributor

What: Bind the task-stage mesh storage on J813-form M5 boards. tiling_with_scratch_into() writes the TA mesh rendering buffer register (0x1ca48, after 0x10799) for task-stage kicks, but the J813-form path (chip 0x8142: J813, J815, J704) pushes its common registers and continues before that match. A task kick there never got the buffer the kernel mapped for it, while the kernel still reports DRM_ASAHI_FEATURE_TASK_MESH_STORAGE and Borealis advertises taskShader, so every task-stage render on those boards ended in a firmware recovery. Write 0x1ca48 after 0x10799 on that path too, as on the other M5 boards.
Tested: J815 MacBook Air 15" M5 (T8142, G17G), aurora.ko built from main 0701a920154e + this commit (head 8d5b38fc74f2), Borealis aurora-wip. dEQP-VK task-stage cases that recovered before (24): 24/24 Pass (before: 24/24 Crash, 386 recovery lines). mesh_shader.ext.smoke.* (67): 61 Pass, 6 NotSupported, 0 Crash (before: 12 Crash). dEQP-VK gate sample (15,958 cases): 11,151 Pass, 4,807 NotSupported, 0 Fail. Regression line: 0 SELinux denials (N/A on this image), 0 failed units, 0 new GPU kernel lines.
Risk: two-way door · J813-form M5 boards (J815 tested; J813 and J704 take the same path); other M5 boards and other chips unchanged.
Not yet: J813 and J704 hardware rows. No task-shader performance A/B (before this change task-stage renders did not complete on these boards).

Details
  • g17/fw/m5/render_registers.rs: in the e.j813 branch of tiling_with_scratch_into(), after pushing 0x10799, also push 0x1ca48 = mesh_storage when the kick has mesh storage (mesh_storage != 0). That is the same match and value the non-J813 path below already uses; render kicks without a task stage pass mesh_storage == 0 and are unchanged.
  • The "before" numbers come from the same J815 with the J815 kernel tree, which has the same J813-form path, just before this change was added to it.
  • Also checked on main's driver without this change (main 0701a920154e plus an unrelated watchdog change, same Image): in the gate sample exactly these 24 task-stage cases crash (11,127 Pass, 4,807 NotSupported, 24 Crash, 383 recovery lines); with this change they pass and nothing else moves.
Evidence

Machine: J815 MacBook Air 15" M5 (T8142, G17G), kernel 7.3.0-aurora-j815-dev, dEQP-VK 1.4, 60 s per-case timeout, shader cache off.

Case list Before This PR
task-stage cases (24, binding_model.descriptorset_random.*.task.*, mesh_shader.ext.*with_task*, mesh_and_task) 24 Crash, 386 recovery lines 24 Pass, 0 GPU kernel lines
mesh_shader.ext.smoke.* (67) 49 Pass, 12 Crash, 6 NotSupported 61 Pass, 6 NotSupported
gate sample (15,958) n/a 11,151 Pass, 4,807 NotSupported, 0 Fail, 0 GPU kernel lines

A recovery before the change looked like this:

aurora: G17: recovery cause gen 0: unnamed firmware reason (firmware reason 0); firmware blames queue Some(10); slots walked 1, slot word 0x111be, detail 0x0
aurora: G17: recovery MMU fault bank 0: no fault (status 0x0)

tiling_with_scratch_into() writes the TA mesh rendering buffer register
(0x1ca48, after the scratch-window register 0x10799) for task-stage
kicks, but the J813-form path (chip 0x8142: J813, J815, J704) pushes its
common registers and continues before that match, so a task kick there
never got the buffer the kernel had mapped for it. The kernel still
reports DRM_ASAHI_FEATURE_TASK_MESH_STORAGE, Mesa advertises taskShader,
and every task-stage render on those boards ends in a firmware recovery.

Write 0x1ca48 after 0x10799 on that path too, as on the other M5 boards.

Signed-off-by: Nick <[email protected]>

@aurora-silicon-review aurora-silicon-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: MERGE at 8d5b38fc once the fork PR's CI workflows are approved and pass.

Blockers: none in code (await fork CI workflow approval and green checks).

Checked: Full 1-file diff (drivers/gpu/drm/asahi/g17/fw/m5/render_registers.rs), tiling_with_scratch_into() register emission and TaProgram capacity bounds, and exact-head J815 (T8142 / G17G) task/mesh CTS results.

Evidence
  • Code audit (render_registers.rs:382-390):
    • Matches the non-e.j813 path verbatim (if r.reg == 0x10799 && mesh_storage != 0 { out.push(0x1ca48, mesh_storage)?; }), emitting the TA mesh rendering buffer register immediately after 0x10799 on J813-form (0x8142: J813, J815, J704) task-stage kicks.
    • Non-task renders (mesh_storage == 0) and non-e.j813 boards are unchanged; TaProgram capacity easily accommodates the single added register write.
  • Verification at 8d5b38fc (J815 M5 / G17G): 24 previously crashing task-stage dEQP-VK cases pass 24/24 with 0 GPU kernel lines (down from 386 firmware recovery lines); mesh_shader.ext.smoke.* 61 Pass / 6 NotSupported / 0 Crash (down from 12 Crash); 15,958-case gate sample 11,151 Pass / 4,807 NotSupported / 0 Fail, 0 failed units, 0 new GPU kernel lines.

@RyanTheTide

Copy link
Copy Markdown
Contributor

code-owner ping <@422957901716652033> / @DjDeveloperr: merge train at 8d5b38fc. App approved (NEON-PR-REVIEW2); rows J815-exact-head, e.j813-branch-only, same-commit-as-3575. Merges under the 6-point rule 1 h from now once hosted CI is green, unless you object.

@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Nov 29, 2026
@github-actions

Copy link
Copy Markdown

Merge readiness at 8d5b38fc: not ready yet

Check Detail
CI at head ok no CI for this change (the hardware row is the gate)
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok in the PR body at 8d5b38fc
Conflicts ok none
PR text ok Risk: two-way · J813-form M5 boards (J815 tested; J813 and J704 take the same path); other M5 boards and other chips unchanged.

Areas: area:gpu

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging under the 6-point rule (Ryan 09:29, permanent), at 8d5b38fc. (1) The review App approved at this head. (2) Full CI is green. (3/4) Rows: J815-exact-head;e.j813-branch-only;same-commit-as-3575. (5) There's no blocking review. (6) Dj was pinged here 89 min ago with no objection. Revert: git revert -m 1 <merge>.

@RyanTheTide
RyanTheTide merged commit f736bc2 into aurora-silicon:main Nov 29, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) blast:m5 Macs affected, from Merge risk (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants