hal: Branch 'origin' - 6 commits

David Zeuthen david at kemper.freedesktop.org
Tue Feb 20 14:27:55 PST 2007


 doc/api/.gitignore                           |    1 
 doc/spec/.gitignore                          |    1 
 doc/spec/Makefile.am                         |   39 +++++++++----------
 doc/spec/hal-spec-properties.xml             |    8 +++
 tools/linux/hal-system-power-hibernate-linux |   18 +++++++-
 tools/linux/hal-system-power-suspend-linux   |   29 ++++++++------
 tools/linux/hal-system-video-resume-linux    |   55 ---------------------------
 tools/linux/hal-system-video-suspend-linux   |   52 -------------------------
 8 files changed, 62 insertions(+), 141 deletions(-)

New commits:
diff-tree 7b83d3fae632f62cef2edc6729911e4192426824 (from c62548b8192a28c9a4a330e456a7febfe39a5d09)
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Feb 20 21:30:03 2007 +0000

    add --quirk-radeon-off
    
    On Tue, 2007-02-20 at 20:27 +0000, Richard Hughes wrote:
    > On Tue, 2007-02-20 at 15:19 -0500, Peter Jones wrote:
    > >
    > > David and I were talking about the quirk- thing on irc, and decided to
    > > leave it in.  It doesn't hurt anything, and it makes them sort into
    > > one
    > > block in e.g. the --help output.
    >
    > Cool, fine for me. David, okay to commit the HAL side of the patch?
    
    Sure; remember to add the --quirk-radeon-off stuff too. Thanks!
    
        David

diff --git a/doc/spec/hal-spec-properties.xml b/doc/spec/hal-spec-properties.xml
index 3a5813e..5e5aa2a 100644
--- a/doc/spec/hal-spec-properties.xml
+++ b/doc/spec/hal-spec-properties.xml
@@ -5664,6 +5664,14 @@
               <entry>No</entry>
               <entry>Save the VGA BIOS mode before suspend, and restore it on resume.</entry>
             </row>
+            <row>
+              <entry>
+                <literal>power_management.quirk.radeon_off</literal> (bool)
+              </entry>
+              <entry></entry>
+              <entry>No</entry>
+              <entry>Turn off the Radeon DAC off before suspend.</entry>
+            </row>
           </tbody>
         </tgroup>
       </informaltable>
diff --git a/tools/linux/hal-system-power-hibernate-linux b/tools/linux/hal-system-power-hibernate-linux
index d17a8e8..250e191 100755
--- a/tools/linux/hal-system-power-hibernate-linux
+++ b/tools/linux/hal-system-power-hibernate-linux
@@ -22,6 +22,7 @@ QUIRKS=""
 [ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBEMODE_RESTORE" = "true" ] && QUIRKS="$QUIRKS --quirk-vbemode"
 [ "$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-vbepost"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && QUIRKS="$QUIRKS --quirk-radeon-off"
 
 #ALTLinux only supports powersave
 if [ -f /etc/altlinux-release ] ; then
diff --git a/tools/linux/hal-system-power-suspend-linux b/tools/linux/hal-system-power-suspend-linux
index 1dd1a68..8139842 100755
--- a/tools/linux/hal-system-power-suspend-linux
+++ b/tools/linux/hal-system-power-suspend-linux
@@ -30,6 +30,7 @@ QUIRKS=""
 [ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBEMODE_RESTORE" = "true" ] && QUIRKS="$QUIRKS --quirk-vbemode"
 [ "$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-vbepost"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_RADEON_OFF" = "true" ] && QUIRKS="$QUIRKS --quirk-radeon-off"
 
 #PMU systems cannot use /sys/power/state yet, so use a helper to issue an ioctl
 if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" = "pmu" ]; then
diff-tree c62548b8192a28c9a4a330e456a7febfe39a5d09 (from 616a90266ec908c25d479def0378cc567c971fc0)
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Feb 20 21:12:48 2007 +0000

    remove the zzz script from suspend
    
    Remove the zzz freebsd script from the linux suspend script.
    It's never going to match.

diff --git a/tools/linux/hal-system-power-suspend-linux b/tools/linux/hal-system-power-suspend-linux
index d5ae5f2..1dd1a68 100755
--- a/tools/linux/hal-system-power-suspend-linux
+++ b/tools/linux/hal-system-power-suspend-linux
@@ -83,15 +83,6 @@ elif [ -f "/etc/redhat-release" ] || [ -
 		unsupported
 	fi
 
-#FreeBSD uses zzz to suspend for both ACPI and APM
-elif [ "x`uname -s`" = "xFreeBSD" ] ; then
-	if [ -x /usr/sbin/zzz ] ; then
-		/usr/sbin/zzz
-		RET=$?
-	else
-		unsupported
-	fi
-
 #Other distros just need to have *any* tools installed
 else
 	if [ -x "/usr/bin/powersave" ] ; then
diff-tree 616a90266ec908c25d479def0378cc567c971fc0 (from 5845d62c44246292d7c083ea2ea46a3322d482cd)
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Feb 20 21:11:32 2007 +0000

    remove the hal-system-video-*-linux files
    
    Remove the hal-system-video-suspend-linux and hal-system-video-resume-linux files
    as they are now obsolete.

diff --git a/tools/linux/hal-system-video-resume-linux b/tools/linux/hal-system-video-resume-linux
deleted file mode 100755
index 852ee76..0000000
--- a/tools/linux/hal-system-video-resume-linux
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/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
-
-checkvbetool() {
-    if ! [ -x "/usr/sbin/vbetool" ]; then
-        echo org.freedesktop.Hal.Device.Video.NotSupported >&2
-        echo vbetool not found or not executable >&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
-	checkvbetool
-	/usr/sbin/vbetool post
-fi
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBESTATE_RESTORE" == "true" ]; then
-	checkvbetool
-	if [ -f /var/run/vbestate ]; then
-		/usr/sbin/vbetool vbestate restore < /var/run/vbestate
-	else
-		echo org.freedesktop.Hal.Device.Video.UnableToRetore>&2
-	        echo /var/run/vbestate is missing, can not restore >&2
-        	exit 1
-	fi
-fi
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBEMODE_RESTORE" == "true" ]; then
-	checkvbetool
-	if [ -f /var/run/vbemode ]; then
-		/usr/sbin/vbetool vbemode set `cat /var/run/vbemode`
-	else
-		echo org.freedesktop.Hal.Device.Video.UnableToRetore>&2
-	        echo /var/run/vbemode is missing, can not restore >&2
-        	exit 1
-	fi
-fi
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_DPMS_ON" == "true" ]; then
-	checkvbetool
-	/usr/sbin/vbetool dpms on > /dev/null 2>&1
-fi
-
-exit 0
diff --git a/tools/linux/hal-system-video-suspend-linux b/tools/linux/hal-system-video-suspend-linux
deleted file mode 100755
index 7d6214b..0000000
--- a/tools/linux/hal-system-video-suspend-linux
+++ /dev/null
@@ -1,52 +0,0 @@
-#!/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
-
-checkvbetool() {
-    if ! [ -x "/usr/sbin/vbetool" ]; then
-        echo org.freedesktop.Hal.Device.Video.NotSupported >&2
-        echo vbetool not found or not executable >&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
-	checkvbetool
-	/usr/sbin/vbetool dpms suspend
-fi
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBESTATE_RESTORE" == "true" ]; then
-	checkvbetool
-	/usr/sbin/vbetool vbestate save > /var/run/vbestate
-fi
-if [ "$HAL_PROP_VIDEO_ADAPTER_PM_VBEMODE_RESTORE" == "true" ]; then
-	checkvbetool
-	/usr/sbin/vbetool vbemode get > /var/run/vbemode
-fi
-
-exit 0
diff-tree 5845d62c44246292d7c083ea2ea46a3322d482cd (from b40dcd58b29efc7d5fb91121a08e48677d8944be)
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Feb 20 20:55:11 2007 +0000

    remove bak files from git-status output
    
    .bak files show up everytime the docbook is regenerated. Ignore them.

diff --git a/doc/api/.gitignore b/doc/api/.gitignore
index bffaf95..cc347ad 100644
--- a/doc/api/.gitignore
+++ b/doc/api/.gitignore
@@ -8,6 +8,7 @@ hal.interfaces
 hal.prerequisites
 hal.signals
 *.txt
+*.bak
 *.args
 *.stamp
 *.o
diff-tree b40dcd58b29efc7d5fb91121a08e48677d8944be (from 273d1dba0685772ca037063a6cfc4c6cb89438e9)
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Feb 20 20:53:22 2007 +0000

    remove hal-spec.html from the tarball
    
    On Tue, 2007-02-20 at 01:11 -0500, David Zeuthen wrote:
    > as it rendered the commit logs virtually unreadable. Downside is that
    > it's a bit harder to look at the current spec but we ought to solve
    > that
    > in other ways.
    >
    > Btw, feel free to commit a fix for this. Thanks :-)
    
    Well, we have two options:
    
    1. Force anybody that does make distcheck to use --enable-docbook-docs
    so that the html file gets created.
    2. Remove the html from the tarball
    
    I personally think that the hal spec should be a static html file on the
    hal fd.o page (and therefore removed from the tarball), or created using
    a post-commit hook as Rob suggested.
    
    Richard.

diff --git a/doc/spec/.gitignore b/doc/spec/.gitignore
index f9f6e10..7dfba52 100644
--- a/doc/spec/.gitignore
+++ b/doc/spec/.gitignore
@@ -1,5 +1,6 @@
 Makefile
 Makefile.in
 hal-spec.xml
+hal-spec.html
 *.o
 *~
diff --git a/doc/spec/Makefile.am b/doc/spec/Makefile.am
index 65d0772..8d69843 100644
--- a/doc/spec/Makefile.am
+++ b/doc/spec/Makefile.am
@@ -1,16 +1,16 @@
 
-FIGURE_FILES =                  \
-	hal-arch.png            \
-	hal-devices1.png        \
-	hal-fdi-example1.png    \
-	hal-fdi-example2.png    \
-	hal-fdi-example3.png	\
+FIGURE_FILES =				\
+	hal-arch.png			\
+	hal-devices1.png		\
+	hal-fdi-example1.png		\
+	hal-fdi-example2.png		\
+	hal-fdi-example3.png		\
 	hal-linux26.png	
 
-SPEC_XML_EXTRA_FILES =                    \
-	hal-spec-examples.xml       \
-	hal-spec-introduction.xml   \
-	hal-spec-fdi-files.xml      \
+SPEC_XML_EXTRA_FILES =			\
+	hal-spec-examples.xml		\
+	hal-spec-introduction.xml	\
+	hal-spec-fdi-files.xml		\
 	hal-spec-properties.xml
 
 if DOCBOOK_DOCS_ENABLED
@@ -29,13 +29,12 @@ clean-local:
 
 endif # DOCBOOK_DOCS_ENABLED
 
-EXTRA_DIST =              \
-  hal-spec.html           \
-  hal-spec.xml.in         \
-  config.xsl              \
-  docbook.css             \
-  $(SPEC_XML_EXTRA_FILES) \
-  example-manager.py	  \
-  hal-arch.dia	          \
-  hal-linux26.dia         \
-  $(FIGURE_FILES)
+EXTRA_DIST =				\
+	hal-spec.xml.in			\
+	config.xsl			\
+	docbook.css			\
+	$(SPEC_XML_EXTRA_FILES)		\
+	example-manager.py		\
+	hal-arch.dia			\
+	hal-linux26.dia			\
+	$(FIGURE_FILES)
diff-tree 273d1dba0685772ca037063a6cfc4c6cb89438e9 (from a738fb6d5156e8ab4d1cdfc85d4f413e7204812c)
Author: Richard Hughes <richard at hughsie.com>
Date:   Tue Feb 20 20:50:05 2007 +0000

    make the hal suspend and hibernate scripts use the quirk command line of pm-utils
    
    On Tue, 2007-02-20 at 00:59 -0500, David Zeuthen wrote:
    >  1. Need a pm-utils release and the associated glue for HAL. Richard,
    >     can you drive this one (I can throw staplers at Peter if needed)?
    >     Thanks! This is a release blocker.
    
    Attached patches (to pm-utils and HAL) propagate the quirk information
    onto the tools via the command line.
    
    Lightly tested by me.
    
    Richard.
    
    p.s. Throw the stapler now.

diff --git a/tools/linux/hal-system-power-hibernate-linux b/tools/linux/hal-system-power-hibernate-linux
index 632acb6..d17a8e8 100755
--- a/tools/linux/hal-system-power-hibernate-linux
+++ b/tools/linux/hal-system-power-hibernate-linux
@@ -10,6 +10,19 @@ unsupported() {
 	exit 1
 }
 
+# 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"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBEMODE_RESTORE" = "true" ] && QUIRKS="$QUIRKS --quirk-vbemode"
+[ "$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-vbepost"
+
 #ALTLinux only supports powersave
 if [ -f /etc/altlinux-release ] ; then
 	if [ -x /usr/bin/powersave ] ; then
@@ -32,7 +45,7 @@ elif [ -f /etc/mandriva-release ] ; then
 elif [ -f /etc/redhat-release ] || [ -f /etc/fedora-release ] \
 		 || [ -f "/etc/SuSE-release" ] ; then
 	if [ -x /usr/sbin/pm-hibernate ] ; then
-		/usr/sbin/pm-hibernate
+		/usr/sbin/pm-hibernate $QUIRKS
 		RET=$?
 	else
 		unsupported
@@ -47,7 +60,7 @@ else
 		/usr/sbin/pmi action hibernate force
 		RET=$?
 	elif [ -x "/usr/sbin/pm-hibernate" ] ; then
-		/usr/sbin/pm-hibernate
+		/usr/sbin/pm-hibernate $QUIRKS
 		RET=$?
 	elif [ -x "/usr/sbin/hibernate" ] ; then
 		# Suspend2 tools installed
diff --git a/tools/linux/hal-system-power-suspend-linux b/tools/linux/hal-system-power-suspend-linux
index 180d4a1..d5ae5f2 100755
--- a/tools/linux/hal-system-power-suspend-linux
+++ b/tools/linux/hal-system-power-suspend-linux
@@ -18,8 +18,21 @@ unsupported() {
 
 read seconds_to_sleep
 
+# 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"
+[ "$HAL_PROP_POWER_MANAGEMENT_QUIRK_VBEMODE_RESTORE" = "true" ] && QUIRKS="$QUIRKS --quirk-vbemode"
+[ "$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-vbepost"
+
 #PMU systems cannot use /sys/power/state yet, so use a helper to issue an ioctl
-if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" == "pmu" ]; then
+if [ "$HAL_PROP_LAPTOP_PANEL_ACCESS_METHOD" = "pmu" ]; then
 	hal-system-power-pmu sleep
 	if [ $? -ne 0 ]; then
 		echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2
@@ -63,7 +76,7 @@ elif [ -f "/etc/redhat-release" ] || [ -
 	# TODO: fixup pm-suspend to define erroc code (see alarm above) and throw
 	#	   the appropriate exception
 	if [ -x "/usr/sbin/pm-suspend" ] ; then
-		/usr/sbin/pm-suspend
+		/usr/sbin/pm-suspend $QUIRKS
 		RET=$?
 	else
 		# TODO: add support
@@ -88,7 +101,7 @@ else
 	    /usr/sbin/pmi action suspend force
 	    RET=$?
 	elif [ -x "/usr/sbin/pm-suspend" ] ; then
-		/usr/sbin/pm-suspend
+		/usr/sbin/pm-suspend $QUIRKS
 		RET=$?
 	elif [ -w "/sys/power/state" ] ; then
 	    # Use the raw kernel sysfs interface


More information about the hal-commit mailing list