Repository navigation
drm/asahi: g18: skip requesting capture firmware in stage 10 - #3561
RyanTheTide merged 1 commit into
Conversation
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>
There was a problem hiding this comment.
Verdict: FINISH, then merge at b413d536
Blockers:
- PR description (
pr-text): Please includetwo-way(and the affected Mac generation, e.g.,two-way · M6 (T8152 / G18)) in**Risk:**(and standard**What:**/**Tested:**/**Risk:**headings) sopr-textpasses once CI runs. - Hosted CI & exact-head hardware row: Hosted CI at
b413d536still needs to run and pass (rust-build,host-tests,pr-text,readiness), and a liveT8152(G18) Stage 10 boot row at this head confirming the-2firmware-load warning is gone andG18_RENDER_PAYLOAD layout-onlyboots cleanly is still owed.
Checked:
- Audited
drivers/gpu/drm/asahi/g18/runtime/graphics_memory.rsand all callers ofG18GraphicsMemory::load_payload(),layout_only_payload(),prepare_render(),encode_h1(), andcapture_fields()acrossdrivers/gpu/drm/asahi/g18/; zero code blockers found. - Confirmed
crate::g18::boot::STAGE_DRMispub(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 profiles2..=4still request firmware unchanged. - Confirmed
initdata/mod.rsskipsencode_h1()wheneverjob.layout_only_payload()is true (self.command.is_empty()), andcapture_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: returnsSelf::layout_only(dev, uat)directly forprofile == 1 && g18_initdata_test.value() == STAGE_DRM, avoiding theFirmware::request()-ENOENTlog 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.pyandg18-job-error-tests.pypass.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
There was a problem hiding this comment.
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_DRMispub(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 profiles2..=4still request firmware unchanged. - Confirmed
initdata/mod.rsskipsencode_h1()wheneverjob.layout_only_payload()is true (self.command.is_empty()), andcapture_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
|
Merging at |
What: Skip requesting
asahi/g18-26a428-color-a-v2.binin stage 10 (STAGE_DRM) inG18GraphicsMemory::load_payload()and returnlayout_only()directly, eliminating the spurious-2firmware-load error logged on every T8152 boot.Tested: Host build and G18 host tests at
b413d5364(drivers/gpu/drm/asahi/aurora.owithCONFIG_DRM_ASAHI_G18=y, clang/lld 22.1.8, rustc 1.100.0, zero new warnings;g18-client-handoff-tests.pyandg18-job-error-tests.pypass); spurious-2error reproduced on J804 MacBook Pro 14" M6 (apple,t8152) running7.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 headb413d5364(J804 DT is still pending in #2107).Details
In stage 10 (
STAGE_DRM, the default),G18GraphicsMemory::load_payload()never executes capture bytes:prepare_render()skipsencode_h1()whenlayout_only_payload()is true, andApplicationJobrebuilds every frame from Mesa/Borealis parameters.Previously,
load_payload()calledFirmware::request()forasahi/g18-26a428-color-a-v2.binand only fell back toSelf::layout_only()onENOENT. On systems without the private reverse-engineering capture file installed,request_firmware()emits a spurious warning on every boot:Checking
profile == 1 && g18_initdata_test == STAGE_DRMbeforeFirmware::request()preserves profile validation (EINVAL), geometry checks (ENODEV), and stage 9 replay unchanged while avoiding the missing-firmware warning in stage 10.Evidence
b413d5364onmain(f7d271192)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 indrivers/gpu/drm/asahi/g18/runtime/graphics_memory.rspython3 -I tools/asahi/g18-client-handoff-tests.py— PASS (3/3)python3 -I tools/asahi/g18-job-error-tests.py— PASS (5/5)