owend - you are a champion!
This is what I did.
I had a look at /usr/lib/hal/scripts/linux/hal-system-power-suspend-linux and worked out that with my graphics card some quirks were already being enabled, but not all. Thus to the 'non NEW_INTEL, nVidia, ATI' section of the script, I enabled the S3_BIOS, S3_MODE, and DPMS_SUSPEND quirks, so that my hal-systempower-suspend-linux script now looks like this:
Code:
#!/bin/sh
alarm_not_supported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.AlarmNotSupported >&2
echo Waking the system up is not supported >&2
exit 1
}
unsupported() {
echo org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported >&2
echo No suspend method found >&2
exit 1
}
read seconds_to_sleep
# on some video drivers we must ignore video quirks, since they break
# on them; this particularly affects Intel >= 915G and the proprietary
# nvidia and fglrx drivers.
if [ -d /sys/module/i915 ]; then
# the i915 kmod also drives the i830 and i855 chips nowadays, but they
# still need quirks on at least Linux 2.6.24.
PRODID=`hal-get-property --udi $HAL_PROP_INFO_UDI --key system.hardware.primary_video.product`
if [ "$PRODID" != 13696 ] && [ "$PRODID" != 13698 ] && \
[ "$PRODID" != 13687 ]; then
NEW_INTEL=1
fi
fi
if [ "$NEW_INTEL" ] || [ -d /sys/module/nvidia ] || [ -d /sys/module/fglrx ];
then
HAL_PROP_POWER_MANAGEMENT_QUIRK_S3_BIOS=false
HAL_PROP_POWER_MANAGEMENT_QUIRK_S3_MODE=false
HAL_PROP_POWER_MANAGEMENT_QUIRK_DPMS_SUSPEND=false
HAL_PROP_POWER_MANAGEMENT_QUIRK_DPMS_ON=false
HAL_PROP_POWER_MANAGEMENT_QUIRK_VBESTATE_RESTORE=false
HAL_PROP_POWER_MANAGEMENT_QUIRK_VBEMODE_RESTORE=false
HAL_PROP_POWER_MANAGEMENT_QUIRK_VGA_MODE_3=false
HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST=false
HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF=false
HAL_PROP_POWER_MANAGEMENT_QUIRK_RESET_BRIGHTNESS=false
# if we do not have any explicit quirks in the hal FDIs, enable a few by
# default which work around kernel problems and are necessary with most older
# video drivers
elif ! env | grep -q HAL_PROP_POWER_MANAGEMENT_QUIRK; then
HAL_PROP_POWER_MANAGEMENT_QUIRK_S3_BIOS=true #added by DS
HAL_PROP_POWER_MANAGEMENT_QUIRK_S3_MODE=true #added by DS
HAL_PROP_POWER_MANAGEMENT_QUIRK_DPMS_SUSPEND=true #was false
HAL_PROP_POWER_MANAGEMENT_QUIRK_DPMS_ON=true
HAL_PROP_POWER_MANAGEMENT_QUIRK_VBESTATE_RESTORE=true
HAL_PROP_POWER_MANAGEMENT_QUIRK_VBEMODE_RESTORE=true
HAL_PROP_POWER_MANAGEMENT_QUIRK_VGA_MODE_3=true
HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST=true
HAL_PROP_POWER_MANAGEMENT_QUIRK_RESET_BRIGHTNESS=true
fi
# Make a suitable command line argument so that the tools can do the correct
# quirks for video resume.
# Passing the quirks to the tool allows the tool to not depend on HAL for data.
QUIRKS=""
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_S3_BIOS" = "true" ] && QUIRKS="$QUIRKS --quirk-s3-bios"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_S3_MODE" = "true" ] && QUIRKS="$QUIRKS --quirk-s3-mode"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_DPMS_SUSPEND" = "true" ] && QUIRKS="$QUIRKS --quirk-dpms-suspend"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_DPMS_ON" = "true" ] && QUIRKS="$QUIRKS --quirk-dpms-on"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBESTATE_RESTORE" = "true" ] && QUIRKS="$QUIRKS --quirk-vbestate-restore"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBEMODE_RESTORE" = "true" ] && QUIRKS="$QUIRKS --quirk-vbemode-restore"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VGA_MODE_3" = "true" ] && QUIRKS="$QUIRKS --quirk-vga-mode3"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBE_POST" = "true" ] && QUIRKS="$QUIRKS --quirk-vbe-post"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && QUIRKS="$QUIRKS --quirk-radeon-off"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RESET_BRIGHTNESS" = "true" ] && QUIRKS="$QUIRKS --quirk-reset-brightness"
[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_NONE" = "true" ] && QUIRKS="$QUIRKS --quirk-none"
# Urh. Do any BIOSen handle this correctly?
if [ $seconds_to_sleep != "0" ] ; then
alarm_not_supported
fi
# We only support pm-utils
if [ -x "/usr/sbin/pm-suspend" ] ; then
/usr/sbin/pm-suspend $QUIRKS
RET=$?
else
# TODO: add support
unsupported
fi
# Refresh devices as a resume can do funny things
for type in button battery ac_adapter
do
devices=`hal-find-by-capability --capability $type`
for device in $devices
do
dbus-send --system --print-reply --dest=org.freedesktop.Hal \
$device org.freedesktop.Hal.Device.Rescan
done
done
exit $RET
(In the middle there are three lines that I've changed.)
I'll probably fiddle with this a little more over the next few days to see which of the quirks was the one that was needed, but for now, I'm just stocked that I've got suspend working!
Bookmarks