Skip to content

media: apple: isp: report and propagate sensor tuning failures - #668

Merged
RyanTheTide merged 2 commits into
aurora-wipfrom
fix/isp-setfile-errors
Oct 31, 2026
Merged

RyanTheTide merged 2 commits into
aurora-wipfrom
fix/isp-setfile-errors

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

NV12 stream setup silently ignored invalid sensor setfiles and upload errors, so a short file, wrong magic or failed transport could leave the camera streaming without the requested tuning. Keep an absent setfile optional, but propagate other read/validation/upload failures and log the upload result. Add KUnit coverage showing that setup stops after a failed load and continues when tuning is absent.

Clarify that isp_*.dat is model-wide sensor tuning, separate from per-module iCCl. Document the NR commands already issued for NV12, the minimal P010 path's omission of tuning/NR, and the unknown module calibration and ANE interfaces. An upload completion message confirms transport only; NV12 does not decode the firmware's setfile reply fields.

Companion installer extraction: aurora-silicon/aurora-installer#71

Validation:

  • ARM64 QEMU KUnit: 30/30 pass, including both new setup failure/fallback tests. The initial run exposed a test-fixture mistake about NV12 flicker reply size; the follow-up commit corrects the fixture. No production command ABI changed.
  • All seven ISP C objects compile with W=1 KCFLAGS=-Werror on defconfig + asahi.config with Rust disabled. The initial Rust-enabled preparation failed in unrelated generated bindgen layout assertions; this is a focused C-driver build, not a complete kernel build.
  • checkpatch --strict: zero errors, warnings or checks. Worktree clean.
  • No hardware access; the lead's camera A/B capture remains pending. No vendor binary, plist, factory calibration, private lab record, local workaround or new driver knob is included.

This is partial image-quality work. NV12 already sends CNR/MBNR, temporal-filter start/enable and motion-history commands. It is not yet proven that those implement the macOS MCTF policy. The iCCl payload/serial-binding/upload ABI and safe P010 NR sequence require a precise Daybreak specification before implementation; neither is guessed here. The separate ANE stage remains later work.

NV12 setup ignored every setfile error except EINTR, including a bad
header, a short file and a rejected firmware upload. This made an
unusable tuning file look like a stream running with model tuning.

Keep absent tuning optional, but fail setup for other read, validation
and upload errors. Log failed uploads and add a debug message for a
successful upload. Exercise failure propagation and missing-file fallback
at the capture setup boundary with KUnit static stubs.

Distinguish model-wide sensor setfiles from per-module iCCl factory data
in Kconfig and document the existing NR commands, P010 omissions and the
unimplemented factory calibration/ANE interfaces. Do not change the
qualified preview sequence or guess undocumented firmware parameters.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
The preview fixture describes P010, whose flicker request has no output.
The new tuning failure cases use NV12, whose existing flicker request
returns a 12-byte record. Keep both expectations in the shared transport
stub so the tests validate the appropriate command ABI.

Clarify that a completed tuning upload is a transport result rather than
proof that the firmware applied every coefficient; its NV12 reply fields
remain undecoded.

Assisted-by: LLM
Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
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