Skip to content

media: apple: isp: bound exposure metadata and keep controls gated - #978

Draft
satchlj wants to merge 6 commits into
integration/aurorafrom
satchlj/port-349-20261104
Draft

satchlj wants to merge 6 commits into
integration/aurorafrom
satchlj/port-349-20261104

Conversation

@satchlj

@satchlj satchlj commented Nov 5, 2026

Copy link
Copy Markdown
Member

Aurora already has frame gain/exposure reporting from Ryan’s original #689. Port the remaining section-table entry bound and short-header/control-gate regression tests. Make the helper enforce the same hardware-profile gate as Aurora’s existing caller, and retain newer T6040/P010 support. T8122 metadata units/layout remain unqualified and gain reporting stays gated off.

Port of omacom/linux-aurora#349. The original PR remains untouched.

Carried dependency: ef2275f384be (carried commit ba71c0044845), media: apple: isp: report the frame gain and exposure, original author Ryan Murray: carried unaltered from omacom/linux-aurora. Its complete patch, message, authorship and dates are preserved; the separate 7.3 adaptation retains Aurora’s existing capture support.

@RyanTheTide

This carries Ryan Murray's additional metadata bounds and regression coverage from omacom/linux-aurora unaltered, because Aurora doesn't have it yet and this change builds on it. If you'd rather land it separately or differently, say so and I'll rework this.

Validation: arm64 defconfig + asahi.config, Image/modules/DTBs with BTF and KUnit enabled, LLVM 18/Rust 1.85.0, passed at stack top #349 (76db72372939), which includes this branch. The validated integration base is b500668. QEMU loaded the test-bearing modules successfully with no additional failures. The combined run retains four pre-existing SEP store failures (plus their suite aggregate), reproduced on the unmodified Aurora base. The unmodified pinned base also crashes in apple-av-audio-lifetime/av_lifetime_devres_order; that unrelated audio suite is explicitly excluded. All tests added by these ports run through KUnit debugfs on Cortex-A76. This is not a fully green or complete-tree KUnit run. The additional short-header/control-gate KUnit coverage ran in QEMU. The latter first caught the missing helper-side check; the production helper was corrected while retaining the caller gate and unchanged assertions. No 7.3 hardware boot or deployment has been performed.

satchlj and others added 6 commits November 4, 2026 21:34
Preserve the complete original omacom commit separately from the 7.3
adaptation that retains Aurora frame gain and exposure support.

Signed-off-by: Satya Benson <satya@benson.earth>
Userspace has no way to tell how hard the sensor is working. Gain is the
signal a camera pipeline needs to decide when the picture is noisy enough
to denoise, and the firmware already writes it into every frame's
metadata buffer, which the driver maps but never reads.

The metadata buffer opens with a table of section offsets. On H17
firmware the fourth section starts with the frame's exposure: the
integration time in microseconds, then the total sensor gain in 1/256
steps with 256 as unity. This was established on T6040 and T8140 by
watching auto exposure converge on a fixed scene, where the gain climbed
from 260 to its final value once the integration time hit the frame
period, and by stepping the frame rate, which capped the integration
time at the frame period.

Read the section when a metadata buffer comes back, through the table and
bounded by the buffer size, and report the last values as read-only,
volatile V4L2_CID_GAIN and V4L2_CID_EXPOSURE_ABSOLUTE controls. Only
hardware whose match data says its metadata carries the report gets the
controls.

(cherry picked from commit 3c54411)

Port to integration/aurora: only T8140 exists on this base; omit the
T6040/P010 dependencies. Keep T8122 metadata reporting disabled because
the 26.6.2 layout and units are unqualified. Bound the table-entry read
as well as its target and test short headers and control admission.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
Signed-off-by: Satya Benson <satya@benson.earth>
Retain the existing T6040/P010 path and frame gain/exposure reporting.
Carry only the additional section-table bound and regression coverage
from the preceding unchanged public commit into the final source tree.

Signed-off-by: Satya Benson <satya@benson.earth>
Keep the 7.3 registration-side profile check and make the helper enforce the same gate. This preserves the carried control-gate regression test and refuses controls when the selected hardware has no qualified exposure metadata.

Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj

satchlj commented Nov 5, 2026

Copy link
Copy Markdown
Member Author

@DjDeveloperr @RyanTheTide ready for your regression testing. It hasn't been boot-tested on J613 with 7.3 yet; I'll post the result here when I have it. Still a draft until the camera gain is checked on J613 hardware.

@satchlj

satchlj commented Nov 6, 2026

Copy link
Copy Markdown
Member Author

J613 boot result on 7.3 (rubra, M3 MacBook Air 13", macOS 26.6.2 / 25G83 firmware), 2026-11-05.

For this PR: the camera node comes up. Frame-gain image quality hasn't been judged yet.

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