1
0
Fork 0

Merge pull request #72 from olysonek/radeon

plugin_video: Prefix DPM states with 'dpm-'
This commit is contained in:
Jaroslav Škarvada 2017-09-20 13:49:05 +02:00 committed by GitHub
commit 65b3cae0cc
4 changed files with 7 additions and 6 deletions

View file

@ -13,7 +13,7 @@ energy_perf_bias=normal
timeout=10
[video]
radeon_powersave=balanced, auto
radeon_powersave=dpm-balanced, auto
[disk]
# Comma separated list of devices, all devices if commented out.

View file

@ -7,7 +7,7 @@ summary=Optmize for the desktop use-case with power saving
include=server-powersave
[video]
radeon_powersave=powersave, auto
radeon_powersave=dpm-battery, auto
[net]
# Comma separated list of devices, all devices if commented out.

View file

@ -17,7 +17,7 @@ energy_perf_bias=powersave
timeout=10
[video]
radeon_powersave=powersave, auto
radeon_powersave=dpm-battery, auto
[disk]
# Comma separated list of devices, all devices if commented out.

View file

@ -65,10 +65,11 @@ class VideoPlugin(base.Plugin):
if (self._cmd.write_to_file(sys_files["method"], "dynpm")):
return "dynpm"
# new DPM profiles, recommended to use if supported
elif v in ["battery", "balanced", "performance"]:
elif v in ["dpm-battery", "dpm-balanced", "dpm-performance"]:
if not sim:
state = v[len("dpm-"):]
if (self._cmd.write_to_file(sys_files["method"], "dpm") and
self._cmd.write_to_file(sys_files["dpm_state"], v)):
self._cmd.write_to_file(sys_files["dpm_state"], state)):
return v
else:
if not sim:
@ -85,6 +86,6 @@ class VideoPlugin(base.Plugin):
elif method == "dynpm":
return method
elif method == "dpm":
return self._cmd.read_file(sys_files["dpm_state"]).strip()
return "dpm-" + self._cmd.read_file(sys_files["dpm_state"]).strip()
else:
return None