steamdeck kwin_wayland[2182]: atomic commit failed: Permission denied

That’s likely why KDE crashes on Steam Deck, when turning the monitor off.

I set KWIN_DRM_NO_AMS=1 to try and fix it. Have that on laptop too, and KWIN_DRM_NO_DIRECT_SCANOUT=1, which seems to have fixed AMDGPU from crashing on laptop.

The Deck was completely frozen or something this morning as well. Could ping it, but no SSH. And turned TV on, and black screen.


#!/usr/bin/bash
while :
do
    _cmd_systemd=$(systemctl is-system-running | grep -e "initializing" -e "starting" -e "maintenance" -e "stopping" -e "offline" -e "unknown")
    _cmd_pid=$(pidof /usr/bin/kwin_wayland)
    if [ $(cat /sys/class/drm/card1-DP-1/status) == "connected" ] && [ "$_cmd_systemd" == "" ] && [ "$_cmd_pid" == "" ] ;
        then
        echo "restarting lightdm"
        sleep 1
        systemctl stop lightdm
        sleep 1
        systemctl start lightdm
        sleep 10
    fi
    sleep 15
done

Script to restart KDE from udev, if auto login is enabled.

It finally works, without restarting lightdm over and over again. Might be why the Deck is crapping out.

Don’t bother with UDEV. “amdgpu 0000:04:00.0: [drm] Dirty helper failed: ret=-22”. Must have crashed it. Ran systemctl soft-reboot, and it’s working again.

Updated the script, it can be ran from systemd.

If ten seconds is too long of a wait, change it to less, or remove it. Think I’ll increase it by 5, just in case. LightDM has a timeout of 5.

[Unit]
After=systemd-user-sessions.service getty@tty7.service plymouth-quit.service lightdm.service

[Service]
ExecStart=/opt/restart_plasma.sh

[Install]
WantedBy=multi-user.target

It’s still crashing, even with disabling AMS.