Skip to content

Instantly share code, notes, and snippets.

Created August 8, 2013 06:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6181894 to your computer and use it in GitHub Desktop.
Save anonymous/6181894 to your computer and use it in GitHub Desktop.
Script to controll ATI Power Saving Profiles on Dell Studio 1555
#!/bin/sh
# $Id$ : /root/bin/grspeed - diddle with graphics power managment profile
prog=`basename $0`
# set -x
# 1. Dynamic frequency switching (depending on GPU load)
# The "dynpm" method dynamically changes the clocks based on the number of pending fences, so performance is ramped up when running GPU intensive apps, and ramped down when the GPU is idle. The re-clocking is attempted during vertical blanking periods, but due to the timing of the re-clocking functions, does not always complete in the blanking period, which can lead to flicker in the display. Due to this, dynpm only works when a single head is active.
#
# 2.Profile-based frequency switching
#The "profile" mode will allow you to select one of the five profiles below. Different profiles, for the most part, end up changing the frequency/voltage of the card.
#"default" uses the default clocks and does not change the power state. This is the default behavior.
#"auto" selects between "mid" and "high" power states based on the whether the system is on battery power or not. The "low" power state are selected when the monitors are in the dpms off state.
#"low" forces the gpu to be in the low power state all the time. Note that "low" can cause display problems on some laptops; this is why auto only uses "low" when displays are off.
#"mid" forces the gpu to be in the "mid" power state all the time. The "low" power state is selected when the monitors are in the dpms off state.
#"high" forces the gpu to be in the "high" power state all the time. The "low" power state is selected when the monitors are in the dpms off state.
profile=auto
# Only support card0 for now
device=/sys/class/drm/card0/device/
usage () {
echo "Usage: $prog [OPTION]"
echo "Sets the graphics card power management to a static profile, defaulting to $profile if no option set"
echo "Option can be one from :"
echo " help, -h or --help - show Usage information and exit"
echo " -c, c(heck) - show current power management info and exit"
echo " -d, d(efault) - reset to system default profile"
echo " -l, l(ow) - minimum fan noise, set to lowest power profile (also used by DPMS), minimising heat and performance"
echo " -m, m(id) - hopefully reduced fan noise, set to balanced heat and performance profile"
echo " -x, h(igh) - maximum fan noise, set to maximum heat and performance profile"
echo " -a, a(uto) - selects between "mid" and "high" power states based on the whether the system is on battery power or not."
echo " -dy, dy(namic) - Dynamic frequency switching (depending on GPU load)"
}
test "$1" && {
case $1 in
-h|--h*|help)
usage; exit 0 ;;
-c|c*)
exec cat /sys/kernel/debug/dri/0/*_pm_info ;;
-d|d*)
profile=default ;;
-x|h*)
profile=high ;;
-m|m*)
profile=mid ;;
-l|l*)
profile=low ;;
-a|a*)
profile=auto ;;
-dy|dy*)
profile=dynpm ;;
*)
usage; exit 1 ;;
esac
}
if [ "$profile" = "dynpm" ]; then
echo "Enabling Dynamic profile on ATI Card"
echo $profile > $device/power_method
else
echo "Enabling $profile profile on ATI Card"
echo profile > $device/power_method
exec echo $profile > $device/power_profile
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment