summaryrefslogtreecommitdiff
path: root/pm/sleep.d
diff options
context:
space:
mode:
authorVictor Lowther <victor.lowther@gmail.com>2008-02-27 19:53:42 -0600
committerVictor Lowther <victor.lowther@gmail.com>2008-02-27 19:53:42 -0600
commita7278a0bc224226f9cd3d0199347051ec7ab9bed (patch)
tree0255225841c93228a0c64bc575ffdfc00a804238 /pm/sleep.d
parent9343bda51f8feff514b2bd0430c6435ee7466148 (diff)
Folded 20video functionality into 99video and deleted 20video.
Diffstat (limited to 'pm/sleep.d')
-rwxr-xr-xpm/sleep.d/20video67
-rwxr-xr-xpm/sleep.d/99video37
2 files changed, 37 insertions, 67 deletions
diff --git a/pm/sleep.d/20video b/pm/sleep.d/20video
deleted file mode 100755
index 05d91ee..0000000
--- a/pm/sleep.d/20video
+++ /dev/null
@@ -1,67 +0,0 @@
-#!/bin/sh
-#
-# Copyright 2006-2007 Richard Hughes <richard@hughsie.com>
-# Copyright 2007 Peter Jones <pjones@redhat.com>
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-
-. "${PM_FUNCTIONS}"
-
-if command_exists vbetool; then
- vbe() { vbetool "$@"; }
-else
- vbe() { echo "vbetool not found" 1>&2; return 1; }
-fi
-
-if command_exists radeontool; then
- radeon() { radeontool "$@"; }
-else
- radeon() { echo "radeontool not found" 1>&2; return 1; }
-fi
-
-suspend_video()
-{
- # 0=nothing, 1=s3_bios, 2=s3_mode, 3=both
- if [ "${DISPLAY_QUIRK_S3_BIOS}" = "true" -a \
- "${DISPLAY_QUIRK_S3_MODE}" = "true" ]; then
- sysctl -w kernel.acpi_video_flags=3
- elif [ "${DISPLAY_QUIRK_S3_BIOS}" = "true" ]; then
- sysctl -w kernel.acpi_video_flags=1
- elif [ "${DISPLAY_QUIRK_S3_MODE}" = "true" ]; then
- sysctl -w kernel.acpi_video_flags=2
- else
- sysctl -w kernel.acpi_video_flags=0
- fi
-
- # We might need to do one or many of these quirks
- if [ "${DISPLAY_QUIRK_RADEON_OFF}" = "true" ]; then
- radeon dac off
- radeon light off
- fi
- if [ "${DISPLAY_QUIRK_VBESTATE_RESTORE}" = "true" ]; then
- vbe vbestate save > /var/run/vbestate
- fi
- if [ "${DISPLAY_QUIRK_VBEMODE_RESTORE}" = "true" ]; then
- vbe vbemode get > /var/run/vbemode
- fi
- if [ "${DISPLAY_QUIRK_VGA_MODE_3}" = "true" ]; then
- vbe vbemode set 3
- fi
- if [ "${DISPLAY_QUIRK_DPMS_SUSPEND}" = "true" ]; then
- vbe dpms suspend
- fi
-}
-
-
-case "$1" in
- suspend)
- suspend_video
- ;;
- hibernate)
- if [ "$HIBERNATE_RESUME_POST_VIDEO" = "yes" ]; then
- suspend_video
- fi
- ;;
-esac
diff --git a/pm/sleep.d/99video b/pm/sleep.d/99video
index 2797a06..d46fbfe 100755
--- a/pm/sleep.d/99video
+++ b/pm/sleep.d/99video
@@ -48,7 +48,38 @@ resume_fbcon()
echo 0 >"${con}"
done
}
+suspend_video()
+{
+ # 0=nothing, 1=s3_bios, 2=s3_mode, 3=both
+ if [ "${DISPLAY_QUIRK_S3_BIOS}" = "true" -a \
+ "${DISPLAY_QUIRK_S3_MODE}" = "true" ]; then
+ sysctl -w kernel.acpi_video_flags=3
+ elif [ "${DISPLAY_QUIRK_S3_BIOS}" = "true" ]; then
+ sysctl -w kernel.acpi_video_flags=1
+ elif [ "${DISPLAY_QUIRK_S3_MODE}" = "true" ]; then
+ sysctl -w kernel.acpi_video_flags=2
+ else
+ sysctl -w kernel.acpi_video_flags=0
+ fi
+ # We might need to do one or many of these quirks
+ if [ "${DISPLAY_QUIRK_RADEON_OFF}" = "true" ]; then
+ radeon dac off
+ radeon light off
+ fi
+ if [ "${DISPLAY_QUIRK_VBESTATE_RESTORE}" = "true" ]; then
+ vbe vbestate save > /var/run/vbestate
+ fi
+ if [ "${DISPLAY_QUIRK_VBEMODE_RESTORE}" = "true" ]; then
+ vbe vbemode get > /var/run/vbemode
+ fi
+ if [ "${DISPLAY_QUIRK_VGA_MODE_3}" = "true" ]; then
+ vbe vbemode set 3
+ fi
+ if [ "${DISPLAY_QUIRK_DPMS_SUSPEND}" = "true" ]; then
+ vbe dpms suspend
+ fi
+}
resume_video()
{
if [ "${DISPLAY_QUIRK_RADEON_OFF}" = "true" ]; then
@@ -80,6 +111,12 @@ resume_video()
case "$1" in
suspend)
save_fbcon
+ suspend_video
+ ;;
+ hibernate)
+ if [ "$HIBERNATE_RESUME_POST_VIDEO" = "yes" ]; then
+ suspend_video
+ fi
;;
resume)
resume_video