Repository navigation
Enable amdgpu HDMI HPD debounce so displays that drop HPD in power save stop relighting the locked screen - #13129
davidguilherme wants to merge 4 commits into
Conversation
…MS power save Monitors that deassert hotplug-detect when the link enters DPMS power save and then re-assert it as an input autoscan are seen by the kernel as a real disconnect->reconnect with an identical EDID. That raises a hotplug event, which removes a DPMS-off output and re-adds it with DPMS back on (the lock-screen relight loop reported across several issues). amdgpu's HDMI HPD filter schedules a delayed re-detect and drops the duplicate hotplug when the same EDID returns within the window. It is disabled by default upstream; enabling it here at 1500ms fixes the class of lock-screen blank/wake loops on AMD HDMI without affecting DisplayPort or non-amdgpu hardware.
…ounce The amdgpu contrib lands /etc/modprobe.d/amdgpu.conf through the settings package, but the param is read once at module load and amdgpu loads out of the initramfs (kms + modconf hooks) -- so an existing install that only gets the file sits inert until a later kernel rebuild happens to bake it in. Rebuild the initramfs once on machines that can benefit (an AMD display controller is present and the packaged conf has landed), flag a reboot so the fix applies, and record a machine-wide marker so other users' runs no-op. Mirrors the NVIDIA kms-hook initramfs migration (1786605598).
|
Verified on my machine (dual AMD display controllers, HDMI-A-1 attached, Limine UKI boot):
Works as described, thanks. |
/etc/modprobe.d/amdgpu.conf is the name the Arch wiki and most guides tell people to put their own amdgpu options in (si_support, cik_support, ppfeaturemask). omarchy-settings owning that path means pacman refuses the update on any machine that already has one, and omarchy update's conflict handler then moves the administrator's file to /var/lib/omarchy/replaced and installs ours in its place, so their options silently stop applying at the next boot. Name it like the other Omarchy drop-in beside it, and pin that in the test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
The machine-wide marker was written before the reboot flag, so a run that failed between them left the initramfs rebuilt, the migration complete, and no reboot prompt: every later run exits at the marker, and the debounce never applies until the user happens to reboot. Flag first, as the kernel migration beside it does, so a failure there stays pending and retries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Codex Medium <noreply@openai.com>
|
Reviewed by Claude Opus 5.5, with Codex Medium as a second opinion. The approach is sound: amdgpu's I pushed two fixes to your branch:
What ran: on a disposable Omarchy worker, What this can't prove: a worker has neither an amdgpu nor an HDMI monitor that drops HPD, so the fix itself is unverified until someone who has the problem confirms it. @blueedgesolutions-tom (#11330) and @bmcswee (#8580), could you test commit curl -fsSL https://raw.githubusercontent.com/davidguilherme/omarchy/b2331c425a56bcef095232bc531bb2afd219d5d6/etc/modprobe.d/omarchy-amdgpu-hdmi-hpd.conf | sudo tee /etc/modprobe.d/omarchy-amdgpu-hdmi-hpd.conf
sudo limine-mkinitcpio
# reboot, then this should print 1500:
cat /sys/module/amdgpu/parameters/hdmi_hpd_debounce_delay_msThen lock, leave it for a few minutes, and say whether the display stays dark. To undo it, delete the file and run For the maintainer:
This is waiting on a reporter's confirmation, then on the maintainer. |
|
| sudo limine-mkinitcpio | ||
| omarchy-state set reboot-required | ||
| sudo install -Dm644 /dev/null "$rebuild_marker" No newline at end of file |
There was a problem hiding this comment.
limine-mkinitcpio can return zero after skipping a failed build, as the existing kernel migration documents and checks. This migration immediately writes the completion marker instead. If the AMD boot image build is skipped, the old image remains, the screen-wake fix stays inactive, and future runs skip the repair.
Check that the rebuilt image contains the new drop-in before writing the marker, and add a test for a skipped build that returns zero.
|
|
||
| omarchy-cmd-present limine-mkinitcpio || exit 0 | ||
| conf="${OMARCHY_AMDGPU_HPD_CONF:-/etc/modprobe.d/omarchy-amdgpu-hdmi-hpd.conf}" | ||
| [[ -f $conf ]] || exit 0 |
There was a problem hiding this comment.
If a dev checkout receives this migration before the settings package receives the drop-in, this exit 0 makes omarchy-migrate record it as complete for that user. Installing the config later will not retry the rebuild, so the fix can remain inactive.
Return a failure when this temporary prerequisite is missing. Test the retry through omarchy-migrate; checking only the machine-wide marker does not show that the migration stays pending.
|
Greptile's two findings on
Still waiting on the hardware test requested above, at |
|
Confirmed at
The fix at this head works as described. |
|
Thanks for testing at I checked this against the PR and the four linked issues, Claude Opus 5.5 with Codex Medium as a second opinion. Codex independently reached the same reading of the rule. It couldn't reach GitHub during its run, so the activity check is mine alone. The head hasn't moved since the last review, so the earlier findings stand: the worker suite result, the Greptile notes, and the two maintainer questions (whether the debounce should be on by default, and whether #10778 and #8863 should be "Refs" rather than "Fixes"). This still waits on @blueedgesolutions-tom (#11330) or @bmcswee (#8580) testing |
|
Verified on AMD + HDMI hardware (Radeon RX 470/480/570-class, ASUS XG32UCG on HDMI-A-1, Limine/ Applied the drop-in at
Matches the intended fix. Thanks. |
|
Thanks for testing, @arnoudja. That's a second AMD + HDMI machine, and the first from someone other than the author, where the parameter reads It doesn't change the The head hasn't moved, so the earlier review stands. This still waits on @blueedgesolutions-tom (#11330), @bmcswee (#8580), @kellylipke (#10778) or @pablo-io (#8863) testing |
|
I tested this approach on an AMD box over the last few days and want to flag one serious outcome before it ships to every AMD user by default: with the debounce on, amdgpu deadlocked once, with the compositor stuck in D state until a forced reboot. Setup: Omarchy 4.0.6, kernel 7.2.8-9-omarchy, Hyprland 0.56.2, Ryzen 9 9950X with the integrated Radeon 610M (Granite Ridge, DCN 3.1.5), MSI MAG B850M Mortar WiFi (HDMI is the board's only output), Dell U3224KB at 6144x3456@60 over HDMI 2.1 FRL. Debounce set to 4000 ms via /etc/modprobe.d plus What worked: the debounce does what the PR says. With it set, the locked session stopped removing and re-adding the output every ~40 s; the Hyprland log went from hundreds of What went wrong:
This is kernel 7.2's brand new HDMI FRL code interacting with the debounce, so it may not reproduce on older GPUs or non-FRL (HDMI 2.0) monitors. But Omarchy ships 7.2 and FRL is on by default in it ( Suggestions:
For what it is worth, the approach that has worked for me without touching the driver is to not DPMS the affected monitor at all and put it to sleep over DDC/CI instead ( Prepared with the help of Claude (Anthropic's AI assistant) from this machine's logs; reviewed and posted by me. |
|
Thanks for the long test and the traces, @kstaikov. I checked the deadlock against the amdgpu sources. The cycle in your trace runs through HDMI FRL status polling, not through the debounce. #16457 fixes the same loop a different way: an opt-in toggle that sleeps the monitor over DDC/CI so the link never drops. That makes them competing fixes, and choosing between them is the maintainer's call. Codex, asked which should win without my answer, picked #16457 because of the 1500 ms window and the wake. I'd weigh it differently. #16457 is off by default and needs DDC/CI enabled on the monitor, so on its own it changes nothing for anyone who doesn't find the toggle, while this one applies to every AMD install with no setup. Both views are with the maintainer. Nothing else changed: the head is still |
Summary
Fixes a class of lock-screen blank/wake loops on AMD HDMI systems: displays that drop HDMI hotplug-detect (HPD) when blanked re-light a locked screen over and over. Related: #11330, #8580, #10778, #8863.
Problem
When a DPMS-off output enters power save, many HDMI monitors de-assert HPD and then re-assert it as an input-source "autoscan" ~15s later. Linux has no HDMI HPD filter, so the kernel sees a disconnect→reconnect with an identical EDID (~0.75s apart) and raises a hotplug event: the output is removed and re-added with DPMS back on. Locked, that blank→wake→blank cycle repeats indefinitely (
drm: HDMI-A-x is not connected, clearing stale crtc), measured at thousands of cycles per night on real installs.Root cause
Userspace re-blank debounces (#8896, #10130) treat the symptom — the removal happens in amdgpu before userspace ever sees it. amdgpu's Display Manager now ships the right tool: an HDMI HPD filter (upstream "drm/amd/display: Add an HPD filter for HDMI", a driver parameter disabled by default). When enabled, an HDMI disconnect schedules a delayed re-detect instead of being processed immediately; if the same EDID returns within the window, the hotplug event is skipped and the output is never removed. Only HDMI is filtered; DisplayPort is unaffected.
Change
etc/modprobe.d/amdgpu.conf— arms the filter at1500ms(AMD's chosen default; covers a typical ~0.75s HPD drop) on every Omarchy machine. Theoptionsline is inert when amdgpu is not loaded, so non-AMD hardware is untouched.migrations/1790200214.sh— existing installs need a one-time initramfs rebuild: amdgpu loads out of the initramfs (kms+modconfhooks) and the parameter is read once at module load, so a plain package update stays inert until a later kernel rebuild. The migration rebuilds only on machines with an AMD display controller, records a machine-wide marker so it runs once, and flags a reboot so the fix actually applies.test/shell.d/amdgpu-hpd-debounce-migration-test.sh— covers AMD/Intel scoping, idempotency, retry-after-failure, and the reboot flag.Verification
On this AMD (Radeon) + HDMI box:
amdgpu.hdmi_hpd_debounce_delay_ms=1500set → DPMS-off after lock no longer drops the output. During a 42s watch the connector stayedconnectedwith zero disconnect at the ~15s mark (pre-fix it disconnected and relit every cycle).Testing
bash test/shell.d/amdgpu-hpd-debounce-migration-test.sh— 8/8 pass./test/shell— new test passes; the suite's 6 failures are pre-existing environment gaps (missingomarchy-pkgscheckout,omasnap, live compositor), unrelatedFixes #11330 · Fixes #8580 · Fixes #10778 · Fixes #8863