Skip to content

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

Closed
RyanTheTide wants to merge 1 commit into
mainfrom
camera-all/platform-setfiles
Closed

RyanTheTide wants to merge 1 commit into
mainfrom
camera-all/platform-setfiles

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Replaced by #3928 (same work, cleaned up: Signed-off-by on every commit, host-test fix, values limited to what our own measurements support). Closing this one.

Select platform-specific ISP sensor tuning setfiles using the platform ID
from the device tree rather than defaulting every board to the earliest
setfile variant for a sensor:

- IMX558 (legacy ABI): select isp_1922_02XX.dat on platforms 0x0e, 0x0f,
  and 0x12 (with temporal filter off), keeping isp_1921_01XX.dat on older
  platforms and isp_1925_03XX.dat on H17.
- IMX958: add isp_2226_01XX.dat (platforms 0xb9..0xbc) and
  isp_2226_02XX.dat (platforms 0x78, 0x85, 0x86), keeping
  isp_2224_01XX.dat for earlier platforms.
- IMX364: select isp_8723_01XX.dat on platform 0x0a.
- IMX248: select isp_1822_02XX.dat on platform 0x06.

If a platform-specific setfile is absent from an older firmware extraction
on disk (-ENOENT), fall back once to the base sensor setfile so existing
installations keep streaming.

Add a KUnit test covering platform-ID setfile selection across legacy and
H17 firmware ABIs.
@RyanTheTide
RyanTheTide requested review from a team as code owners December 2, 2026 08:44
@github-actions github-actions Bot added area:media Area from CODEOWNERS (bot) ci-failing A check failed at the PR head (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Dec 2, 2026
@github-actions

github-actions Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

Merge readiness at ea4d2987: not ready yet

Check Detail
CI at head no failing: pr-text / pr-text
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes no review verdict FINISH at ea4d2987
Hardware row at head ok in the PR body at ea4d2987
Conflicts ok not computed yet
PR text ok Risk: two-way · Macs with Apple ISP front cameras (J413, J615, J713, J616s, J700, K114s)
Hold no labelled hold by a maintainer

Areas: area:media

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

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Additional exact-head hardware row at ea4d298798263d on J413 M2 Air (T8112, 7.3.0-aurora-fleet94, IMX558, platform 0x0e):

  • Selected and loaded apple/isp_1922_02XX.dat (0xad40 bytes), 40/40 1920x1080 NV12 frames, 0 new firmware errors, stock module restored, SELinux Enforcing.
  • Identical-scene A/B vs stock isp_1921_01XX.dat: centre neutral_dev 3.69 -> 2.61 (-29.3%), full-frame Cr 127.24 -> 127.97.

@github-actions github-actions Bot added door:two-way Revertible or not, from Merge risk (bot) and removed needs-hw-row No hardware row at the PR head (bot) needs-template PR body lacks Tested or Risk (bot) labels Dec 2, 2026

@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 ea4d29879826

Blockers:

  1. CI still pending at ea4d29879826: apple-build, host-tests, and KUnit plan are still queued (and pr-readiness still reflects the earlier failed pr-text run before the body edit). Code and exact-head hardware rows look ready to approve as soon as CI completes green.

Checked: Audited isp-drv.h, isp-cam.c, and isp-cam-test.c. Selecting platform-specific setfiles via device-tree apple,platform-id (IMX558 1922_02, IMX958 2226_01/2226_02, IMX364 8723_01, IMX248 1822_02) with a single -ENOENT fallback to the base sensor setfile is clean: every fallback pair shares identical temporal_filter and snf_centre_dy, the data_surf->size check is moved after fallback with proper release_firmware(fw) on -ENOSPC, and isp_ch_load_setfile() consistently uses the local setfile pointer throughout. Exact-head hardware rows at ea4d29879826 are present on K114s M5 Pro, J713 M4 Air, and J413 M2 Air (#issuecomment-7341434846) alongside ARM64 KUnit 54/54 PASS.

Evidence
  • Checked every field of isp_setfiles[] used after isp_ch_load_setfile() fallback (path, file_size, size, magic, snf_centre_dy, temporal_filter): all fallback targets match the variant's temporal_filter and snf_centre_dy.
  • KUnit isp_test_setfile_platform_select covers all 14 legacy and H17 platform mappings.
  • Pending checks on ea4d29879826: apple-build, host-tests, KUnit plan (queued).

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

Copy link
Copy Markdown
Contributor

Local CI receipt (hosted CI still queued): ea4d29879826 merged with current main 105e3fbc6adc (merge tree 58844fd99352) passes the build, KUnit and host-tests. checkpatch reports one error: the commit has no Signed-off-by.

Check Command Result
apple-build (Apple media dir) arm64 defconfig + merge_config.sh -m asahi.config + olddefconfig, LLVM=1, Rust; make W=1 modules_prepare drivers/media/platform/apple/ pass. The one W=1 warning in isp/ is also on main (isp-drv.c:1343 unused apple_isp_hw_t6040), so nothing new
KUnit plan scripts/ci/apple-kunit.py maps drivers/media/platform/apple/isp/ to the isp suite isp
KUnit isp, arm64 build kunit.py build --arch=arm64 --make_options LLVM=1 --kunitconfig=drivers/media/platform/apple/isp builds, 0 warnings
KUnit isp, run the same suite on UML, because our build hosts don't use QEMU: kunit.py run --make_options LLVM=1 --kunitconfig=drivers/media/platform/apple/isp --kconfig_add CONFIG_WERROR=n 58/60. isp_test_setfile_platform_select passes. The 2 failures are isp_test_dapf_program and isp_test_dapf_program_t6050, which fail the same way on main under UML (57/59): UML drops MMIO writes to the test's kmalloc'd register bank. This PR doesn't touch those tests
host-tests run-host-tests.py --jobs 8 in a container with the workflow's pins (Ubuntu 24.04, clang 18, gcc 13, rust 1.96.0, Python 3.14), --network=none full suite 952/952; --only isp 31/31
checkpatch scripts/checkpatch.pl --strict 0 warnings, 0 checks. 1 error: Missing Signed-off-by: line(s). Adding the trailer is text-only, so these results carry over to the same tree

This PR and #3901 conflict textually. In isp_ch_load_setfile() in isp-cam.c, both PRs change the declarations at the top of the function. In isp-cam-test.c, both add a test function and a KUNIT_CASE at the same spot. Keeping both sides builds, and the tests pass (details on #3902). Whichever PR merges second needs a rebase.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Replaced by #3928 (same work, cleaned up: Signed-off-by on every commit, host-test fix, values limited to what our own measurements support). Closing this one.

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) changes-requested A reviewer requested changes (bot) ci-failing A check failed at the PR head (bot) door:two-way Revertible or not, from Merge risk (bot) hold Held on purpose; skipped by the PR digest needs-review No approving review from Core or Omarchy Mac yet (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants