Repository navigation
Lock the lid and idle the Radeon on 15-inch 2016–2017 MacBook Pros - #7196
shawnyeager wants to merge 10 commits into
Conversation
S3 and s2idle do not resume on MacBookPro13,3 / 14,3. Lid close now locks, systemd refuses suspend/hibernate, and the menu hides those rows. The discrete GPU stays bound; POWER_SAVING lets Polaris drop clocks at idle instead of sitting on the 3D_FULL_SCREEN rung. The NVMe d3cold unit now follows nvme0 instead of assuming 01:00.0, which is the Radeon on these 15-inch machines.
Stay-on with the lid closed still cooked the panel backlight and left the CPU in the snappy profile. Close now dims gmux and sets power-saver without writing Omarchy's remembered AC/battery choice. Open restores brightness and runs powerprofiles-set autodetect. Seed AC=balanced once so a reboot is not performance.
Clamshell is display math. Restore the 15" power-saver overlay from omarchy-system-lid-open, which is now the default lid-open bind. udev bind is enough to apply POWER_SAVING; a second boot unit was redundant.
Backlight 0 still drives eDP. With suspend banned, a closed lid then soaks the chassis (Touch Bar included) for as long as the machine stays on. Disable DPMS on close; enable and restore brightness on open.
powerprofilesctl set power-saver on lid close puts the Broadcom card into PCI D3/ASPM. brcmfmac on 14e4:43ba does not come back. Stop that overlay. Pin the card with power/control=on and d3cold_allowed=0, same stay-awake as the Thunderbolt xHCI quirk. Lid-open still runs autodetect so a machine already stuck in power-saver recovers.
DPMS and backlight-off still leave eDP scanning. Disable the internal output, persist that across reloads, and do not let clamshell turn it back on while the lid is shut with no external.
|
I have lid-close suspend and resume working on a MacBookPro14,3, so I wanted to put numbers against the premise before this lands. The GPU-idling and clamshell half of this PR stands on its own either way — this is only about "stock lid-suspend is a hard reboot on these boards". Six suspend/resume cycles on a MacBookPro14,3, stock One important qualification: the lid does not wake this machine — a keypress does. Opening the lid leaves it asleep indefinitely (I left it 12 minutes and 10 minutes on two occasions); pressing any key resumes it in well under a second. The lid registers ACPI events but never a wake event — What it took, and why I think you are one step away from it. You already pin the Wi-Fi awake —
2 and 3 are both required. I dropped 3, kept 2, rebooted and closed the lid: no resume, journal ends at Two things that cost me hours, in case they save you some.
Do not unload Caveats. One machine, one session. None of this touches the docked/clamshell half of your work. But if suspend is reachable on these boards, then |
The skip ran on every laptop, so an undocked lid close anywhere else left the panel disabled going into suspend, with no output for the lock surface (omacom#13300). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The 15-inch lid-closed toggle is only cleared by the lid-open binding. A machine that powers off with the lid shut, which a lid that no longer suspends makes likely on battery, boots with the panel disabled and nothing else to show on. The recovery unit that already does this for the manual toggle now does it here too, when the lid is open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Reviewed at Checked. I read the diff and the lid, clamshell, lock and recovery code it plugs into. On a disposable Omarchy ISO worker, Pushed
Still open
Scope and premise. This one PR carries four independent changes: lid and sleep policy, Radeon idle, the BCM43602 PCI pin, and NVMe. Splitting out the Wi-Fi pin and the NVMe change would leave a much smaller PR about the lid. @makoni measured six s2idle suspend/resume cycles on a MacBookPro14,3, with D3cold disabled across PCI and Second opinion. Codex Medium reviewed the same head. It found the lock-ordering gap, the sudo HOME problem, the udev Waiting on the author for the open findings, and on the maintainer for the suspend policy. |
|
Confirming the amdgpu is in the initramfs on this machine — mkinitcpio with the The device is up and registered by 6.69 s, with fbcon following at 6.71 s. The banner at 17.13 s is PID 1 on the root filesystem — there is exactly one in this boot, and no The initramfs does ship Nothing from That is
I can't answer the other half — whether One baseline that may be useful anyway. Stock, with none of this applied, the card does not sit at |
With the kms hook, amdgpu binds in the initramfs, before /etc/udev/rules.d is on the root filesystem, and systemd-udev-trigger replays add, not bind. A bind-only rule therefore never fires after a reboot, and POWER_SAVING was applied only when the installer or migration called the helper directly. Matching add as well covers the boot path; the helper still no-ops on other hardware. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Re-reviewed at Pushed
Checked. On a disposable Omarchy ISO worker, Second opinion. Codex Medium reviewed this commit and found nothing to change. It agreed the defect is real and Still open from the last review: the panel is disabled before the session is locked ( Waiting on the author for those, and on the maintainer for whether these models should refuse suspend at all, given @makoni's s2idle measurements. |
|
| # not cook the chassis. Do not overwrite a profile the user already chose. | ||
| ac_state="${XDG_STATE_HOME:-$HOME/.local/state}/omarchy/powerprofiles/ac" | ||
| if [[ ! -f $ac_state ]]; then | ||
| omarchy-powerprofiles-set ac balanced >/dev/null 2>&1 || true |
There was a problem hiding this comment.
AC seed changes battery profile
If this migration runs while the machine is on battery, omarchy-powerprofiles-set ac balanced also applies balanced as the live system profile. That replaces the user's battery profile until a power-source change or the next login, even though this step is only meant to set an AC default.
Knowledge Base Used:
| if (( $(id -u) != 0 )) && [[ $(mbp15_logind_dest) == /etc/* ]]; then | ||
| exec sudo --preserve-env=OMARCHY_PATH,OMARCHY_DMI_PRODUCT_NAME,OMARCHY_MBP15_LOGIND,OMARCHY_MBP15_SLEEP,OMARCHY_MBP15_UDEV_SRC,OMARCHY_MBP15_UDEV_DEST,OMARCHY_MBP15_SKIP_SYSTEMCTL \ | ||
| /bin/bash -euo pipefail "$OMARCHY_PATH/migrations/1786920500.sh" |
There was a problem hiding this comment.
Root rerun overrides chosen profile
The sudo branch reruns the migration without preserving the user's HOME or XDG_STATE_HOME. Root therefore sees no saved AC preference and runs the earlier balanced-profile command again, even if the user chose another profile. This changes the live profile to balanced, and the update does not restore the user's choice until a power-source change or login.
Knowledge Base Used:
| elif omarchy-hw-apple-mbp15-dgpu && omarchy-hw-laptop-closed && ! omarchy-hw-external-monitors; then | ||
| # 15" Radeon, lid shut, no external: it stays on with the panel disabled, and | ||
| # forcing it back on would undo that on monitorremoved. Every other laptop is | ||
| # about to suspend and needs the panel back for the lock surface. | ||
| : | ||
| else | ||
| enable_internal |
There was a problem hiding this comment.
Inactive external re-enables closed panel
If an external display is physically connected but disabled in Hyprland, it counts as connected but not active. With the lid shut, neither branch matches, so enable_internal turns the laptop panel back on. The Radeon resumes scanning out while the lid is closed, defeating the new output-disable behavior.
Knowledge Base Used: Hyprland configuration and display control
| # omarchy:summary=Clear the internal-monitor-disable toggle if no external display is connected. | ||
|
|
||
| TOGGLE="$HOME/.local/state/omarchy/toggles/hypr/internal-monitor-disable.lua" | ||
| LID_CLOSED_TOGGLE="$HOME/.local/state/omarchy/toggles/hypr/internal-monitor-lid-closed.lua" |
There was a problem hiding this comment.
Custom state path prevents recovery
If XDG_STATE_HOME is customized, the lid helper writes this toggle there, and Hyprland loads it from there, but this recovery command and its service condition check only $HOME/.local/state. After a closed-lid power-off leaves the toggle behind, recovery never clears it and the internal display stays disabled.
Knowledge Base Used:
| if [[ -e /sys/class/nvme/nvme0/device/d3cold_allowed ]]; then | ||
| NVME_DEVICE=$(readlink -f /sys/class/nvme/nvme0/device)/d3cold_allowed |
There was a problem hiding this comment.
NVMe unit retains setup-time device
If another NVMe controller enumerates as nvme0 during hardware setup, this selects that controller without checking whether it is the internal disk. The service then stores its PCI path permanently, so later boots disable D3cold on the wrong device while the internal disk remains exposed to the suspend problem. Selecting the intended disk when the service runs would avoid that stale setup-time choice.
Knowledge Base Used: Hardware, devices, and power
|
Checked Greptile's five findings against the source at
Still open from earlier reviews: the panel is disabled before the session is locked ( Waiting on the author for those, and on the maintainer for whether these models should refuse suspend at all, given @makoni's s2idle measurements. |
Summary
On the 15-inch 2016–2017 Radeon MacBooks, closing the lid no longer suspends. That path does not resume, so the machine stays on, locks, idles the GPU, and disables the internal output so the 560 stops scanning out.
Independent of the Touch Bar and CS8409 speaker work. Verified on MacBookPro14,3. 13-inch T1 models are Intel-only and are not included.
Why
Stock lid-suspend is a hard reboot on these boards.
Stay-on with the lid closed still cooked the chassis. amdgpu sat on
3D_FULL_SCREEN(~13 W at 0% busy). Backlight 0 still scanned out eDP. Hyprland DPMS did too — the CRTC stayed up. Stockkey_press_enables_dpms/mouse_move_enables_dpmsthen turned scanout back on. Clamshell then force-enabled the internal panel on everymonitorremoved, which undid the blank.A
powerprofilesctl set power-saveroverlay on lid close put BCM43602 (14e4:43ba) into PCI D3/ASPM.brcmfmacdoes not come back from that.What
MacBookPro13,3/14,3only.POWER_SAVINGlets Polaris drop clocks at idle. This is not a GPU power-off.hl.monitor({ disabled = true })) and persists that in a Hyprland toggle so a reload does not bring the panel back. Key/mouse DPMS-wake is held off. It does not set power-saver.monitorremovedevent cannot undo the disable.omarchy-powerprofiles-set autodetect.power/control=onandd3cold_allowed=0, applied at install and by migration1788634178.balancedonly if the user has never chosen a profile.nvme0instead of0000:01:00.0(the Radeon on these machines).No mux, no rEFInd, no voicing.
Related: #7064, #7140
Test plan
test/shell.d/mbp15-dgpu-test.sh(detector, idle profile, lid overlay, output disable, wake-flag save/restore, wifi PCI pin, no lid-close power-saver)test/shell.d/lid-close-test.sh(lock, then clamshell, then 15-inch chill)test/shell.d/monitor-clamshell-scale-test.sh(clamshell does not re-enable a shut undocked panel)hyprctl monitors all) and GPU power drops, and that a key/mouse does not bring the panel back. Tests cover the helper; that close was not run in this session.wlanup;power/controlon14e4:43bastayson.