summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorMichael Biebl <mbiebl@gmail.com>2008-03-17 00:13:46 +0100
committerMichael Biebl <mbiebl@gmail.com>2008-03-17 00:13:46 +0100
commit5de0eb47fc7b0a07b9fc1df6ad20ed9912ef492a (patch)
treeed935a54232c4818633e846e95cc686fda85be2a /pm
parent54eff27133ce0ed1f899b237d9946a3f31546a96 (diff)
Parse video quirks in uswsusp sleep module
- Parse the video quirks in the uswsusp and pass it to s2ram (do_suspend) and s2both (do_suspend_hybrid). - Show the available quirks in the help method. - quirk-save-pci is currently s2ram specific and not yet provided by hal. - quirk-dpms*, quirk-reset-brightness and quirk-vga-mode3 are not handled by s2ram and thus simple no-ops.
Diffstat (limited to 'pm')
-rwxr-xr-xpm/module.d/uswsusp52
1 files changed, 48 insertions, 4 deletions
diff --git a/pm/module.d/uswsusp b/pm/module.d/uswsusp
index ca87a30..cd465d1 100755
--- a/pm/module.d/uswsusp
+++ b/pm/module.d/uswsusp
@@ -6,6 +6,31 @@ before_hooks()
disablehook 99video "disabled by uswsusp"
}
+get_quirks()
+{
+ OPTS=""
+ ACPI_SLEEP=0
+ for opt in $PM_CMDLINE; do
+ case "${opt##--quirk-}" in # just quirks, please
+ dpms-on) ;; # no-op
+ dpms-suspend) ;; # no-op
+ radeon-off) OPTS="$OPTS --radeontool" ;;
+ reset-brightness) ;; # no-op
+ s3-bios) ACPI_SLEEP=$((ACPI_SLEEP + 1)) ;;
+ s3-mode) ACPI_SLEEP=$((ACPI_SLEEP + 2)) ;;
+ vbe-post) OPTS="$OPTS --vbe_post" ;;
+ vbemode-restore) OPTS="$OPTS --vbe_mode" ;;
+ vbestate-restore) OPTS="$OPTS --vbe_save" ;;
+ vga-mode3) ;; # no-op
+ save-pci) OPTS="$OPTS --pci_save" ;;
+ none) QUIRK_NONE="true" ;;
+ *) continue ;;
+ esac
+ done
+
+ [ $ACPI_SLEEP -ne 0 ] && OPTS="$OPTS --acpi_sleep $ACPI_SLEEP"
+}
+
check_suspend()
{
[ -e /dev/pmu ] && return 0
@@ -14,7 +39,8 @@ check_suspend()
do_suspend()
{
- echo "mem" >/sys/power/state
+ get_quirks
+ s2ram --force $OPTS
}
check_hibernate()
@@ -39,7 +65,25 @@ check_suspend_hybrid()
do_suspend_hybrid()
{
- # a brief perusal of the source indicates that -f bypasses
- # quirks application and the whitelist.
- s2both -f
+ get_quirks
+ s2both --force $OPTS
+}
+
+sleep_method_help()
+{
+ echo # first echo makes it look nicer.
+ echo "Video quirk handler options:"
+ echo
+ echo " --quirk-dpms-on"
+ echo " --quirk-dpms-suspend"
+ echo " --quirk-radeon-off"
+ echo " --quirk-reset-brightness"
+ echo " --quirk-s3-bios"
+ echo " --quirk-s3-mode"
+ echo " --quirk-vbe-post"
+ echo " --quirk-vbemode-restore"
+ echo " --quirk-vbestate-restore"
+ echo " --quirk-vga-mode3"
+ echo " --quirk-save-pci"
+ echo " --quirk-none"
}