Skip to content

iOS 27 camera, display side: the memoryless fetch is right; the preview reaches backboardd's framebuffer and goes to the display as its own layer (diagnostics) - #418

Merged
claudiusthebot merged 1 commit into
mainfrom
agent/fbfetch/memoryless-fetch
Nov 27, 2026
Merged

claudiusthebot merged 1 commit into
mainfrom
agent/fbfetch/memoryless-fetch

Conversation

@claudiusthebot

Copy link
Copy Markdown
Collaborator

Builds on #416 (its two commits are under this one). Diagnostics only, all off unless set in /var/local/mtl2-env. Draft: nothing here fixes the viewfinder; it moves the search out of the Metal layer.

Measured on phone 1 (iOS 27.2.1, kernel k1 + cam_trace=1 cam_metal=1, root as handed back + this StarbiteMetal), 24 November:

  • SWEET_MTL2_FBPROBE=1: framebuffer fetch through a memoryless RGBA16Float color 1 (written by a draw with color 0 masked off, then read by [[color(1)]] into color 0) is exact on PanVK/Mali-G72 (B G R 191 128 64). Private color 1, two attachments, clear + fetch, and self-fetch of color 0 are right too. Mechanism: metal2vulkan's input attachments with VK_EXT_rasterization_order_attachment_access (PanVK v6 has it through mesa26-panvk-ios.patch), lowered to LD_TILE from the tile buffer.
  • SWEET_MTL2_FBPROBE=2: in a camera session the 828x1702 main pass's color 1, made a stored private texture, is empty in all 20 reads. The S1 draws into color 1 belong to the flip animation, not steady frames. The _Isup inputs are a sampled backdrop texture, not color 1.
  • SWEET_MTL2_FBPROBE=3: the steady preview draw (TimgA3Xhf_Ixrg, format 500 texture over the sink's surfaces) puts the picture into backboardd's framebuffer surface (viewfinder RGB 16-21, 10-17 of 64 lit; sink luma mean 21 in that dim room). The screen at the same moment is 0 over the viewfinder.
  • The kernel framebuffer logged layer 2 surface 284 at 0,0 828x1702: surface 284 is a 420f sink surface. backboardd hands the preview to the display as its own layer. SwapEnd (SweetFramebuffer.cpp in the xnu fork) copies and blends 4-byte BGRA layers only (read in the code).

Next: the display path (what SwapEnd gets for the preview layer, and a YCbCr layer there), not the Metal layer. The .mm edits keep it at its size allowance. The last refactor (FetchProbe.h included from DrawNote.h, the constants read through the existing property) was built but not booted; the logic booted as builds F1-F5. Notes: ~/s9/agents/fbfetch-1124/NOTES.md on the mini.

@claudiusthebot
claudiusthebot marked this pull request as ready for review November 27, 2026 11:26
…ttachment is right on PanVK; the steady preview is drawn into backboardd's framebuffer and handed to the display as a layer of its own

FetchProbe.h/.metal (SWEET_MTL2_FBPROBE=1/2/3, off by default): a self-test of a draw that writes a memoryless RGBA16Float color 1
read back by framebuffer fetch (right on phone 1), a stored shadow of the main pass's color 1 during a camera session (empty on
steady frames), and a read of color 0's surface after the steady camera draw (holds the picture). DrawNote.h modes 2 and 3.
docs/ios27/CAMERA.md: the measurements, and the display layer (SweetFramebuffer SwapEnd) as the next place.
@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.

@claudiusthebot

Copy link
Copy Markdown
Collaborator Author

Camera follow-up on the display side (phone 1, 28 Nov 2026). Current main (kernel f36b080a, which includes xnu#70) with cam_trace=1 cam_metal=1 shows a viewfinder that is no longer black. The preview is composited: the rear sensor's noise was visible with the camera UI over it, on 2 boots, with no GPU buffer refusals and no backboardd crash.

Still open:

  • cameracaptured idles at about 100 % of a core with cam_metal=1.
  • The big cores reach 82-83 C within about 10 s of opening the camera.
  • One USB console wedge happened during a screenshot while the camera was open.

Details are on Scion-Project/xnu#70 and in the mini's agents/p1-1128/NOTES.md.

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