hal/tools/linux hal-system-video-resume-linux, NONE, 1.1 hal-system-video-suspend-linux, NONE, 1.1

Richard Hughes hughsient at kemper.freedesktop.org
Fri Jun 9 03:10:07 PDT 2006


Update of /cvs/hal/hal/tools/linux
In directory kemper:/tmp/cvs-serv26319/tools/linux

Added Files:
	hal-system-video-resume-linux hal-system-video-suspend-linux 
Log Message:
2006-06-09  Richard Hughes  <richard at hughsie.com>

* tools/hal-system-video-resume:
* tools/hal-system-video-suspend:
* tools/linux/hal-system-video-resume-linux:
* tools/linux/hal-system-video-suspend-linux:
Add the video adapter suspend and resume functionality so we can just
drop in one fdi file and get the adapter to do the correct thing.

--- NEW FILE: hal-system-video-resume-linux ---
#!/bin/sh
#
# Copyright (C) 2006 Richard Hughes <richard at hughsie.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# Check we are the root user
if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
    echo "org.freedesktop.Hal.Device.Video.PermissionDeniedByUID" >&2
    echo "hal-system-video-resume refused uid $HAL_METHOD_INVOKED_BY_UID" >&2
    exit 1
fi

# We might need to do one or many of these quirks
if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBE_POST" == "true" ]; then
	/usr/sbin/vbetool post
fi
if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBESTATE_RESTORE" == "true" ]; then
	/usr/sbin/vbetool vbestate restore < /var/run/vbestate
fi
if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBEMODE_RESTORE" == "true" ]; then
	/usr/sbin/vbetool vbemode set `cat /var/run/vbemode`
fi
if [ "$HAL_PROP_VIDEO_ADAPTER_PM_DPMS_ON" == "true" ]; then
	/usr/sbin/vbetool dpms on > /dev/null 2>&1
fi

exit 0

--- NEW FILE: hal-system-video-suspend-linux ---
#!/bin/sh
#
# Copyright (C) 2006 Richard Hughes <richard at hughsie.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.

# Check we are the root user
if [ "$HAL_METHOD_INVOKED_BY_UID" != "0" ] ; then
    echo "org.freedesktop.Hal.Device.Video.PermissionDeniedByUID" >&2
    echo "hal-system-video-suspend refused uid $HAL_METHOD_INVOKED_BY_UID" >&2
    exit 1
fi

# 1=s3_bios, 2=s3_mode, 3=both
if [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_BIOS" == "true" ] && [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_MODE" == "true" ]; then
	echo -n 3 > /proc/sys/kernel/acpi_video_flags
elif [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_BIOS" == "true" ]; then
	echo -n 1 > /proc/sys/kernel/acpi_video_flags
elif [ "$HAL_PROP_VIDEO_ADAPTER_PM_S3_MODE" == "true" ]; then
	echo -n 2 > /proc/sys/kernel/acpi_video_flags
fi

# We might need to do one or many of these quirks
#if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VGA_MODE_3" == "true" ]; then
#	# TODO: we need to set mode3
#fi
if [ "$HAL_PROP_VIDEO_ADAPTER_PM_DPMS_SUSPEND" == "true" ]; then
	/usr/sbin/vbetool dpms suspend
fi
if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBESTATE_RESTORE" == "true" ]; then
	/usr/sbin/vbetool vbestate save > /var/run/vbestate
fi
if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBEMODE_RESTORE" == "true" ]; then
	/usr/sbin/vbetool vbemode get > /var/run/vbemode
fi

exit 0




More information about the hal-commit mailing list