Skip to content

drm/apple: enable J613 panel brightness control - #312

Merged
scottjones merged 1 commit into
integration/aurorafrom
fix/j613-panel-brightness-20261031
Oct 31, 2026
Merged

scottjones merged 1 commit into
integration/aurorafrom
fix/j613-panel-brightness-20261031

Conversation

@DjDeveloperr

@DjDeveloperr DjDeveloperr commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

J613's internal display renders correctly, but /sys/class/backlight is 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:

  • Built appledrm.ko against the installed 7.2.11-12-1-ARCH headers; 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.
  • Booted that module on a J613 running Omarchy, with DCP firmware UUID 90F849E1-B422-367E-B389-50246F8DEC47 (23J220, interface 14.7.0). apple-panel-bl appeared with a 500-nit maximum. Requests for 100, 250, 400, 1, 500 and 140 nits all completed with matching actual_brightness, zero refusals, no DCP failure, and zero failed systemd units. Firmware logs also recorded the brightness changes.
  • The user confirmed visible brightness control works in person.
  • A local ASAN/UBSAN fixture executing production admission, encoding and policy code passed all 501 integer wire levels, deferred takeover, refused/accepted completion and 20 software DPMS cycles. The KUnit-enabled object compiled locally, and CI KUnit passed, including the new J613 swap-level case (1,742 passed, 3 expected skips across the full run).
  • git diff --check and checkpatch pass with no findings.
  • Full native Arch ARM Asahi-profile Image modules dtbs build 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.

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 scottjones left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_brightness 500. 0, 1, 2, 3, 50 and so on up to 498, 499 and 500 all reached actual_brightness by 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_changed with 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 (success 2, fail 0). 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_surface and two others) are on stock too.
  • omarchy-m-test: in the two PR jobs that finished before the idle lock, only packages.kernel-updates regressed, because no repo carries our test package, and display.backlight went to fixed. The first PR job ran into the lock: video.h264-on-screen saw 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.

@scottjones
scottjones added this pull request to the merge queue Oct 31, 2026
Merged via the queue into integration/aurora with commit 44d80de Oct 31, 2026
14 checks passed
ericjuta added a commit to ericjuta/linux-aurora that referenced this pull request Nov 4, 2026
The J615 record now carries panel_nits, so v14_bl_other_boards_untouched
covers the J514C only, as omacom#312 did for the J613.
ericjuta added a commit to ericjuta/linux-aurora that referenced this pull request Nov 13, 2026
The J615 record now carries panel_nits, so v14_bl_other_boards_untouched
covers the J514C only, as omacom#312 did for the J613.
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.

2 participants