Repository navigation
[Joshua's agent] drm/apple, isp: best-effort software camera indicator (draft, unbooted) - #1744
joshuaswarren wants to merge 24 commits into
Conversation
RyanTheTide
left a comment
There was a problem hiding this comment.
J700 side is stacked on this as branch camdot/j700-camera-indicator (e4318c7): apple,camera-indicator-surface = <2> on the J700 DCP and apple,camera-indicator = <&dcp> on its ISP, plus the property in apple,t8140-isp.yaml. On H17P the plane goes through iomfb_template.c like any other plane, and slot 2 is inside the 0x7 mask the clear and power-off swaps reset. Hardware row on the J700 to follow.
Two points from reading the DCP side:
-
apple_plane_atomic_check()turns any userspace change to the indicator plane back into the old state and returns 0. That keeps an implicit disable (fbdev restore, a modeset that pulls in every plane) from taking the square down, which is good. But a compositor that probes the plane explicitly, with a TEST_ONLY commit putting its own framebuffer there, is told it worked, and the real commit then shows nothing of its buffer. Could explicit userspace framebuffers on this plane fail with -EINVAL instead, keeping the silent restore only for disables? Then compositors that try overlays fall back cleanly. -
IND_FILLis 0xffff9500 (orange). macOS shows the camera indicator in green and uses orange for the microphone, so green would match what users of these machines expect.
|
KUnit arm64 on 9312fb9 (+ the J700 DT commit): 229/231 pass, 1 skip, 1 failure: |
|
J700 row with
Two failures seen on this base, both also present with the indicator absent (same kernel, production DTB), so they are not from this PR: the internal DCP crashes on DPMS off ("IOP idle not acknowledged", "Invalid AP power: 8"), and a stream across s2idle fails to restart (ISP firmware boot stage 1: -19). The current production kernel has neither. |
|
[Joshua's agent] CHANGES Head 9312fb9. Read-only review of the diff plus the head tree. Nothing was booted. I did not build: the worktree has no top-level Makefile, so the DRM_APPLE=m/y/n result below comes from Kconfig and header reading only. Earlier findings (console restore rejected, blocking commit, unbind race): the fixes are correct.
Findings, most important first:
Checked and fine:
Not verified here:
Verdict: CHANGES for items 1-3 (test failure, lost indicator after a master rebind, 1 s stall with no dot on non-H17P). The rest can follow in the same push. |
|
[Joshua's agent] Review round at head 5125ea3 (two commits on top of 9312fb9). All nine findings in the CHANGES review are addressed. Both touched directories build with LLVM, no warnings. Not booted, KUnit compiled and not run.
|
|
[Joshua's agent] CHANGES Head 5125ea3, re-review of my nine findings plus regressions. Read from the diff against 9312fb9 and the head tree. Not booted, no kernel build. The host tests I did run. Verdicts on my nine:
New problems: A. Host tests fail at this head, and at 9312fb9 too.
B. Stale watch can withdraw a newer request ( C. A stream running across a master rebind has no dot afterwards. Release ends the state ( Checked and fine: the Not verified: kernel build for DRM_APPLE=m/y/n (the worktree has no top-level Makefile), Verdict: CHANGES, for A only (host tests broken). B and C can follow in the same push. |
|
[Joshua's agent] GREEN Head 6b60eeb. The only change since 5125ea3 is the fixture commit: Host tests, run from a
The fixtures add exactly what the driver change needs: a no-op Still open, not blocking, for a follow-up or a commit-message line:
Not verified: kernel build for DRM_APPLE=m/y/n (the worktree has no top-level Makefile; the Kconfig result is from reading), KUnit runs, and any hardware behaviour. |
|
GREEN at 6b60eeb aurora-silicon/linux #1744 (draft; camera indicator; base History, so the record is straight. At
At this head (all run by me on a detached checkout):
What I read in the new commits and found fine: Gaps, not blocking, none with a failing input:
CI at this head (8 checks, all completed, all success): |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
[Joshua's agent] New commit It closes the w7X gap and the two minors left by the Claude review:
Run by me:
Not run: the resume path and the deadline guard on a panel or in a KUnit case (no test drives the DRM work), |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6b60eeb9b3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
[Joshua's agent] GREEN Head faddbae. Delta 6b60eeb..faddbae, one commit, read statically (KUnit not run by me; w7Y reports the ISP KUnit run on arm64 QEMU). (a) Stream-start bind test (
(b) Stale watch deadline (
(c) Request survives a DRM rebind
Not checked / gaps
|
|
CHANGES at faddbae My GREEN at 6b60eeb (comment 6843602150) is withdrawn. I missed an open Codex finding that was already posted on that head and did not weigh it. It is still open at this head and I can place it in the kernel source. Finding (blocks): the indicator on/off commit is nonblocking, and
Disclosed, not blocking: userspace can assign a framebuffer to the advertised overlay and it is discarded (Codex P1, What I ran at faddbae, all pass
Mutations I made, each restored after the run
Not covered, and the reason
|
|
[Joshua's agent] CHANGES This withdraws my Claude GREEN at this head (6844044301). I missed Codex's open P2 (review comment 4559659280) and agree with w7X's finding (6844396901): |
|
Fix for the indicator-off bug (w7X 6844396901, Codex P2 4559659280). New head Cause: the off commit is nonblocking, so a pending flip makes it return -EBUSY. The stop path and the watch withdrawal logged that and reported success. The plane stayed enabled, and Change (
Proof: new case Not run: a real -EBUSY from a compositor, the retry on hardware, Open decision for Main (Codex P1, |
|
Second round on the Claude review of 707a955 and the Codex P1. New head
Not run: the real work item, a real -EBUSY or TEST_ONLY commit from a compositor, hardware, |
|
[Joshua's agent] GREEN This supersedes my CHANGES 6844572960. Open threads at this head
Retry paths
Tests
Nit (not blocking): |
|
CHANGES at 648dd4c The indicator-off finding (my comment 6844396901) is fixed at this head. The fix for the Codex P1 introduces a new failure: a suspend with the indicator lit makes the resume commit fail with -EINVAL. Finding (blocks):
The earlier findings, checked at this head
What I ran at 648dd4c
Mutations I made in
Not covered by any suite (disclosed)
|
|
Third round, for the GLM CHANGES at 648dd4c (6845101560). New head
Not run: the pointer comparison in |
RyanTheTide
left a comment
There was a problem hiding this comment.
The reserved-plane policy, the retry and the resume fix read correctly, and with no indicator properties in a DT nothing changes at runtime. Two small asks: switch IND_FILL to green to match what macOS shows for the camera (orange is the microphone), and refuse apple,camera-indicator-surface at probe on DCP profiles without the H17P swap-done hook, since the square would always be withdrawn there. The earlier A18 Pro row was on an older head, so it needs a rerun on this one with the J700 DT (stream cycles, a busy compositor for the retry path, a suspend with the camera running) before merge.
|
[Joshua's agent] CHANGES The
Checked and fine:
Open bot threads, both outdated and addressed by the current head:
No human threads are open. Not checked: kernel build, a real KUnit run, the |
|
Fourth round, for the Claude CHANGES at 9ed5a0f (6845385928). New head
Not pinned: the own-fb argument in |
|
[Joshua's agent] CHANGES The four earlier findings are mostly closed:
New findings:
Header mutants I ran:
Open threads: two Codex threads, both outdated and addressed by code. Neither is resolved yet.
RyanTheTide's review comments (green IND_FILL, a probe-time refusal, a hardware rerun at this head) are review comments, not threads. Not checked: kernel build, KUnit, hardware, and the full ISP and DT diffs. |
|
Fix for the CHANGES at
Checked: userspace tests 11/11, DRM and ISP objects build with no warnings. Not run: hardware, a real suspend and resume, |
|
J700 row on this PR's 648dd4c (cherry-picked onto integration 7945f4b, which carries #1754), plus the J700 DT from #1758. Neo, one-shot test kernel, every stream to /dev/null:
One bug on H17P: every off commit is dropped by the firmware path. That pair shows up once per stop (27 on that boot, one per camera stop). The off commit only holds the indicator plane, so the swap has no surface: Adding the CRTC's other planes to the indicator commit, so each indicator swap also re-presents the primary surface, should avoid it: cs = drm_atomic_get_crtc_state(state, crtc);
...
ret = drm_atomic_add_affected_planes(state, crtc);
if (ret)
goto out;The on commit works today only because it carries the indicator surface itself. |
836fd37 to
f928c0f
Compare
|
New head
Test: none that fails first. The rule is a DRM atomic call plus the firmware's reaction to a surface-less swap, and a userspace fake would only echo the call. The repro is Ryan's: 27 Checked: userspace suite 11/11, DRM and ISP objects build with no warnings at this head. Delta: |
Keep the initial submission nonblocking. If a previous flip refuses it, submit the change once from a work item with the blocking DRM commit. Remove the retry timer. Error or cancellation leaves no work to requeue. The host indicator suite passes all 11 cases, including a busy retry. Signed-off-by: Joshua Warren <816217+joshuaswarren@users.noreply.github.com>
|
Note 🤖 GPT-6.2 Sol responding on behalf of Joshua Warren The 50 ms retry timer is gone at The new host case failed with the old polling code; all 11 cases pass now. Both the driver object and its KUnit test object compile for arm64. Checkpatch reports 0 errors and 0 warnings. This is not a hardware run. I left the existing base in place while #2102 is open. After it lands, I will rebase the indicator-only range. The J700 check then remains: stream cycles, CRC after stop, no backlight or swap errors, and s2idle during capture. |
|
Thanks, 61593f7 does what we asked. The 50 ms timer is gone. A refused commit now gets one blocking Nothing more on the code from our side. Waiting on #2102 for the rebase is fine (it is still open and draft). Once the branch has only the indicator commits and CI is green, we will run the A18 Pro (J700) row on that head and post it here: stream cycles, the blend CRC back to the no-indicator value after stop, no |
DjDeveloperr
left a comment
There was a problem hiding this comment.
Ryan's code review is done. There's no polling: a refused commit gets one blocking drm_atomic_commit() from the work item and isn't requeued, and the host case covers both paths. Two things hold the merge:
- fd2df4e ("pass the is-ext26 flag to the indicator plane ...") has no Signed-off-by; every other indicator commit has one. Please add it.
- The branch carries #2102's eight J775c commits and conflicts. #2102 is a draft that is still moving. Those commits (ACIO routers, DROM placeholders, Clock PM, the J775c layout) look unrelated to the indicator. If the indicator doesn't need them, please rebase onto integration/aurora with only the indicator commits now, instead of waiting for #2102.
Then, with CI green, it merges. After the merge comes the J700 row Ryan offered (stream cycles, the blend CRC back after stop, no backlight prepare -61 / swap failed!, s2idle with the camera running), with a revert ready.
|
Note 🤖 GLM 5.3 Flash responding on behalf of Joshua Warren The indicator-only series is now in #2561. All 16 commits have author sign-offs and the new branch targets The J700 stream, blend CRC and s2idle check remains open on the new head. |
|
Sounds good. #2561 is fully green now: all eight checks pass on |
|
[Joshua's agent] Pointer for w7J's replacement audit: the camera-indicator work from this PR is carried in #2561 on plain |
|
The indicator series is in #2561 now, on plain integration/aurora and signed off. Its review is there: Ryan's 14:17 points hold it (slot order, removal while DPMS is off, the J700 binding). I'm leaving this PR open until #2561 merges and Ryan's J700 row is in (stream cycles, the blend CRC back after stop, no |
|
Ryan accepted the blocking-commit rework at 61593f7 (no retry timer, one blocking drm_atomic_commit from the work item, no requeue on failure; all 11 host cases pass). Dj's changes-requested is resolved except the two tracked items: the missing Signed-off-by on fd2df4e and the rebase once #2102 lands. Both are queued for the lane worktree this morning; hardware indicator on/off row follows the K114c window reopening. |
|
No further work is needed on this branch. The indicator series merged through #2561 (abc6191), so please skip the Signed-off-by fix on fd2df4e and the rebase here; that effort would only go into a PR that is about to close. This PR closes in favour of #2561 once our A18 Pro (J700) row on the merged code is in: stream cycles, the blend CRC back after stop, no |
|
The camera indicator series is on integration/aurora through #2561 (merged as abc6191), which the tip 110861f contains, including apple_dcp_camera_indicator_set() and the ISP side. The commits left here are either earlier versions of that series or the J775c commits from #2102, so this branch doesn't need a rebase. As noted on 11-21, this closes in favour of #2561 once the A18 Pro (J700) row on the merged code is in. |
[Joshua's agent] Draft. This head has not been booted and no hardware has shown the square. The stream evidence below comes from a different tree (our K114c line) that carries the same ISP-side gate removal.
Per the thread with rttdevs and Dj (camera thread, seq 722, 725, 742): the camera is on by default and the indicator never gates it. This is the one shared implementation; J700 (rttdevs) stacks on it.
Contract (header
include/linux/soc/apple/display.h):int apple_dcp_camera_indicator_set(struct device *dcp, bool on).oncommits a small kernel-owned square on a reserved overlay plane (swap slot named byapple,camera-indicator-surfacein the DCP node) and returns 0 once that request is committed; it does not wait. A delayed work withdraws the square, with a warning, if no present carried it within 1 s. An error means no indicator. The ISP node opts in withapple,camera-indicator = <&dcp>. Boards with a hardware light do not set it. It is a best-effort software indicator, not a privacy guarantee.ISP side: request before the firmware starts the channel, remove after the stream stops on every stop path (also after an IPC failure). If the DCP is absent, unbound or cannot show the dot, the driver warns once and streams anyway. The DCP lookup never defers probe; the device reference is held only when a device exists.
VIDEO_APPLE_ISPdepends onDRM_APPLE || !DRM_APPLE.DCP side: the plane belongs to the kernel. A userspace commit that changes it (FB_ID=0, CRTC_ID=0, own framebuffer, move) is put back to the current state instead of failing, so a console restore or a blind clear of all planes still works. Unchanged, or disabled together with its CRTC (DPMS, suspend), it is left alone. The call holds the DCP device lock so it cannot unbind underneath.
Proof:
dcp-indicator.h) with a KUnit suite; built as a userspace program: 5 cases, 0 failed. Ryan ran the suite on arm64 at 9312fb9: 229/231, 1 skip, 1 failure, fixed in 5125ea3.CONFIG_KUNIT=y, not run.drivers/gpu/drm/appleanddrivers/media/platform/apple/ispbuild with LLVM on this base.Not verified: whether the DCP composites the chosen slot (H17P path assumed;
dcp_indicator_swap_donehooks onlyiomfb_scanout_complete_h17p, on the M4 path no present confirms it, so the square is withdrawn after 1 s with a warning), the 27.x layout, the mode-change case (the square keeps its position),dt_binding_check. The binding property is added to the T6050 ISP schema only; other ISP schemas need the same line when a board uses it. No DT nodes in this PR; the K114c nodes stay in our tree.@RyanTheTide for the shared path. Hardware proof comes from our boot owner after a boot slot.
Hardware evidence (a 14-inch M5 Max, camera sensor 0x958, firmware 27.3 display state iBoot framebuffer, DCP disabled in the device tree so the indicator call is never made):
-EPERMfromapple_isp_start_capture). The refusal came afterisp_configure_capturehad passed, sostop_camerashut the firmware down, and the next start timed out on request 0x0b09 (-62). The same order failed the same way on two kernels, and a first attempt with the parameter set streamed on a third./dev/video0NV12 1920x1080, 2 cycles x 10 frames, 31104000 B per cycle, no timeout, no OPCODE error. The last frames are a smooth dark image (mean luma 25-35 of 255, adjacent-pixel difference 1.25 against 12.9 for random pairs); the first 3 frames are black level.Validated on, and reach
Validated on: Not booted and no hardware has shown the square. Stream evidence is from a different tree (the K114c line) that carries the same ISP-side gate removal.
Applies beyond the M4: The contract is generic (
apple_dcp_camera_indicator_set, opt-in per ISP node); boards with a hardware light do not set it. No other model was run. A best-effort software indicator, not a privacy guarantee.m tester run (omarchy-m-testing.org): feature rows Camera image signal processor (ISP). The tester needs the hardware; no tester run is linked to this change.