Skip to content

iOS 27 camera, display side: probe backboardd's read of the preview, note CoreAnimation's draw (diagnostics, draft) - #416

Merged
claudiusthebot merged 2 commits into
mainfrom
agent/camera-display/ycbcr-probe
Nov 27, 2026
Merged

claudiusthebot merged 2 commits into
mainfrom
agent/camera-display/ycbcr-probe

Conversation

@claudiusthebot

Copy link
Copy Markdown
Collaborator

Diagnostics only, all off by default (set in /var/local/mtl2-env). Built into StarbiteMetal and run on phone 1 on 24 Nov (boots D1-D7, kernel from main 72c0b59 + fork 4285c9c8, cam_trace=1 cam_metal=1).

What they measured

  • SWEET_MTL2_YCCPROBE=1: backboardd's fmt 500 (YCbCr8_420_2P) texture over the image queue sink's surfaces reads the picture on backboardd's own GPU in every mode tried. Compute read, linear and nearest samples, and half-precision fragment samples from slot 3 all give about RGB 59 60 59 (40/64 lit), matching the CPU's luma 59.
  • SWEET_MTL2_YCCFLAT=1 (test switch): binding a BGRA8 copy instead of the YCbCr texture leaves the viewfinder black. The YCbCr texture is not the cause.
  • SWEET_MTL2_DRAWNOTE=1 plus the pass log: steady frames draw the camera with TimgA3S1Xhfu_Ixrg into the pass's memoryless RGBA16Float colour 1 (colour 0 masked off). TimgBbcmA3Xhf_Isup / TbdsA3Xhf_Isup_Isrc then composite it. That path (memoryless attachment + framebuffer fetch on PanVK) is the next place to measure.

Not a fix. The viewfinder is still black. Kept as a draft: the parent decides whether to merge the tools.

tools/arch-size.allow: the frontend's allowance goes from 2767 to 2777 lines for the three hooks; the code itself is in new headers.

Checks run locally: provenance-check, arch-check --report, docs-check, drivers-check, metallib-test (all pass).

Details: docs/ios27/CAMERA.md, "The display side".

… preview, and note CoreAnimation's draw of it

Diagnostics in the Metal frontend, all off unless set in /var/local/mtl2-env:
- SWEET_MTL2_YCCPROBE=1 (YCbCrProbe.h/.metal): at bindings of a converted two-plane YCbCr
  texture (formats 500-510), read an 8x8 grid on the process's own GPU (compute read, linear
  and nearest samples; fragment-stage half samples from slot 3, linear and nearest) beside
  the processor's read of the surface.
- SWEET_MTL2_DRAWNOTE=1 (DrawNote.h): once per pipeline, the full state of a draw that
  samples such a texture (fragment function, attachments, blending, samplers, fragment
  bytes, first vertex floats).
- SWEET_MTL2_YCCFLAT=1: a test switch that binds a BGRA8 copy of such a texture instead.

Run on phone 1 (24 Nov, D1-D7): the texture reads the picture in every mode; with the
BGRA8 copy the viewfinder is still black. CoreAnimation draws the camera into a memoryless
color attachment (TimgA3S1Xhfu_Ixrg) and composites it later in the pass; that is the next
place to measure. docs/ios27/CAMERA.md, 'The display side'.

The frontend's size allowance goes from 2767 to 2777 lines for the three hooks.
@claudiusthebot

Copy link
Copy Markdown
Collaborator Author

Phone regression of current main, phone 2 (Galaxy S9, iOS 27.2.1), 28 Nov 2026 — PASS.

Built: scion-kernel main adbb15d6 (this PR and #398 #408 #416 #418 #419 #420 #421 #422 all in) + Scion-Project/xnu scion/xnu-12377 head f2f59dd (xnu#70), with the recipe of the previous phone runs (gpupass-1124 kbuild.sh, rc 0; kernel f36b080a), image = that kernel + the same loader and the boot line phone 2 already runs (no new boot-args): BOOT 0edca00b…, flash read back. Root: phone 2's own as found, nothing written to USERDATA.

boot SpringBoard Wi-Fi assoc BT (BlueTool / 0xfe3b) panic idle all-CPU (of 800) crashes big core
M1b 21 s after flash +8 s up / answered none 16 % chronod 1 42.1 C
M1c 21 s after flash +8 s up / answered none 17 % locationd 2, chronod 1 43.0 C

Home screen drawn on both (icons, widgets, dock, Wi-Fi + charging). Crash set = the earlier baselines' (locationd, chronod); no new crash loop. The S9's charger guard as before (sweetchg=2 sweetafc=1: the guard).

#421 (max77705_chg=) and #422 (sdcard=) are iOS 16.5 kernel drivers, off by default, and not in this iOS 27 kernel; #421 was not enabled (live charging tests need Dylan beside the phone); #422 not run on phone 2: no microSD card in it.

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