summaryrefslogtreecommitdiff
path: root/pm
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2006-04-27 08:05:43 +0000
committerRichard Hughes <richard@hughsie.com>2006-04-27 08:05:43 +0000
commit3a3d1ba965163a5ede3329973e458a09e105a155 (patch)
tree3c84b497e79fa8cfb4b6592ed3a2c53918abafd9 /pm
parentf541984ba988aae495aac2044e56bdb400410bd2 (diff)
2006-04-27 Richard Hughes <richard@hughsie.com>
* pm/functions: Remove the video handling logic, as it is moving to HAL. * pm/functions-ati: * pm/functions-intel: * pm/functions-nvidia: Add a comment saying that the files are unused. When HAL video stuff is completed, they can be removed. * pm/hooks/20video: Switch to using the HAL methods as discussed.
Diffstat (limited to 'pm')
-rwxr-xr-xpm/functions91
-rw-r--r--pm/functions-ati2
-rw-r--r--pm/functions-intel2
-rw-r--r--pm/functions-nvidia2
-rwxr-xr-xpm/hooks/20video34
5 files changed, 27 insertions, 104 deletions
diff --git a/pm/functions b/pm/functions
index 6834887..741d5cf 100755
--- a/pm/functions
+++ b/pm/functions
@@ -12,97 +12,6 @@ SUSPEND_MODULES=""
export HIBERNATE_RESUME_POST_VIDEO
export SUSPEND_MODULES
-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)
diff --git a/pm/functions-ati b/pm/functions-ati
index d181562..cf3deab 100644
--- a/pm/functions-ati
+++ b/pm/functions-ati
@@ -1,5 +1,7 @@
#!/bin/bash
+# THESE FILE IS UNUSED AND WILL BE REMOVED WHEN FULL FUNCTIONALITY IS IN HAL
+
get_lcd_status()
{
if [ ! -x /usr/sbin/radeontool ]; then
diff --git a/pm/functions-intel b/pm/functions-intel
index e63eb52..f8ba01d 100644
--- a/pm/functions-intel
+++ b/pm/functions-intel
@@ -1,5 +1,7 @@
#!/bin/bash
+# THESE FILE IS UNUSED AND WILL BE REMOVED WHEN FULL FUNCTIONALITY IS IN HAL
+
[ -x /usr/sbin/vbetool ] || return
suspend_video()
diff --git a/pm/functions-nvidia b/pm/functions-nvidia
index c46b868..21de23c 100644
--- a/pm/functions-nvidia
+++ b/pm/functions-nvidia
@@ -1,5 +1,7 @@
#!/bin/bash
+# THESE FILE IS UNUSED AND WILL BE REMOVED WHEN FULL FUNCTIONALITY IS IN HAL
+
[ -x /usr/sbin/vbetool ] || return
suspend_video()
diff --git a/pm/hooks/20video b/pm/hooks/20video
index 748ee26..7a4ebe9 100755
--- a/pm/hooks/20video
+++ b/pm/hooks/20video
@@ -2,19 +2,27 @@
. /etc/pm/functions
-case "$(get_video_type)" in
- ATI)
- . /etc/pm/functions-ati
- ;;
- nVidia)
- . /etc/pm/functions-nvidia
- ;;
- Intel)
- . /etc/pm/functions-intel
- ;;
- *)
- ;;
-esac
+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 "$1" in
suspend)