Standby - Suspend to RAM (MNT Reform)

I have looked into suspend/wake problems today and found that probably since 6.0 (also tested after upgrading to 6.1.7 today) there’s a regression in which the system works after wake, but the display doesn’t show anything. It doesn’t matter whether lcdif or dcss is used as the display engine for internal display.

Curiously, I found that I could still launch a terminal and type commands, and pkill sway brought the display back to life. I then found out that the following commands also bring back the display (including the sway session: swaymsg output eDP-1 disable; swaymsg output eDP-1 enable.

I bound this to a keybinding in sway config: bindsym $mod+x exec 'swaymsg output eDP-1 disable; swaymsg output eDP-1 enable'. Pressing super+x after waking brought the display and session back.

It looks like something is not reinitialized correctly in the display stack, perhaps in the nwl-dsi driver.

I also automated the workaround using this extremely ugly hack (modifying /usr/sbin/reform-standby):

sway_display_restart() {
  export SWAYSOCK=$(echo /run/user/1000/sway-ipc*.sock)
  swaymsg output eDP-1 disable
  swaymsg output eDP-1 enable
}

And inserted a call to this function at this spot:

	resume)
		kbd_backlight_on
		sway_display_restart

This is far from elegant, especially with the hardcoded user id 1000. But maybe this helps you with productively using suspend/resume until a real fix is found.

Edit: a cleaner option—if you have a bindsym to trigger suspend in sway—could be to just add the output disable and enable commands directly after the suspend command in the same line. Haven’t tested this.

3 Likes