Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=1cdf9e016d361f274bac0139a57101d151b923f3

commit 1cdf9e016d361f274bac0139a57101d151b923f3
Author: James Buren <[email protected]>
Date:   Sun Mar 18 15:59:01 2012 -0500

pm-radeon-1-1-x86_64
* new package

diff --git a/source/apps/pm-radeon/README.Frugalware 
b/source/apps/pm-radeon/README.Frugalware
new file mode 100644
index 0000000..c8eeb99
--- /dev/null
+++ b/source/apps/pm-radeon/README.Frugalware
@@ -0,0 +1,7 @@
+Before you can use this package, you must edit the configuration for it in
+the file `/etc/sysconfig/pm-radeon`. After you are done, run this command to
+enable it at startup.
+
+----
+systemctl enable pm-radeon.service
+----
diff --git a/source/apps/pm-radeon/pm-radeon b/source/apps/pm-radeon/pm-radeon
new file mode 100644
index 0000000..65f8a16
--- /dev/null
+++ b/source/apps/pm-radeon/pm-radeon
@@ -0,0 +1,7 @@
+# Set the power management method.
+# Valid options: dynpm or profile
+method=""
+
+# Set the power management profile. Only use if method is profile.
+# Valid options: default, auto, low, mid, or high
+profile=""
diff --git a/source/apps/pm-radeon/pm-radeon.service 
b/source/apps/pm-radeon/pm-radeon.service
new file mode 100644
index 0000000..53b22f0
--- /dev/null
+++ b/source/apps/pm-radeon/pm-radeon.service
@@ -0,0 +1,12 @@
+[Unit]
+Description=Apply pm-radeon configuration
+After=syslog.target
+
+[Service]
+ExecStart=/usr/sbin/pm-radeon.sh
+Type=oneshot
+StandardOutput=syslog
+RemainAfterExit=yes
+
+[Install]
+WantedBy=multi-user.target
diff --git a/source/apps/pm-radeon/pm-radeon.sh 
b/source/apps/pm-radeon/pm-radeon.sh
new file mode 100644
index 0000000..338dca6
--- /dev/null
+++ b/source/apps/pm-radeon/pm-radeon.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+. /etc/sysconfig/pm-radeon
+
+[ -z "$method" ] && exit 1
+
+[ "$method" != "profile" -a -n "$profile" ] && exit 1
+
+for i in /sys/class/drm/card*/device/power_method; do
+       if [ -f "$i" ]; then
+               echo "$method" > "$i"
+               [ "$?" -ne "0" ] && exit 1
+       fi
+done
+
+for i in /sys/class/drm/card*/device/power_profile; do
+       if [ -f "$i" -a -n "$profile" ]; then
+               echo "$profile" > "$i"
+               [ "$?" -ne "0" ] && exit 1
+       fi
+done
+
+true
diff --git a/source/apps/pm-radeon/pm-radeon.sleep 
b/source/apps/pm-radeon/pm-radeon.sleep
new file mode 100644
index 0000000..bc6c7a9
--- /dev/null
+++ b/source/apps/pm-radeon/pm-radeon.sleep
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+case $1 in
+       resume|thaw)
+               /usr/sbin/pm-radeon.sh
+               ;;
+       *)
+               ;;
+esac
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to