Skip to content

drm/apple: power off the J613 panel during DPMS and suspend - #365

Draft
garymeyerca wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
garymeyerca:garymeyerca/j613-sleep-backlight
Draft

garymeyerca wants to merge 1 commit into
aurora-silicon:integration/aurorafrom
garymeyerca:garymeyerca/j613-sleep-backlight

Conversation

@garymeyerca

Copy link
Copy Markdown
Contributor

On the 13-inch M3 MacBook Air (J613), DPMS off and system suspend leave the display backlight lit: the 14.7 IOMFB power-off path only presents a black frame. This patch turns off panel power and restores it when the CRTC is enabled again.

Enable this behavior through the J613 board record. Complete the final black frame before A472(0); wake with A475(1) followed by A472(1) and refresh the colour matrix. Handle the power notifications in the internal callback dispatcher, retain acknowledged state on refusal, and reject swaps while the panel is off.

The firmware sequence and callback layouts follow GehrmannSolutions' J613 clamshell work. Related: 14.x panel brightness control; that broader issue remains open. The PR contains the driver change and one host regression script.

Validation:

  • Native appledrm.ko build from this integration/aurora branch against matching installed kernel headers, with LLVM=1 LD=ld.bfd HOSTLD=ld.bfd W=1. Reference and candidate builds report the same warnings: Clang 23.1.3 versus the kernel's 22.1.8, and existing init-to-exit references to dcp_unregister and dcp_audio_unregister. This is a module build, not a full kernel build.
  • python3 tools/testing/apple/check-v14-panel-power.py passes with ASan/UBSan and compiler warnings denied. It executes the production power functions and the internal callback-dispatch prefix: repeated transitions, idempotence, wire layouts, firmware refusal, transport failure, callback shapes and board gating. Negative controls for black-only blanking and callbacks placed only in the external handler fail.
  • Hardware-tested as a backport to source c46d7dcdb8712ea9aeb0ce47b439ffae76371e55, whose affected driver files match this PR's base. Reboot verification matched the running module build ID to the tested binary. DPMS off/on and two s2idle cycles passed. The operator confirmed a fully dark backlight during sleep and normal display recovery. No DCP power, callback, link or flip errors appeared in the successful tests.
  • git diff --check and strict checkpatch with --no-signoff --ignore FILE_PATH_CHANGES pass. The existing tools/testing/apple/ MAINTAINERS entry covers the new test.

Test machine: J613/T8122, Omarchy on Arch Linux ARM; OS firmware 14.7, system firmware 27.0; Aurora release aurora-2026.10.17.20, kernel 7.1.12-2-20261017.20-sep-ARCH (linux-aurora 7.1.12.aurora2-20261017.20); m1n1 1.6.1.aurora17-5, U-Boot 2026.07.asahi2-4, Hyprland 0.56.2-7, Mesa 26.2.5, with asahi.t8122_start=1. The installed test system also carries local camera and platform changes. External displays, other boards, and lock-screen security were not qualified by these tests.

Draft pending human review and DCO sign-off, per the repository's coding-assistant guidance. The commit includes Assisted-by: Codex:GPT-6 and no agent-added sign-off.

On the M3 MacBook Air, the 14.7 IOMFB power-off path presents a black
frame but keeps the panel powered. The backlight therefore remains lit
through DPMS off and system suspend.

Enable panel power handling in the J613 board record. Complete the final
black frame before A472(0), and send A475(1) before A472(1) when enabling
the panel again. Handle the accompanying power callbacks in the internal
callback dispatcher and invalidate the cached colour matrix on wake.
Track acknowledged panel power state, reject swaps while powered off,
and preserve state when the firmware refuses a transition.

Add a standalone host regression for the production power functions and
internal callback dispatch, including wire layouts and failure paths.
Validate DPMS off/on and two s2idle cycles on J613 with 14.7 firmware.

The power sequence and callback layouts follow the existing J613
clamshell work linked below.

Link: omacom#127
Assisted-by: Codex:GPT-6

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What's needed before this can merge:

  1. Commit 9cd46b2 has no Signed-off-by. Please add yours (git commit --amend -s) and push.
  2. Rebase onto the current integration/aurora. It conflicts in drivers/gpu/drm/apple/iomfb_v14_7.c with 2984ba9 ("drm/apple: enable the J613 panel brightness path") and the later 14.7 changes:
    • dcp_v14_board_j613 now sets .panel_nits = true; keep it next to .panel_power.
    • dcp_v14_swap() now takes v14->lock differently; put the panel_off check inside the current locked section.
    • iomfb_v14_7_poweron() now calls dcp_backlight_dpms(dcp, true) when dcp_v14_bl_dpms_applies() is true. The panel must be powered (A475(1), A472(1)) before that restore runs.
    • iomfb_v14_7_poweroff() now blanks through dcp_v14_blank(), not dcp_v14_present(..., NULL, ...). The A472(0) step has to follow that path and only run once the black frame has completed.
  3. Testing: the hardware result in the description comes from a 7.1.12 backport. After the rebase, please post a J613 (14.7 firmware) result from the PR head: DPMS off/on, two s2idle cycles with the backlight dark, brightness restored after wake, and check-v14-panel-power.py passing. The non-J613 14.7 boards keep panel_power unset; one of them should be checked to confirm DPMS still only blanks there.

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