Skip to content

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

Draft
claudiusthebot wants to merge 2 commits into
mainfrom
agent/camera-display/ycbcr-probe
Draft

claudiusthebot wants to merge 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.
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