diff options
author | Victor Lowther <victor.lowther@gmail.com> | 2009-11-07 23:21:45 -0600 |
---|---|---|
committer | Victor Lowther <victor.lowther@gmail.com> | 2009-11-07 23:21:45 -0600 |
commit | 504faf0a0c31cbdbc03a608cf633d58f12e49eb7 (patch) | |
tree | ebef5e9d0c151775067e7b3de7e9436fdeaf0fc3 | |
parent | b01d306fbba7dd8d7ab68a5a8c850472e9273277 (diff) |
Make kernel modesetting detection a little smarter.
It turns out that the method we were using to detect kernel modesetting
support was not very accurate. It turns out there is no bulletproof way
for us to tell if KMS is being used, but Michael Biebl found a way that
sucks less than out current method. Hopefully the framebuffer drivers
will grow a flag in sysfs somewhere that tells us that KMS is in use.
-rwxr-xr-x | pm/sleep.d/98smart-kernel-video | 28 |
1 files changed, 4 insertions, 24 deletions
diff --git a/pm/sleep.d/98smart-kernel-video b/pm/sleep.d/98smart-kernel-video index 6ec301b..11b5490 100755 --- a/pm/sleep.d/98smart-kernel-video +++ b/pm/sleep.d/98smart-kernel-video @@ -32,9 +32,9 @@ 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 '(noveau|drm)fb' /proc/fb || return 1 remove_all_video_quirks - add_parameter --quirk-no-chvt + add_parameters --quirk-no-chvt } have_nvidia() @@ -44,6 +44,7 @@ have_nvidia() # suspend/resume in a quirk-free manner. [ -d /sys/module/nvidia ] || return 1 remove_all_video_quirks + add_parameters --quirk-no-chvt } have_fglrx() @@ -53,30 +54,9 @@ 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 |