Unable to wake up screen that goes to sleep

I installed Fedora 41 / Sway spin on a laptop. When I do not use it for a while, the laptop screen (and, if connected, external screens) go to sleep and I am unable to wake them up; I can blindly type a reboot command or force power off and restart the system.

I have

exec swayidle -w -d \
         timeout 5 'swaylock -f -c 4682B4' \
         timeout 600 'swaymsg "output * power off"' resume 'swaymsg "output * power on"' \
         before-sleep 'swaylock -f -c 4682B4'

in my Sway config file. If I disable swayidle altogether, then the problem disappears but of course I get no power saving.

So thinking it was a problem coming from that I tried to reproduce it with

swayidle -w -d timeout 5 'swaymsg "output * power off"' resume 'swaymsg "output * power on"'

started from the terminal. But that works just fine.

As for hardware, I have

00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01) (prog-if 00 [VGA controller])
        Subsystem: Lenovo Device 3f18
        Flags: bus master, fast devsel, latency 0, IRQ 148
        Memory at 6000000000 (64-bit, non-prefetchable) [size=16M]
        Memory at 4000000000 (64-bit, prefetchable) [size=256M]
        I/O ports at 3000 [size=64]
        Expansion ROM at 000c0000 [virtual] [disabled] [size=128K]
        Capabilities: [40] Vendor Specific Information: Len=0c <?>
        Capabilities: [70] Express Root Complex Integrated Endpoint, IntMsgNum 0
        Capabilities: [ac] MSI: Enable+ Count=1/1 Maskable+ 64bit-
        Capabilities: [d0] Power Management version 2
        Capabilities: [100] Process Address Space ID (PASID)
        Capabilities: [200] Address Translation Service (ATS)
        Capabilities: [300] Page Request Interface (PRI)
        Capabilities: [320] Single Root I/O Virtualization (SR-IOV)
        Kernel driver in use: i915
        Kernel modules: i915, xe

I attach systool information for i915 and xe. My sway version is

Version         : 1.10.1
Release         : 1.fc41

Any help debugging this would be appreciated. Does anyhing else do power management on Fedora that I should check for? Which logs should I be looking at?

Which Lenovo laptop is it? You can check the Arch wiki::lenovo to see if any existing issues related to suspend and workarounds.

1 Like

From dmidecode:

System Information
        Manufacturer: LENOVO
        Product Name: 82FE
        Version: IDEAPAD 5-14ITL05

Just to clarify: suspend works fine. The issue is not about suspent, but screen poweroff.