systemd version the issue has been seen with
258.7
Used distribution
Fedora 43
Linux kernel version used
6.19.13-200.fc43.x86_64
CPU architectures issue was seen on
x86_64
Component
systemd-logind
Expected behaviour you didn't see
I am using a laptop with a closed lid and an external display. When blanking the external display through DPMS, I expect this not to affect the state of the laptop.
Unexpected behaviour you saw
When powering off the screen, my system suspends.
This seems to be because logind enumerates DRM connectors and counts a connector only if its sysfs enabled attribute equals the literal string "enabled" - but when DPMS is on, it has a different value (at least for the amdgpu DRM driver, in report enabled based on whether the connector is currently driving an active CRTC, not whether the connector is physically present.)
Therefore, when a userspace compositor (swayidle in my case) sends a DPMS-off ioctl, the CRTC is detached and the kernel flips enabled from enabled to disabled — even though the cable is still plugged in and status remains connected.
Steps to reproduce the problem
- Close laptop lid with a single external monitor connected via DisplayPort. Confirm HandleLidSwitch=suspend, HandleLidSwitchDocked=ignore (defaults), and IdleAction=ignore (default).
- Confirm busctl get-property org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager Docked returns b true.
- From a terminal on the laptop, run a DPMS-off command, e.g. on Sway: swaymsg "output * dpms off".
- Observe: the laptop suspends within a fraction of a second.
Additional program output to the terminal or log subsystem illustrating the issue
before and after swaymsg "output * dpms off", on a Lenovo ThinkPad with a single DP monitor:
# Before:
/sys/class/drm/card1-DP-3/status: connected (enabled=enabled)
Docked = b true
# After:
/sys/class/drm/card1-DP-3/status: connected (enabled=disabled)
Docked = b false
Suggested patch (generated with Claude Code, not reviewed by me, I do not know enough about systemd):
In src/login/logind-core.c, manager_count_external_displays(), drop the enabled check entirely and rely on status != "disconnected" (which the code already does immediately afterwards).
Looking at the same function, there's a missing comma in the prefix list:
if (!STARTSWITH_SET(dash,
"VGA-", "DVI-I-", "DVI-D-", "DVI-A-"
"Composite-", "SVIDEO-", "Component-",
"DIN-", "DP-", "HDMI-A-", "HDMI-B-", "TV-"))
Adjacent string literal concatenation turns "DVI-A-" "Composite-" into the single token "DVI-A-Composite-", so DVI-A and Composite connectors are both never matched. (Probably
worth fixing in the same patch.)
systemd version the issue has been seen with
258.7
Used distribution
Fedora 43
Linux kernel version used
6.19.13-200.fc43.x86_64
CPU architectures issue was seen on
x86_64
Component
systemd-logind
Expected behaviour you didn't see
I am using a laptop with a closed lid and an external display. When blanking the external display through DPMS, I expect this not to affect the state of the laptop.
Unexpected behaviour you saw
When powering off the screen, my system suspends.
This seems to be because logind enumerates DRM connectors and counts a connector only if its sysfs enabled attribute equals the literal string "enabled" - but when DPMS is on, it has a different value (at least for the amdgpu DRM driver, in report enabled based on whether the connector is currently driving an active CRTC, not whether the connector is physically present.)
Therefore, when a userspace compositor (swayidle in my case) sends a DPMS-off ioctl, the CRTC is detached and the kernel flips enabled from enabled to disabled — even though the cable is still plugged in and status remains connected.
Steps to reproduce the problem
Additional program output to the terminal or log subsystem illustrating the issue