[Pm-utils] [PATCH] Set default quirk policy based on drivers

Victor Lowther victor.lowther at gmail.com
Fri May 16 18:01:16 PDT 2008


On Sat, 2008-05-17 at 01:51 +0100, Matthew Garrett wrote:
> On Fri, May 16, 2008 at 07:46:23PM -0500, Victor Lowther wrote:
> 
> > While I am thinking about it, the only set if suspend quirks that it is
> > not immediatly obvious we should skip while suspending if our kernel
> > video driver is smart enough is the ACPI S3 set -- guidance?
> 
> Oh, that's a good point. No, the /proc quirks shouldn't be set if the 
> kernel driver can restore state. They'd need to be skipped. Good catch!

In that case, the way I would handle things would be to just disable
99video if our kernel drivers are smart enough in a separate hook --
something alongthe lines of:

#!/bin/sh

. "${PM_FUNCTIONS}"

smart_kernel_video() 
{
        # If we are using an ATI or nVidia binary driver, do nothing.
	[ -d /sys/module/nvidia -o -d /sys/module/fglrx ] && return 0;

	local kernel_rev="$(uname -r |awk -F '[_-]' '{print $1}')"
        # Intel can to the same thing, but only at or after kernel 2.6.26.
	# FIXME: a more accurate way of testing this?
	[ -d /sys/module/i915 ] && \
	    [ "$kernel_rev" >= "2.6.26" ] && return 0;
	return 1
}

case $1 in 
	suspend|hibernate) smart_kernel_video && disablehook 99video ;;
	*) exit 0 ;;
esac


-- 
Victor Lowther
Ubuntu Certified Professional



More information about the Pm-utils mailing list