Skip to content

media: apple: isp: Power the T8140 ISP down between streams - #1580

Merged
RyanTheTide merged 3 commits into
integration/aurorafrom
aurora-isp/t8140-stream-power
Nov 11, 2026
Merged

RyanTheTide merged 3 commits into
integration/aurorafrom
aurora-isp/t8140-stream-power

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

T8140 kept its ISP firmware resident, so the ISP domains stayed on from boot to shutdown even when nothing used the camera. Its firmware turns out to start again the way T8132's does (quiesce the coprocessor, STOP + POWER_DOWN, restore the data segment), so this switches T8140 to the T8132 model and powers the ISP down between streams.

Changes:

  • dt-bindings: two camera sensor domains after CVM, and up to three memory regions (heap, then the firmware text and data the bootloader loaded).
  • t8140.dtsi: the first ISP DART gets its address filter registers (dapf at +0x10000, as on T8132). ISPSENS0/1 join the ISP's power domains, so they are on only while the firmware runs.
  • apple-isp: T8140 uses fw_restore + deferred_start with the coprocessor status/quiesce registers. The DART address filter windows are programmed after each power-up, because the DART sits in the ISP system domain. The bootloader-provided heap is copied at probe and restored along with the data segment. When no region is named data, the driver takes the one that ends where the heap starts, which is how the bootloader lists the segments today.
  • The firmware stays up for 2 s after a stream before it stops, so an application that reopens the camera right away doesn't pay for another firmware start. System sleep, hibernation, shutdown and unbind stop it immediately. The idle stop runs on system_unbound_wq because the stop path flushes the driver's own workqueue.
  • A device tree without the dapf registers or a data segment keeps the firmware resident, as before. The kernel can therefore land before the Stage 2 DTB update.

Tested on J700 (Neo). The test kernel was fleet65 (716670b) plus these commits. The Stage 2 trial image was the live one with only its DTB swapped for the one from this branch.

before (resident) after
ISP domains + ISPSENS at idle 14 on (Pearl off by firmware), ISPSENS off all off, runtime suspended
ISPSENS0/1 never on on only while streaming
ISP rails at idle (SMC PP2b / PPab) 84-97 / 51-72 mW 20-22 / 28-36 mW
first frame, camera closed > 2 s 201-206 ms 623-646 ms
first frame, reopened within 2 s 201-206 ms 202-208 ms
20 start/stop cycles, back to back 20/20 20/20
20 start/stop cycles with the ISP off in between n/a 20/20
150 frames at 30 / 15 fps 30.12 / 15.03 fps, 0 dropped 30.13 / 15.03 fps, 0 dropped
s2idle, camera idle / after a stream 3/3 / 3/3 3/3 / 3/3, stream works after resume
ISP errors, DART faults, AVCs 0 0

Total system power at idle moved by less than the boot-to-boot spread (4.2-4.4 W on either side), so only the ISP rails are listed. Frame statistics match the resident driver (Y mean 16.8 vs 16.9 in a dark room). Booting the same kernel with the old DTB logs the resident fallback, and its rows match fleet64.

Build gates on the buildbox: ISP KUnit 39/39 (arm64 QEMU), host tests 224/224, W=1 clean for the changed files (the two remaining warnings come from isp-ipc.c, which this doesn't touch), checkpatch --strict clean, dt_binding_check clean for apple,t8140-isp and apple,dart, CHECK_DTBS on the T8140/T8142 DTBs reports the same warnings as the base.

🤖 Generated with Claude Code

…segments

The two camera sensor power domains follow the ISP CVM domain, as on
T8132. The boot loader lists the firmware text and data segments it
loaded after the heap region, so allow up to three memory regions.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
…domains

The first ISP DART has its address filter registers at +0x10000, as on
T8132; the ISP driver programs them after each power-up. ISPSENS0 and
ISPSENS1 power the camera sensor and belong to the ISP: list them with
its other domains so they are on only while the ISP is.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
T8140 runs the coprocessor and firmware interface that T8132 runs, and
its firmware starts again the same way: from its data segment as
loaded, after the coprocessor was quiesced before the power-down, with
STOP and POWER_DOWN instead of SUSPEND. Until now T8140 kept its
firmware resident, so the ISP domains stayed on from boot to shutdown,
also when no application used the camera.

Use T8132's model on T8140: start the firmware at the first stream,
stop it and power the ISP down after the camera is no longer used, and
put the data segment back before each start. The bootloader also
provides the firmware's heap memory on T8140; keep a copy of it and put
it back too. The first ISP DART loses its address filter with the ISP
system domain, so program the windows the bootloader set after each
power-up.

A firmware start costs about 430 ms before the first frame. Keep the
firmware up for 2 s after a stream, so that an application that stops
and starts the stream again, or opens the camera again soon, gets its
first frame as fast as before; stop it at once for system sleep,
hibernation, shutdown and unbind.

The bootloader lists the firmware segments without names. Where no
region is named "data", take the one that ends where the heap starts.
A device tree without the address filter registers or the data segment
keeps the firmware resident, as before.

Assisted-by: LLM
Signed-off-by: Ryan Murray <[email protected]>
@RyanTheTide
RyanTheTide merged commit d78fb26 into integration/aurora Nov 11, 2026
2 checks passed
@RyanTheTide
RyanTheTide deleted the aurora-isp/t8140-stream-power branch November 11, 2026 19:07
DjDeveloperr added a commit that referenced this pull request Nov 12, 2026
Nine conflicts:
- media: apple: isp: T8140 keeps this series' firmware model, the one
  the sleep stack was validated with: resident, stopped with each stream
  and started again from its own memory, run bit kept for the DRAM-kept
  wake. #1580's T8132-style model (quiesce, data and heap restore, ISP
  driver DAPF writes, 2 s idle) stays available to other chips; T8140
  doesn't select it. Suspend stops resident firmware and flushes idling
  firmware; probe sets up both work items.
- arm64: dts: apple: t8140: the ISP's sensor domains stay after FE, as
  this series has them, not appended a second time; the first ISP DART
  keeps its tunables and address filter ranges. The binding and its
  example list them once, and accept #1580's firmware segment regions.
- dt-bindings: mailbox: both new entries, the secure RTBuddy proxy and
  the later AOP setup-port mailboxes.
- dmaengine: apple-admac: a resume whose registers were lost restarts
  from the last reclaimed period; otherwise integration's capture
  realign, otherwise a plain restart.
- soc: apple: aop: every configuration has both the sleep and wake
  endpoint orders and the setup-port EPMAP fields; T8152 and T8142 take
  the endpoint order, as the other chips do.
- drm/asahi: both g17/sleep.o and g17/pmpdash.o, and both the warm
  restart and the log buffer hand-over.

Integration's new T8142 GPU configuration takes this series'
sleep_restart as false, as every SoC but T8140 does.

Signed-off-by: Diljit Singh <[email protected]>
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.

1 participant