[Pm-utils] [PATCH 6/7] This patch adds framebuffer console handling routines.

Victor Lowther victor.lowther at gmail.com
Tue Feb 12 17:38:08 PST 2008


It is the only thing that we were missing from the s2ram tools.
---
 pm/sleep.d/99video |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/pm/sleep.d/99video b/pm/sleep.d/99video
index 82f0469..a513d14 100755
--- a/pm/sleep.d/99video
+++ b/pm/sleep.d/99video
@@ -30,6 +30,19 @@ else
 	radeon() { echo "radeontool not found" 1>&2; return 1; }
 fi
 
+save_fbcon(){
+	local con
+	for con in /sys/class/graphics/*/state; do
+		echo 1 >"${con}"
+	done
+}
+
+resume_fbcon(){
+	local con
+	for con in /sys/class/graphics/*/state; do
+		echo 0 >"${con}"
+	done
+
 resume_video()
 {
 	if [ "${DISPLAY_QUIRK_RADEON_OFF}" = "true" ]; then
@@ -47,6 +60,8 @@ resume_video()
 	if [ "${DISPLAY_QUIRK_VBEMODE_RESTORE}" = "true" ]; then
 		vbe vbemode set "$(cat /var/run/vbemode)"
 	fi
+	# based on data from s2ram
+	resume_fbcon
 	if [ "${DISPLAY_QUIRK_DPMS_ON}" = "true" ]; then
 		vbe dpms on
 	fi
@@ -57,6 +72,7 @@ resume_video()
 
 
 case "$1" in
+	suspend|hibernate|suspend_hybrid) save_fbcon ;;
 	resume)
 		resume_video
 		;;
-- 
1.5.3.8



More information about the Pm-utils mailing list