[PATCH] Skip chvt and S3 hooks if kernel modesetting is active.

Kristian Høgsberg krh at redhat.com
Thu Mar 12 14:47:01 PDT 2009


---
 pm/functions.in                 |    5 +++++
 pm/sleep.d/90chvt               |    2 ++
 pm/sleep.d/98smart-kernel-video |    2 ++
 3 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/pm/functions.in b/pm/functions.in
index bd0705c..e996d41 100644
--- a/pm/functions.in
+++ b/pm/functions.in
@@ -246,3 +246,8 @@ dbus_send ()
 {
 	command dbus-send "$@" 2>/dev/null || return $NA
 }
+
+kms_active()
+{
+        test -d /sys/class/drm/card0/device/graphics/fb0
+}
diff --git a/pm/sleep.d/90chvt b/pm/sleep.d/90chvt
index 47a2c85..61189f0 100755
--- a/pm/sleep.d/90chvt
+++ b/pm/sleep.d/90chvt
@@ -5,6 +5,8 @@
 
 . "${PM_FUNCTIONS}"
 
+kms_active && exit 0
+
 case "$1" in
 	hibernate|suspend)
 		fgconsole |savestate console
diff --git a/pm/sleep.d/98smart-kernel-video b/pm/sleep.d/98smart-kernel-video
index 1043e94..6340afb 100755
--- a/pm/sleep.d/98smart-kernel-video
+++ b/pm/sleep.d/98smart-kernel-video
@@ -72,6 +72,8 @@ smart_kernel_intel()
 	--quirk-radeon-off \
 	--quirk-no-fb \
 	--quirk-pci-save
+
+    kms_active && remove_parameters --quirk-s3-mode --quirk-s3-bios
 }
 
 smart_kernel_video() 
-- 
1.6.1.3


--=-vMOoAa1t1bmw9IRZaSiK--



More information about the Pm-utils mailing list