On Thu, 2009-03-12 at 19:22 -0700, Dan Nicholson wrote:
> On Thu, Mar 12, 2009 at 4:41 PM, Victor Lowther
> <victor.lowt...@gmail.com> wrote:
> > On Mar 12, 2009, at 4:58 PM, Kristian Høgsberg <k...@redhat.com> wrote:
> >
> >> Hi Victor,
> >>
> >> I'm attaching a patch that I've just added to pm-utils in Fedora
> >> Rawhide.  With a kernel modesetting capable drm driver and DRI2, we no
> >> longer need to chvt away from X to suspend and resume correctly.
> >> We'll
> >> keep it in rawhide and see how it goes, but I've tested it on a
> >> bunch of
> >> intel machines and it works.  Dave Airlie is testing this with radeon
> >> modesetting and it should work there too.
> >
> > No problem - I have been waiting for KMS to hit mainline before
> > patching pm-utils myself.
> 
> Speaking of which, right now smart_kernel_intel() doesn't disable the
> S3 hooks. I think with KMS, we shouldn't need to run any video hooks.
> So, perhaps something like this should be added:
> 
> local kms=`cat /sys/module/i915/parameters/modeset 2>/dev/null`
> [ "$kms" = 1 ] && remove_parameters --quirk-s3-mode --quirk-s3-bios

I'm using 

kms_active()
{
        test -d /sys/class/drm/card0/device/graphics/fb0
}

to test for modesetting and I think it's a little better for a couple of
reasons: you could pass modeset=1 to the module and still not get
modesetting, whereas testing for the fb0 directory there only returns
true if modesetting actually kicked in.  Second, it's chipset
independent.

Not sure what the s3 hooks do, but it sounds plausible that we won't
need them with a KMS driver.

Here's an update version of the patch that moves the kms detection in
pm/functions.in and also disables the s3 hooks.

cheers,
Kristian





>From e52c2ac53fff0d08d3aa2ed4313cef254f9a2098 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Kristian=20H=C3=B8gsberg?= <k...@redhat.com>
Date: Thu, 12 Mar 2009 17:47:01 -0400
Subject: [PATCH] Skip chvt and S3 hooks if kernel modesetting is active.

---
 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

_______________________________________________
Pm-utils mailing list
Pm-utils@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pm-utils

Reply via email to