Repository navigation
drm/apple: enable J613 panel brightness control - #312
Conversation
The J613 board record does not admit panel nits, so the working 14.7 display session never registers a backlight device. Admit the J613 to the existing nits path and keep the firmware UUID and display handoff checks. J615 and J514C remain excluded. Run the existing swap-level KUnit case for J613 as well as T6030. Expose the existing completion and refusal counters in debugfs so a requested level can be distinguished from one the firmware accepted. On a 13-inch M3 MacBook Air with 23J220 DCP firmware, the driver registered apple-panel-bl and completed requests for 100, 250, 400, 1, 500 and 140 nits with no refusals or display failures. The user confirmed visible brightness changes in person. Assisted-by: OpenAI Codex (gpt-6.1-sol) Signed-off-by: DjDeveloperr <[email protected]>
scottjones
left a comment
There was a problem hiding this comment.
We read this at eec6458 and ran it on a J613 (13-inch M3 Air, firmware UUID 90F849E1-B422-367E-B389-50246F8DEC47, DCP interface 14.7), using our own full kernel build of this head, clang 22, with that Mac's config.
It does what it says, and the gates hold. The UUID and apple,t8122-handoff checks at iomfb_v14_7.c:1731-1738 aren't changed and run before panel_nits is set at :1767. J615 shares the J613 UUID, but its board record has no panel_nits, and dcp_v14_panel_nits_admit() needs both the record and the apple,j613 machine, so it stays out. So does J514C. The new KUnit lines check J615 against the J613 record too. The J613 DT asks for 525 nits, and the wire bound keeps the maximum at 500.
What we ran: one job on stock and three on this head (two were reruns, to fix our DPMS call and to finish before Omarchy's 5-minute idle lock), plus a stock control.
- Stock (7.2.11-10-1): no
apple-panel-bl, as you describe. About 4.2 W with the panel on. - Range:
max_brightness500. 0, 1, 2, 3, 50 and so on up to 498, 499 and 500 all reachedactual_brightnessby our second read, 100 ms after the write. 501 was rejected. Refused stayed 0 throughout, and the new debugfs line showed presents counting up. - Light, indirectly: on the first sweep, before the idle screensaver started, Total System Power followed the level both ways: 2.15 W at 1 nit, 3.41 W at 100, 5.24 W at 250, 8.55 W at 500, then 7.21, 5.29, 3.40 and 2.19 W back down. Later readings were noisier. Firmware logged
brightness_changedwith the requested values (1 to 500 across jobs), with dbv going from 223 to 54492. It stopped after the same 9 lines in every boot, which looks like a log budget. We also tried it by hand on this Air: the brightness keys visibly change the panel, and all the way down is almost off rather than fully off, the same as our M2 Max. - DPMS: you listed a hardware cycle as not validated. Three real cycles through Hyprland: connector Off, firmware at value 0, power about 2 W, back On. Levels set while off (300, 400) read 0 until wake, then applied, and power on wake fits the sweep.
pm_test=devices: two runs kept the level, and later levels completed. The firmware log shows 0 and back in the run where it was still logging. That covers the driver's sleep callbacks but not s2idle. We didn't run J615 or an unbind.- Real suspend, by hand: we suspended from the menu and woke it twice, s2idle, for 14 s and about 2 s (
success2,fail0). Afterwards the keys still worked, and the second time we checked the panel came back at the same visible brightness. Level and actual matched, refused was 0, and no DCP or backlight errors were logged. That's two short sleeps on one Mac. - DCP errors: none new. The 4 early-boot firmware lines (
read_pmu_data_sync,create_default_fb_surfaceand two others) are on stock too. - omarchy-m-test: in the two PR jobs that finished before the idle lock, only
packages.kernel-updatesregressed, because no repo carries our test package, anddisplay.backlightwent to fixed. The first PR job ran into the lock:video.h264-on-screensaw near-black bars and later screenshots hung. A locked stock control also hung on screenshots, though it skipped h264 rather than failing it. Both shorter PR jobs passed the video checks, so we put that on the lock, not this PR.
One small thing: the comments at iomfb_v14_7.c:302, :328 and :2768 and iomfb_v14_7_backlight.h:42 still name only the earlier boards.
For the RC this looks fine to us: it's one board behind exact checks, and it gives J613 owners brightness control they don't have today.
The J615 record now carries panel_nits, so v14_bl_other_boards_untouched covers the J514C only, as omacom#312 did for the J613.
The J615 record now carries panel_nits, so v14_bl_other_boards_untouched covers the J514C only, as omacom#312 did for the J613.
J613's internal display renders correctly, but
/sys/class/backlightis empty because its board record and the machine admission list exclude the existing 14.7 panel-nits path. Enable that path for the 13-inch M3 MacBook Air, retaining its exact firmware UUID and bootloader handoff checks.Extend the existing KUnit swap-level case to J613, keep J615/J514C excluded, and expose the existing brightness completion/refusal counters in debugfs. No Mesa, GPU policy or external-display changes are needed for this fix.
Validation:
appledrm.koagainst the installed7.2.11-12-1-ARCHheaders; MODPOST passed and buffered/direct artifact hashes matched. The module was built with clang 22.1.8; the installed kernel used clang 18.1.8.90F849E1-B422-367E-B389-50246F8DEC47(23J220, interface 14.7.0).apple-panel-blappeared with a 500-nit maximum. Requests for 100, 250, 400, 1, 500 and 140 nits all completed with matchingactual_brightness, zero refusals, no DCP failure, and zero failed systemd units. Firmware logs also recorded the brightness changes.git diff --checkand checkpatch pass with no findings.Image modules dtbsbuild passed. Buffered/O_DIRECT hashes matched for Image, Asahi and Apple DRM modules, both M3 Air DTBs, and the Mesa libraries in the prepared development environment. This integrity check does not resolve the build VM's previously observed page-cache fault.J615, suspend/resume, and a hardware DPMS cycle have not been validated for this change. The hardware test used the matching-header module build above. A later attempt to make the fix persistent is awaiting recovery from an offline boot; the boot-install script used the wrong Limine digest algorithm (locally corrected). The cause of the currently reported splash-screen stall has not been captured. This deployment error is separate from the kernel diff and the successful test-image result.