Hi,

the current 98smart-kernel-video shell script is imho overly
complicated and actual error prone.
E.g. have_kms checks for
[ -d /sys/class/drm/card0/device/graphics/fb0 ] || return 1
and then removes all quirks.

But any framebuffer driver (like radeonfb or vesafb) creates that
directory, and removing the quirks will lead to failing suspends.

I had a lengthy irc discussion on #irc (see [1]) and as result I
propose the following patch:
remove have_smart_intel
change have_kms and grep for noveaufb|drmfb in /proc/fb

Patch is attached.

Comments welcome.
If there are no complaints, I'm going to commit this patch and intend
to apply it to the Debian pm-utils package.

Cheers,
Michael


[1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=517651

-- 
Why is it that all of the instruments seeking intelligent life in the
universe are pointed away from Earth?
diff --git a/pm/sleep.d/98smart-kernel-video b/pm/sleep.d/98smart-kernel-video
index 6ec301b..3f94b6f 100755
--- a/pm/sleep.d/98smart-kernel-video
+++ b/pm/sleep.d/98smart-kernel-video
@@ -32,7 +32,7 @@ have_kms()
 {
     # if we are running with a KMS-enabled video driver, we should not
     # attempt to run any quirks
-    [ -d /sys/class/drm/card0/device/graphics/fb0 ] || return 1
+    grep -q -E '(noveaufb|drmfb)' /proc/fb || return 1
     remove_all_video_quirks
     add_parameter --quirk-no-chvt
 }
@@ -53,30 +53,10 @@ have_fglrx()
     remove_all_video_quirks
 }
 
-have_smart_intel()
-{
-    # currently, intel kernel modesetting is not quite smart enough
-    # we still need acpi s3 kernel modesetting hooks, so don't remove those
-    # options if they were passed.
-    [ -d /sys/module/i915 ] || return 1
-    local kernel_rev="$(uname -r |awk -F '[_-]' '{print $1}')"
-    [ "$kernel_rev" \> "2.6.26" -o "$kernel_rev" = "2.6.26" ] || return 1
-    remove_parameters --quirk-dpms-on \
-    	--quirk-dpms-suspend \
-	--quirk-vbe-post \
-	--quirk-vbe-post \
-	--quirk-vga-mode3 \
-	--quirk-vbemode-restore \
-	--quirk-vbestate-restore \
-	--quirk-reset-brightness \
-	--quirk-radeon-off \
-	--quirk-no-fb \
-	--quirk-pci-save
-}
 
 smart_kernel_video() 
 {
-    have_kms || have_nvidia || have_fglrx || have_smart_intel || return $NA
+    have_kms || have_nvidia || have_fglrx || return $NA
 }
 
 case $1 in
_______________________________________________
Pm-utils mailing list
Pm-utils@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/pm-utils

Reply via email to