summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2007-02-20 18:54:26 +0000
committerPeter Jones <pjones@redhat.com>2007-02-20 18:54:26 +0000
commit6c7a86e783f39d7767e2537129494823e2de4ca9 (patch)
tree42399952487ada7465fad6877878a32f1a8bb6d1 /pm
parent1014e2094be149ff3086bafe5de368d3f498705d (diff)
- split 20video's resume/thaw components out to 99video so it'll run sooner.
Diffstat (limited to 'pm')
-rwxr-xr-xpm/hooks/20video29
-rwxr-xr-xpm/hooks/99video64
-rw-r--r--pm/hooks/Makefile.am3
3 files changed, 66 insertions, 30 deletions
diff --git a/pm/hooks/20video b/pm/hooks/20video
index cc14d00..3091e2d 100755
--- a/pm/hooks/20video
+++ b/pm/hooks/20video
@@ -56,45 +56,16 @@ suspend_video()
fi
}
-resume_video()
-{
- if [ ${DISPLAY_QUIRK_RADEON_OFF} == "true" ]; then
- radeon dac on
- radeon light on
- fi
- # We might need to do one or many of these quirks
- if [ ${DISPLAY_QUIRK_VBE_POST} == "true" ]; then
- vbe post </dev/tty0
- usleep 100000
- fi
- if [ ${DISPLAY_QUIRK_VBESTATE_RESTORE} == "true" ]; then
- vbe vbestate restore < /var/run/vbestate
- fi
- if [ ${DISPLAY_QUIRK_VBEMODE_RESTORE} == "true" ]; then
- vbe vbemode set `cat /var/run/vbemode`
- fi
- if [ ${DISPLAY_QUIRK_DPMS_ON} == "true" ]; then
- vbe dpms on
- fi
-}
case "$1" in
suspend)
suspend_video
;;
- resume)
- resume_video
- ;;
hibernate)
if [ "x$HIBERNATE_RESUME_POST_VIDEO" == "xyes" ]; then
suspend_video
fi
;;
- thaw)
- if [ "x$HIBERNATE_RESUME_POST_VIDEO" == "xyes" ]; then
- resume_video
- fi
- ;;
esac
exit $?
diff --git a/pm/hooks/99video b/pm/hooks/99video
new file mode 100755
index 0000000..ec204c9
--- /dev/null
+++ b/pm/hooks/99video
@@ -0,0 +1,64 @@
+#!/bin/bash
+#
+# 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.
+
+. /etc/pm/functions
+
+vbetool=$(type -p vbetool)
+vbe() {
+ if [ -z "$vbetool" ]; then
+ echo "vbetool not found" 1>&2
+ return 1
+ fi
+ $vbetool "$@"
+}
+
+radeontool=$(type -p radeontool)
+radeon() {
+ if [ -z "$radeontool" ]; then
+ echo "radeontool not found" 1>&2
+ return 1
+ fi
+ $radeontool "$@"
+}
+
+resume_video()
+{
+ if [ ${DISPLAY_QUIRK_RADEON_OFF} == "true" ]; then
+ radeon dac on
+ radeon light on
+ fi
+ # We might need to do one or many of these quirks
+ if [ ${DISPLAY_QUIRK_VBE_POST} == "true" ]; then
+ vbe post </dev/tty0
+ usleep 100000
+ fi
+ if [ ${DISPLAY_QUIRK_VBESTATE_RESTORE} == "true" ]; then
+ vbe vbestate restore < /var/run/vbestate
+ fi
+ if [ ${DISPLAY_QUIRK_VBEMODE_RESTORE} == "true" ]; then
+ vbe vbemode set `cat /var/run/vbemode`
+ fi
+ if [ ${DISPLAY_QUIRK_DPMS_ON} == "true" ]; then
+ vbe dpms on
+ fi
+}
+
+
+case "$1" in
+ resume)
+ resume_video
+ ;;
+ thaw)
+ if [ "x$HIBERNATE_RESUME_POST_VIDEO" == "xyes" ]; then
+ resume_video
+ fi
+ ;;
+esac
+
+exit $?
diff --git a/pm/hooks/Makefile.am b/pm/hooks/Makefile.am
index 039d57a..60790d3 100644
--- a/pm/hooks/Makefile.am
+++ b/pm/hooks/Makefile.am
@@ -12,7 +12,8 @@ sleep_SCRIPTS = \
65alsa \
90clock \
94cpufreq \
- 95led
+ 95led \
+ 99video
EXTRA_DIST=$(sleep_SCRIPTS)