rpms/pm-utils/devel pm-utils-0.19-vidhooks.patch, NONE, 1.1 .cvsignore, 1.20, 1.21 pm-utils.spec, 1.34, 1.35 sources, 1.24, 1.25
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Wed Jun 14 02:59:30 UTC 2006
Author: pjones
Update of /cvs/dist/rpms/pm-utils/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv22931
Modified Files:
.cvsignore pm-utils.spec sources
Added Files:
pm-utils-0.19-vidhooks.patch
Log Message:
- update to CVS
pm-utils-0.19-vidhooks.patch:
functions | 91 ++++++++++++++++++++++++++++++++++++++++++++++++++++
functions-ati | 96 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
functions-intel | 29 ++++++++++++++++
functions-nvidia | 30 +++++++++++++++++
hooks/20video | 34 +++++++------------
5 files changed, 259 insertions(+), 21 deletions(-)
--- NEW FILE pm-utils-0.19-vidhooks.patch ---
--- pm/functions 16 May 2006 15:15:05 -0000 1.19
+++ pm/functions 14 Jun 2006 02:47:40 -0000
@@ -30,6 +30,97 @@ source_configs()
source_configs
+get_video_type()
+{
+ vendor=""
+ vendor=$(/sbin/lspci -mn|awk '{if ($2 ~ /^"0300"$/ ) {print $3;exit;}}')
+ vendor=$(eval echo $vendor)
+ [ -z "$vendor" ] && return 1
+ case "$vendor" in
+ 1002)
+ echo ATI
+ return 0
+ ;;
+ 10de)
+ echo nVidia
+ return 0
+ ;;
+ 8086)
+ echo Intel
+ return 0
+ ;;
+ *)
+ echo $vendor
+ return 0
+ ;;
+ esac
+}
+
+get_lcd_status()
+{
+ return 0
+}
+
+lcd_on()
+{
+ return 0
+}
+
+lcd_off()
+{
+ return 0
+}
+
+get_crt_status()
+{
+ return 0
+}
+
+crt_on()
+{
+ return 0
+}
+
+crt_off()
+{
+ return 0
+}
+
+suspend_video()
+{
+ return 0;
+}
+
+resume_video()
+{
+ return 0;
+}
+
+rotate_video_state()
+{
+ STATUS="$(get_crt_status) $(get_lcd_status)"
+ case "$STATUS" in
+ "off off")
+ crt_off
+ lcd_on
+ ;;
+ "off on")
+ crt_on
+ lcd_on
+ ;;
+ "on on")
+ crt_on
+ lcd_off
+ ;;
+ "on off")
+ crt_off
+ lcd_off
+ ;;
+ *)
+ ;;
+ esac
+}
+
take_suspend_lock()
{
VT=$(/usr/bin/fgconsole)
--- pm/hooks/20video 27 Apr 2006 08:05:43 -0000 1.7
+++ pm/hooks/20video 14 Jun 2006 02:47:40 -0000
@@ -2,27 +2,19 @@
. /etc/pm/functions
-suspend_video()
-{
- # Suspend all video devices using the HAL dbus methods
- devices=`hal-find-by-capability --capability video_adapter_pm`
- for device in $devices
- do
- dbus-send --system --print-reply --dest=org.freedesktop.Hal \
- $device org.freedesktop.Hal.Device.VideoAdapterPM.SuspendVideo
- done
-}
-
-resume_video()
-{
- # Resume all video devices using the HAL dbus methods
- devices=`hal-find-by-capability --capability video_adapter_pm`
- for device in $devices
- do
- dbus-send --system --print-reply --dest=org.freedesktop.Hal \
- $device org.freedesktop.Hal.Device.VideoAdapterPM.ResumeVideo
- done
-}
+case "$(get_video_type)" in
+ ATI)
+ . /etc/pm/functions-ati
+ ;;
+ nVidia)
+ . /etc/pm/functions-nvidia
+ ;;
+ Intel)
+ . /etc/pm/functions-intel
+ ;;
+ *)
+ ;;
+esac
case "$1" in
suspend)
--- pm/functions-ati.old 1969-12-31 19:00:00.000000000 -0500
+++ pm/functions-ati 2006-06-13 22:43:58.000000000 -0400
@@ -0,0 +1,96 @@
+#!/bin/bash
+
+get_lcd_status()
+{
+ if [ ! -x /usr/sbin/radeontool ]; then
+ echo "error"
+ return 2
+ fi
+ STATUS=$(/usr/sbin/radeontool light | cut -d\ -f5 2>/dev/null)
+ RETVAL=0
+ case "x$STATUS" in
+ "xon")
+ echo "on"
+ RETVAL=0
+ ;;
+ "xoff")
+ echo "off"
+ RETVAL=1
+ ;;
+ *)
+ echo "error"
+ RETVAL=2
+ ;;
+ esac
+ return $RETVAL
+}
+
+lcd_off()
+{
+ if [ "$(get_lcd_status)" != "on" ]; then
+ return
+ fi
+ [ -x /usr/sbin/radeontool] && /usr/sbin/radeontool light off
+}
+
+lcd_on()
+{
+ if [ "$(get_lcd_status)" != "off" ]; then
+ return
+ fi
+ [ -x /usr/sbin/radeontool ] && /usr/sbin/radeontool light on
+}
+
+get_crt_status()
+{
+ if [ ! -x /usr/sbin/radeontool ]; then
+ echo "error"
+ return 2
+ fi
+ STATUS=$(/usr/sbin/radeontool light | cut -d\ -f5 2>/dev/null)
+ RETVAL=0
+ case "x$STATUS" in
+ "xon")
+ echo "on"
+ RETVAL=0
+ ;;
+ "xoff")
+ echo "off"
+ RETVAL=1
+ ;;
+ *)
+ echo "error"
+ RETVAL=2
+ ;;
+ esac
+ return $RETVAL
+}
+
+crt_off()
+{
+ if [ "$(get_lcd_status)" != "on" ]; then
+ return
+ fi
+ [ -x /usr/sbin/radeontool ] && /usr/sbin/radeontool dac off
+}
+
+crt_on()
+{
+ if [ "$(get_lcd_status)" != "on" ]; then
+ return
+ fi
+ [ -x /usr/sbin/radeontool ] && /usr/sbin/radeontool dac on
+}
+
+[ -x /usr/sbin/vbetool ] || return
+
+suspend_video()
+{
+ /usr/sbin/vbetool dpms suspend >/dev/null 2>&1
+}
+
+resume_video()
+{
+# /usr/sbin/vbetool dpms on >/dev/null 2>&1
+ :
+}
--- pm/functions-intel.old 1969-12-31 19:00:00.000000000 -0500
+++ pm/functions-intel 2006-06-13 22:43:58.000000000 -0400
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+[ -x /usr/sbin/vbetool ] || return
+
+suspend_video()
+{
+{
+ /usr/sbin/vbetool vbestate save > /var/run/vbestate
+ /usr/sbin/vbetool dpms suspend
+} >/dev/null 2>&1
+}
+
+resume_video()
+{
+{
+ /usr/sbin/vbetool post
+ /usr/sbin/vbetool vbestate restore < /var/run/vbestate
+} >/dev/null 2>&1
+}
+
+lcd_on()
+{
+ /usr/sbin/vbetool dpms on >/dev/null 2>&1
+}
+
+lcd_off()
+{
+ /usr/sbin/vbetool dpms off >/dev/null 2>&1
+}
--- pm/functions-nvidia.old 1969-12-31 19:00:00.000000000 -0500
+++ pm/functions-nvidia 2006-06-13 22:43:58.000000000 -0400
@@ -0,0 +1,30 @@
+#!/bin/bash
+
+[ -x /usr/sbin/vbetool ] || return
+
+suspend_video()
+{
+{
+ /usr/sbin/vbetool vbestate save > /var/run/vbestate
+ /usr/sbin/vbetool dpms suspend
+} >/dev/null 2>&1
+}
+
+resume_video()
+{
+{
+ /usr/sbin/vbetool post
+ /usr/sbin/vbetool dpms on
+ /usr/sbin/vbetool vbestate restore < /var/run/vbestate
+} >/dev/null 2>&1
+}
+
+lcd_on()
+{
+ /usr/sbin/vbetool dpms on >/dev/null 2>&1
+}
+
+lcd_off()
+{
+ /usr/sbin/vbetool dpms off >/dev/null 2>&1
+}
Index: .cvsignore
===================================================================
RCS file: /cvs/dist/rpms/pm-utils/devel/.cvsignore,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- .cvsignore 25 Apr 2006 14:31:41 -0000 1.20
+++ .cvsignore 14 Jun 2006 02:59:28 -0000 1.21
@@ -1,3 +1,4 @@
vbetool_0.5-1.tar.gz
radeontool-1.5.tar.gz
pm-utils-0.18.tar.gz
+pm-utils-0.19.tar.gz
Index: pm-utils.spec
===================================================================
RCS file: /cvs/dist/rpms/pm-utils/devel/pm-utils.spec,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -r1.34 -r1.35
--- pm-utils.spec 27 Apr 2006 23:43:20 -0000 1.34
+++ pm-utils.spec 14 Jun 2006 02:59:28 -0000 1.35
@@ -1,7 +1,7 @@
Name: pm-utils
Summary: Power management utilities and scripts for Fedora Core
License: GPL
-Version: 0.18
+Version: 0.19
Release: 1
Group: System Environment/Base
ExclusiveArch: %{ix86} x86_64 ia64 ppc ppc64
@@ -26,8 +26,9 @@
BuildRequires: hal-devel pkgconfig pciutils-devel
BuildRequires: dbus-devel >= 0.60
-Patch10: vbetool-0.3-fix-gcc4bug.patch
-Patch11: vbetool-0.3-libpci.patch
+Patch1: vbetool-0.3-fix-gcc4bug.patch
+Patch2: vbetool-0.3-libpci.patch
+Patch3: pm-utils-0.19-vidhooks.patch
%description
The pm-utils package contains utilities and scripts for Fedora Core
@@ -35,8 +36,9 @@
%prep
%setup -q -a 10 -a 20
-%patch10 -p0
-%patch11 -p0
+%patch1 -p0 -b .gcc4
+%patch2 -p0 -b .libpci
+%patch3 -p0 -b .vidhooks
%build
cd vbetool-0.4
@@ -99,8 +101,10 @@
%{_mandir}/man*/*
%changelog
-* xxx
+* Tue Jun 13 2006 Peter Jones <pjones at redhat.com> - 0.19-1
+- update from CVS
- move pam and consolehelper stuff here.
+- move video hooks here since HAL isn't ready
* Tue Apr 25 2006 Peter Jones <pjones at redhat.com> - 0.18-1
- Make it work cross-distro
Index: sources
===================================================================
RCS file: /cvs/dist/rpms/pm-utils/devel/sources,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -r1.24 -r1.25
--- sources 25 Apr 2006 14:31:43 -0000 1.24
+++ sources 14 Jun 2006 02:59:28 -0000 1.25
@@ -1,3 +1,4 @@
8065eebe5a2b163e43b40461bfe49a56 radeontool-1.5.tar.gz
950a87f99d17bc4f4ced73cec7103859 vbetool_0.5-1.tar.gz
1dba0a22ca8ccd235ee40de0ed59442a pm-utils-0.18.tar.gz
+e9433732e9717e9d76b9eb6c3421dc8a pm-utils-0.19.tar.gz
More information about the fedora-cvs-commits
mailing list