Skip to content

media: apple: isp: select sensor setfiles by platform ID - #3928

Merged
DjDeveloperr merged 1 commit into
mainfrom
camera-all-v2/platform-setfiles
Dec 2, 2026
Merged

DjDeveloperr merged 1 commit into
mainfrom
camera-all-v2/platform-setfiles

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What

The driver loads the first setfile release for every sensor. On the M2 Air (platform 0x0e) and the M5 Pro (0xba) a later release for the same sensor gives a clearly more neutral picture in our own identical-scene captures, so select it there by the device-tree platform ID:

  • IMX558 on 0x0e: isp_1922_02XX.dat (temporal filter off, like 1921_01).
  • IMX958 on 0xba: isp_2226_01XX.dat.

Every other platform keeps its current setfile. If the newer file is missing from an older firmware extraction (-ENOENT), the driver falls back once to the base setfile, so existing installs keep streaming.

Replaces #3900, trimmed to the platforms we measured.

Tested: K114s T6050 (7.3.0-k114sstack9) at c15fc56 pass: isp_2226_01XX.dat loaded, 40/40 1920x1080 NV12 frames, 0 firmware errors, stock module restored (zero-reboot module swap, silent, SELinux Enforcing, 0 failed units). ARM64 KUnit apple-isp* 62/62 pass with CONFIG_WERROR=y on the combined tree with the two follow-ups; ISP host tests 5/5 pass; checkpatch --strict clean.
Risk: two-way · J413 (0x0e) and K114s (0xba) only; other Macs load the same setfile as today.

Identical-scene numbers (K114s, same scene, stock vs this PR)

Night room scene, so absolute values move between runs; the direction is the same in all four runs.

run neutral_dev mean_dRG mean_dCb mean_dCr
1 2.72 -> 0.74 1.92 -> 0.53 1.42 -> 0.55 14.08 -> 2.27
2 1.85 -> 0.38 0.50 -> 0.20 0.58 -> 0.14 2.80 -> 0.55
3 (exact head) 2.09 -> 0.49 0.56 -> 0.28 1.51 -> 0.16 3.10 -> 0.77
4 (exact head) 1.10 -> 0.08 0.22 -> 0.29 2.75 -> 0.26 1.10 -> 0.49

J413 (0x0e): the replaced PR's head ea4d2987, with the same 0x0e selection, measured neutral_dev 3.69 -> 2.61 on the same kind of A/B.

Not yet

  • J413 exact-head row (the M2 Air was busy tonight).
  • J615 M3 Air (0x12) and other platforms stay on their current setfile until each has its own setfile-only row.

The driver loads the first setfile release for every sensor. On the M2
Air (platform 0x0e) and the M5 Pro (0xba) a later setfile release for
the same sensor gives a visibly more neutral picture in our own
identical-scene captures, so select it there by the platform ID the
device tree already provides:

- IMX558 on 0x0e: isp_1922_02XX.dat, with the temporal filter off like
  isp_1921_01XX.dat.
- IMX958 on 0xba: isp_2226_01XX.dat.

Other platforms keep their current setfile. If the newer file is missing
from an older firmware extraction (-ENOENT), fall back once to the base
setfile so existing installs keep streaming.

Add a KUnit test for the platform selection.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team as code owners December 2, 2026 12:10
@github-actions github-actions Bot added area:media Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at c15fc569: not ready yet

Check Detail
CI at head running running: apple-build, KUnit plan
Review ok approved by satchlj
Requested changes ok none
Hardware row at head ok in the PR body at c15fc569
Conflicts ok none
PR text ok Risk: two-way · J413 (0x0e) and K114s (0xba) only; other Macs load the same setfile as today.

Areas: area:media

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

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

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 c15fc56

Blockers:

  • CI at head c15fc569938a is still pending (host-tests in progress; apple-build, KUnit plan, and readiness queued). Ready to approve as soon as CI finishes green.

Checked:

  • Full 203-line diff across isp-drv.h, isp-cam.c, and isp-cam-test.c — no code blockers found.
  • Platform selection is scoped strictly to the measured platforms (0x0e -> ISP_IMX558_1922_02 on legacy ABI, 0xba -> ISP_IMX958_2226_01 on 0x958), leaving all other platforms on their existing setfiles.
  • -ENOENT fallback in isp_ch_load_setfile() cleanly falls back once to the base setfile (1922_02 -> 1921_01, 2226_01 -> 2224_01), checks setfile->size > isp->data_surf->size after fallback, and releases fw on -ENOSPC. (Non-blocking note: both fallback pairs currently share the same temporal_filter value, so isp_setfiles[fmt->id].temporal_filter matches either way; setting fmt->id = fb on fallback would keep it future-proof if a later pair ever differs.)
  • isp_test_setfile_platform_select covers legacy and H17 sensors plus non-matching platform IDs; exact-head K114s (c15fc569938a) hardware row with identical-scene A/B metrics and clean stock restore is in the PR body.
Evidence
  • Diff reviewed: aurora-silicon/linux#3928 @ c15fc569938a9d7a237b2d5a015c6f71dd95cdcb (3 files, +90/-12).
  • CI status checked: pr-text SUCCESS; host-tests IN_PROGRESS; apple-build, KUnit plan, readiness QUEUED.
  • Exact-head hardware row in PR body: K114s T6050 at c15fc569938a PASS (isp_2226_01XX.dat loaded, 40/40 1920x1080 NV12 frames, 0 firmware errors).

@github-actions github-actions Bot added the changes-requested A reviewer requested changes (bot) label Dec 2, 2026
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Local CI at c15fc569938a while the Actions apple-build and KUnit plan jobs are still queued:

  • arm64 KUnit apple-isp* (clang 22, CONFIG_WERROR=y, qemu): 60/60 pass, including the new isp_test_setfile_platform_select.
  • W=1 build of drivers/media/platform/apple/isp against the fleet94 tree: 0 new warnings vs main 0bc45c54 (main's one existing W=1 warning is the unused apple_isp_hw_t6040 in isp-drv.c, untouched here).
  • host-tests: green on Actions.

The hardware row in the body (K114s, exact head) stands.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J413 (M2 Air) hardware row for c15fc569938a9d7a237b2d5a015c6f71dd95cdcb on saved fleet94 with ISP 27.2.0. Built the ISP module from the PR head against the fleet94 build tree. GStreamer reached EOS for 12 requested 1920×1080 NV12 buffers and the driver logged a successful load of apple/isp_1922_02XX.dat. Restored the stock module on the same boot with SELinux Enforcing. The pre-existing plymouth-start.service failure was unchanged. This row verifies the variant selection and stream on J413. Controlled image validation remains separate.

@satchlj satchlj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Verdict: MERGE at c15fc56 (once queued Actions apple-build and KUnit finish green)

Full diff audited earlier with no code blockers; Actions host-tests is green, local arm64 KUnit (60/60) and W=1 build receipts are posted, and exact-head hardware rows now cover both measured platforms (K114s isp_2226_01XX.dat and J413 isp_1922_02XX.dat). Clearing the review gate now so merge can proceed as soon as the queued Actions build/KUnit jobs complete.

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Local PC qualification for c15fc569938a merged with main d5b9a4181c2e (tree e260f5494d02).

~/bin/aurora-build ./linux-build/build kernel --profile asahi linux-pc-edge-pr3943-5b22d796 -- -j8 W=1 drivers/media/platform/apple/isp/ passed and linked apple-isp.o. The only compiler diagnostic was the existing apple_isp_hw_t6040 unused-variable warning.

The J413 exact-head result confirms isp_1922_02XX.dat selection and a 12-buffer NV12 stream. Its report leaves controlled image validation separate, and the PR’s Not yet section still lists J413 validation. J413 report

@github-actions github-actions Bot removed changes-requested A reviewer requested changes (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 2, 2026
@DjDeveloperr
DjDeveloperr merged commit 0301027 into main Dec 2, 2026
8 of 11 checks passed
@DjDeveloperr
DjDeveloperr deleted the camera-all-v2/platform-setfiles branch December 2, 2026 16:20
@DjDeveloperr

Copy link
Copy Markdown
Contributor

Merged exact head c15fc569938a as 0301027a099b on main ef1185e6e852. Verified merge parents and tree fc06d579cb47.

  • The ISP directory is byte-identical to the 15:22 merge-tree build. The Arm64 LLVM W=1 build linked apple-isp.o with the existing unused apple_isp_hw_t6040 warning.
  • Arm64 ISP KUnit passed 60/60, including platform selection. Hosted host-tests passed.
  • The K114s and J413 exact-head runs confirmed the intended setfiles and NV12 streaming on both platforms.

Local build and KUnit receipts cover the queued hosted jobs under the 12-02 CI override.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:media Area from CODEOWNERS (bot) door:two-way Revertible or not, from Merge risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants