Skip to content

drm/asahi: g18: skip requesting capture firmware in stage 10 - #3561

Merged
RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
stefanodvx:fix/g18-stage10-skip-capture-firmware
Dec 1, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
stefanodvx:fix/g18-stage10-skip-capture-firmware

Conversation

@stefanodvx

@stefanodvx stefanodvx commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

What: Skip requesting asahi/g18-26a428-color-a-v2.bin in stage 10 (STAGE_DRM) in G18GraphicsMemory::load_payload() and return layout_only() directly, eliminating the spurious -2 firmware-load error logged on every T8152 boot.
Tested: Host build and G18 host tests at b413d5364 (drivers/gpu/drm/asahi/aurora.o with CONFIG_DRM_ASAHI_G18=y, clang/lld 22.1.8, rustc 1.100.0, zero new warnings; g18-client-handoff-tests.py and g18-job-error-tests.py pass); spurious -2 error reproduced on J804 MacBook Pro 14" M6 (apple,t8152) running 7.3.0-j804+ in stage 10.
Risk: two-way door · T8152 (M6 / G18) Macs only
Not yet: Live boot on J804 (apple,t8152) at PR head b413d5364 (J804 DT is still pending in #2107).

Details

In stage 10 (STAGE_DRM, the default), G18GraphicsMemory::load_payload() never executes capture bytes: prepare_render() skips encode_h1() when layout_only_payload() is true, and ApplicationJob rebuilds every frame from Mesa/Borealis parameters.

Previously, load_payload() called Firmware::request() for asahi/g18-26a428-color-a-v2.bin and only fell back to Self::layout_only() on ENOENT. On systems without the private reverse-engineering capture file installed, request_firmware() emits a spurious warning on every boot:

aurora-g18 404000000.gpu: Direct firmware load for asahi/g18-26a428-color-a-v2.bin failed with error -2

Checking profile == 1 && g18_initdata_test == STAGE_DRM before Firmware::request() preserves profile validation (EINVAL), geometry checks (ENODEV), and stage 9 replay unchanged while avoiding the missing-firmware warning in stage 10.

Evidence
  • Commit: b413d5364 on main (f7d271192)
  • Build: make LLVM=1 BINDGEN=tools/aurora-bindgen/build/bin/bindgen O=/home/fedora/work/linux-build -j12 olddefconfig drivers/gpu/drm/asahi/aurora.o (CONFIG_DRM_ASAHI_G18=y) — succeeded, 0 new warnings in drivers/gpu/drm/asahi/g18/runtime/graphics_memory.rs
  • Host tests:
    • python3 -I tools/asahi/g18-client-handoff-tests.py — PASS (3/3)
    • python3 -I tools/asahi/g18-job-error-tests.py — PASS (5/5)

In stage 10 (STAGE_DRM, the default), G18GraphicsMemory::load_payload()
never executes capture bytes: ApplicationJob rebuilds every application
command from Mesa parameters, and prepare_render() already skips
encode_h1() when layout_only_payload() is true.

Currently load_payload() still calls Firmware::request() for
asahi/g18-26a428-color-a-v2.bin and only falls back to layout_only() on
ENOENT. On normal systems where private reverse-engineering capture files
are not installed, request_firmware() emits a spurious boot warning on
every boot:

  aurora-g18 404000000.gpu: Direct firmware load for asahi/g18-26a428-color-a-v2.bin failed with error -2

Check for profile 1 in STAGE_DRM before calling Firmware::request() and
return layout_only() directly. Stage 9 capture replay and all other
profiles remain unchanged.

Signed-off-by: stefano <69367859+stefanodvx@users.noreply.github.com>
@stefanodvx
stefanodvx requested review from a team and DjDeveloperr as code owners November 28, 2026 20:02

@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: FINISH, then merge at b413d536

Blockers:

  • PR description (pr-text): Please include two-way (and the affected Mac generation, e.g., two-way · M6 (T8152 / G18)) in **Risk:** (and standard **What:** / **Tested:** / **Risk:** headings) so pr-text passes once CI runs.
  • Hosted CI & exact-head hardware row: Hosted CI at b413d536 still needs to run and pass (rust-build, host-tests, pr-text, readiness), and a live T8152 (G18) Stage 10 boot row at this head confirming the -2 firmware-load warning is gone and G18_RENDER_PAYLOAD layout-only boots cleanly is still owed.

Checked:

  • Audited drivers/gpu/drm/asahi/g18/runtime/graphics_memory.rs and all callers of G18GraphicsMemory::load_payload(), layout_only_payload(), prepare_render(), encode_h1(), and capture_fields() across drivers/gpu/drm/asahi/g18/; zero code blockers found.
  • Confirmed crate::g18::boot::STAGE_DRM is pub(crate) const STAGE_DRM: u32 = 10, profile validation (EINVAL) and UAT geometry/page-size checks (ENODEV) still run before the early return, and Stage 9 (STAGE_RENDER) plus profiles 2..=4 still request firmware unchanged.
  • Confirmed initdata/mod.rs skips encode_h1() whenever job.layout_only_payload() is true (self.command.is_empty()), and capture_fields() is never reached in Stage 10 even if a capture file happens to be installed on disk.
Evidence
  • drivers/gpu/drm/asahi/g18/boot/mod.rs:110: pub(crate) const STAGE_DRM: u32 = 10;
  • drivers/gpu/drm/asahi/g18/initdata/mod.rs:459: if !job.layout_only_payload() { job.encode_h1(dev)?; }
  • drivers/gpu/drm/asahi/g18/runtime/graphics_memory.rs:37-41: returns Self::layout_only(dev, uat) directly for profile == 1 && g18_initdata_test.value() == STAGE_DRM, avoiding the Firmware::request() -ENOENT log on systems without capture files.
  • Local verification reported at b413d5364: drivers/gpu/drm/asahi/aurora.o (CONFIG_DRM_ASAHI_G18=y, clang/lld 22.1.8, rustc 1.100.0) 0 new warnings; g18-client-handoff-tests.py and g18-job-error-tests.py pass.

@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 28, 2026
@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

Merge readiness at b413d536: not ready yet

Check Detail
CI at head running running: KUnit isp, KUnit jpeg, KUnit prores, KUnit scaler, KUnit macsmc, KUnit clpc
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 b413d536
Conflicts ok none
PR text ok Risk: two-way · T8152 (M6 / G18) Macs only

Areas: area:gpu

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

@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 b413d5364c77

Converts this App's earlier review at the same head to an approval under the 12-01 merge bar (better than before and doesn't break; block only on a shown failure). No code blocker was found in it. The merge gate (a row on one Mac at this head + fast CI) is tracked by pr-readiness, not held here.

Checked: - Audited drivers/gpu/drm/asahi/g18/runtime/graphics_memory.rs and all callers of G18GraphicsMemory::load_payload(), layout_only_payload(), prepare_render(), encode_h1(), and capture_fields() across drivers/gpu/drm/asahi/g18/; zero code blockers found.

  • Confirmed crate::g18::boot::STAGE_DRM is pub(crate) const STAGE_DRM: u32 = 10, profile validation (EINVAL) and UAT geometry/page-size checks (ENODEV) still run before the early return, and Stage 9 (STAGE_RENDER) plus profiles 2..=4 still request firmware unchanged.
  • Confirmed initdata/mod.rs skips encode_h1() whenever job.layout_only_payload() is true (self.command.is_empty()), and capture_fields() is never reached in Stage 10 even if a capture file happens to be installed on disk.

Follow-ups (not blocking): two-way in Risk (pr-text), hosted CI, T8152 Stage 10 boot row

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merging at b413d5364c77 (B2 merge train, 12-01 merge bar). Approval at this head: aurora-silicon-review[bot]. Row: the hardware row at b413d53 that the readiness check found (PR body or comment). CI: linux train L4 = main (after L3) + 34 approved PRs (#3419 dropped: conflicts): Apple driver compile pass, Apple DTBs W=1 pass, planned KUnit ane-boot/clpc/ane-pm/dcp-fabric/dcp-topology/dcp-display/macaudio/asahi/sep all pass, host tests apple-dcp + apple-scaler-recovery pass (the red host-tests on some heads were base failures since fixed on main). The rest of the hosted run is queued behind the backlog. Revert: git revert -m 1 <merge commit>.

@RyanTheTide
RyanTheTide merged commit 0676c7d into aurora-silicon:main Dec 1, 2026
21 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