Fix display DPMS power-down and schedutil rate limit
Enable the X11 DPMS extension and force the DRM connector off/on on blank and wake, including the lid-close and lockscreen paths that write backlight sysfs directly (driven by a backlight change udev rule and a small sync helper). DPMS timeouts stay at zero so unlocked auto-blanking remains off. Re-apply schedutil rate_limit_us=40000 after every powersave to schedutil governor switch, which recreates the kobject with the 6.44 s default, and drop the writes to nonexistent up_rate_limit_us / down_rate_limit_us files. Remove the dead iw power-save call: NetworkManager wifi.powersave=3 and the wcn36xx WIPHY_FLAG_PS_ON_BY_DEFAULT patch already report "Power save: on".
This commit is contained in:
1 parent
691a989838
commit
7b6c6b25d4
9 files changed
+68
-14
No files matched your search
+33
@@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
# Keep DRM DPMS and the schedutil rate limit in sync with the backlight state.
|
||||
# Invoked by the backlight udev rule (as root) and by sxmo_wm.sh display on
|
||||
# (via doas). Every blank path writes brightness=0; every wake path restores it.
|
||||
|
||||
BR_PATH=/sys/class/backlight/backlight/brightness
|
||||
RL_PATH=/sys/devices/system/cpu/cpufreq/schedutil/rate_limit_us
|
||||
|
||||
DPMS_PATH=
|
||||
for _dpms in /sys/class/drm/card*-*/dpms; do
|
||||
[ -r "$_dpms" ] && DPMS_PATH="$_dpms" && break
|
||||
done
|
||||
|
||||
br=1
|
||||
[ -r "$BR_PATH" ] && { read -r br < "$BR_PATH" 2>/dev/null || br=1; }
|
||||
case "$br" in ''|*[!0-9]*) br=1 ;; esac
|
||||
|
||||
cur=On
|
||||
[ -r "$DPMS_PATH" ] && { read -r cur < "$DPMS_PATH" 2>/dev/null || cur=On; }
|
||||
|
||||
if [ "$br" -eq 0 ]; then
|
||||
[ "$cur" = "Off" ] || DISPLAY=:0 xset dpms force off >/dev/null 2>&1 || true
|
||||
else
|
||||
[ "$cur" = "On" ] || DISPLAY=:0 xset dpms force on >/dev/null 2>&1 || true
|
||||
fi
|
||||
|
||||
# Switching scaling_governor away from schedutil and back recreates this
|
||||
# kobject with the 6.44 s default, so re-apply the 40 ms value on every wake.
|
||||
if [ "$br" -ne 0 ] && [ -w "$RL_PATH" ]; then
|
||||
printf '40000\n' > "$RL_PATH" 2>/dev/null || true
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Reference in new issue
Block a user