Skip to content

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

Merged
DjDeveloperr merged 1 commit into
integration/aurorafrom
satchlj/port-349-20261104
Nov 11, 2026
Merged

DjDeveloperr merged 1 commit 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

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.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The net change against integration/aurora is small: the section-table bound in isp_meta_read_exposure(), the meta_exposure gate in isp_init_exposure_ctrls(), and the two KUnit additions (37 lines). The history doesn't match that:

  • 16e17fc ("Prepare the original context ...") removes about 800 lines of integration's ISP code, including the T6040/P010 support and the existing frame gain/exposure reporting.
  • ba71c00 then re-adds "media: apple: isp: report the frame gain and exposure", which integration already has.
  • d83a42a composes the two back again.

The intermediate commits don't build to a working driver for T6040/T8140, so bisecting breaks. Also, 16e17fc's subject has no subsystem prefix. Please drop those three commits and carry the net change as a single commit on integration/aurora (for example media: apple: isp: bound the exposure section entry and gate the controls in the helper), keeping the original author credit in the message if you want it.

Testing: T8122 keeps meta_exposure off, so this change doesn't need a J613 gain check. The new size check does run on T8140 and T6040, though. Please run isp_test_meta_exposure and isp_test_exposure_control_gate under KUnit. Those two boards also need a capture showing that V4L2_CID_GAIN and V4L2_CID_EXPOSURE_ABSOLUTE still update.

…rols in the helper

Reject metadata that cannot contain the exposure section-table entry. Keep exposure controls disabled when the hardware does not report exposure metadata, and cover both cases with KUnit.

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

Assisted-by: LLM
@satchlj
satchlj force-pushed the satchlj/port-349-20261104 branch from 76db723 to 8f9ffa3 Compare November 10, 2026 19:46
@satchlj

satchlj commented Nov 10, 2026

Copy link
Copy Markdown
Member Author

Replaced the remove/re-add history with one media: apple: isp: commit carrying only the net bounds check, helper gate and two KUnit additions on integration/aurora. It is independent of the ISP preview PR. Both isp_test_meta_exposure and isp_test_exposure_control_gate passed under arm64 QEMU KUnit (2/2). T8122 keeps metadata exposure disabled, so no J613 gain check is claimed or needed. T8140 and T6040 captures showing live gain and absolute-exposure updates remain owed; I don't have either board.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

The current net bounds/helper-gate change and history cleanup look good; the posted two targeted KUnit passes cover the requested source regressions. T8122 has metadata exposure disabled, so a J613 camera test cannot close the live-control gate. Keep draft pending capture on T8140/Neo and T6040 showing V4L2_CID_GAIN and V4L2_CID_EXPOSURE_ABSOLUTE still update with no new ISP/DART errors. Hardware coordination request sent to ryan-orch-regress; frames must remain local.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Hardware results (unattended run).

Boards: J700 (T8140) and J616s (T6040).
Baseline: integration/aurora 84d091f.
Test kernel: 84d091f + this PR at 8f9ffa3, same config as the baseline.

Both boards pass, with numbers identical to the baseline:

  • 8 streams (30/15 fps × exposure_dynamic_framerate 0/1 × power_line_frequency 50/60 Hz), 150 frames each, none lost. 30.06–30.16 fps at 30, 15.01–15.04 fps at 15.
  • gain and exposure_time_absolute are read-only and volatile; writes return EACCES. Read from a second fd during streaming, both follow the frames and stay inside the control range: gain 260–4168 (J700) and 260–3123 (J616s), exposure 83–665 (100 µs units). With dynamic framerate off, exposure never went past the frame interval.
  • New ISP errors 0, DART faults 0 (baseline 0 and 0).
  • KUnit on arm64 QEMU: ISP 39/39, apple-isp-v4l2 11/11 including isp_test_exposure_control_gate.

Not covered: image quality, T8122.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codex (GPT-6.1 Sol), reviewing on @DjDeveloperr’s behalf.

The remaining gate is now satisfied by Ryan's posted hardware result #978 (comment): unchanged head8f9ffa30 merged into fleet63/84d091f7 on J700/T8140 and J616s/T6040, same baseline config, one-shot/default untouched. On each board eight150-frame streams lose no frames; read-only/volatile gain and absolute exposure update within range, writes return EACCES, and no new ISP/DART faults. Reported arm64 QEMU suites pass39/39 and11/11, including the targeted gate/bounds cases. Existing exact-head host CI is green.

Re-reviewed the current net2-file change: the section-table entry is bounded before its read, the helper preserves the existing hardware-profile gate, and the single-commit history retains newer T6040/P010 support. No blocking source/review findings remain. Ready to leave draft and merge this bounded metadata fix. These are attributed unattended control/metadata results, not visual image quality, T8122 metadata support, or physical input testing.

@DjDeveloperr
DjDeveloperr marked this pull request as ready for review November 11, 2026 15:52
@DjDeveloperr
DjDeveloperr merged commit 125e696 into integration/aurora Nov 11, 2026
1 check passed
DjDeveloperr added a commit to satchlj/linux that referenced this pull request Nov 11, 2026
Preserve the merged exposure bounds and control-gate tests from PR aurora-silicon#978
alongside the suspended-return and error-wakeup containment cases.
Retain both complete test functions and all registrations.

Signed-off-by: Diljit Singh <hey@djdev.me>
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.

3 participants