Repository navigation
media: apple: isp: query per-module lens shading calibration from sensor NVM - #3901
RyanTheTide wants to merge 2 commits into
Conversation
…sor NVM Add IPC commands and caching for per-module lens shading calibration stored in the camera module's NVM: - Add isp_cmd_send_data() to send commands whose payload exceeds the IPC command area over isp->data_surf. - Implement CISP_CMD_CH_SENSOR_PERMODULE_LSC_INFO_GET (0x0507) and CISP_CMD_CH_SENSOR_PERMODULE_LSC_GRID_GET (0x0511) for both legacy (0x10/0xb0 header, 8-bit grid) and H17 (0x14/0x114 header, 8..16-bit grid) firmware ABIs, caching the validated grid during sensor detection. - Implement CISP_CMD_CH_LSC_IDEAL_PCT_SET (0x0a4e) and send the sensor's target corner illumination percentage before loading the setfile. Add KUnit wire-layout tests covering both legacy and H17 ABI command sizes and reply parsing.
|
Merge readiness at
Areas: Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
Return READ_ONCE(isp->ipc_error) from isp_ch_cache_permodule_lsc() when a query fails due to a poisoned IPC transport (e.g. timeout), while keeping missing/unpopulated NVM responses non-fatal. Free any prior cached buffer via devm_kfree() before re-querying.
satchlj
left a comment
There was a problem hiding this comment.
Verdict: FINISH, then merge at 8b5758f345c1
Blockers:
- CI still pending at
8b5758f345c1:apple-build,host-tests, andKUnit planare still queued (pr-readiness:CI at head: running). Code and exact-head J713 hardware row look ready to approve as soon as CI finishes green.
Checked: Audited isp-drv.h, isp-cmd.h, isp-cmd.c, isp-cam.c, and isp-cam-test.c. isp_cmd_send_data() checks READ_ONCE(isp->ipc_error) and isp->data_surf->size bounds, and is only called during isp_ch_cache_sensor_info() (before isp_ch_load_setfile() uses data_surf). isp_cmd_ch_sensor_lsc_info_get() validates legacy (0x10) and H17 (0x14) wire layouts (num_x/num_y bounds, bit_depth in 8..16, data_size upper and lower bounds); isp_cmd_ch_sensor_lsc_grid_get() checks valid and duplicates into devm_kmemdup() while isp_ch_cache_permodule_lsc() frees any prior lsc->data via devm_kfree() and propagates READ_ONCE(isp->ipc_error) on transport poisoning. isp_cmd_ch_lsc_ideal_pct_set() sends via isp->cmd_virt without clobbering data_surf. Exact-head J713 M4 Air hardware row and ARM64 KUnit 54/54 PASS (isp_test_permodule_lsc_wire) are present at 8b5758f345c1.
Evidence
- Checked
isp_ch_cache_sensor_info()callers: only called once forisp->current_ch, matching the singleisp->lscslot. - Checked
isp_cmd_ch_lsc_ideal_pct_set()placement inisp_ch_load_setfile(): usesCISP_SEND_INonisp->cmd_virt, leavingisp->data_surf->virtintact, and any IPC error is caught immediately on the followingisp_cmd_ch_set_file_load(). - Pending checks on
8b5758f345c1:apple-build,host-tests,KUnit plan(queued).
|
Local CI run (hosted CI is still queued): host-tests fail at What fails: On the same main, these jobs pass: main alone, 31/31 in the Other checks on the same merge:
Also, this PR and #3900 conflict textually. In |
|
Replaced by #3929 (same work, cleaned up: Signed-off-by on every commit, host-test fix, values limited to what our own measurements support). Closing this one. |
Replaced by #3929 (same work, cleaned up: Signed-off-by on every commit, host-test fix, values limited to what our own measurements support). Closing this one.