Skip to content

Commit

Permalink
增加对amd_pstate的处理
Browse files Browse the repository at this point in the history
  • Loading branch information
honjow committed Sep 13, 2023
1 parent f102855 commit ea6e1e9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions backend/sh_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,11 +135,19 @@ function check_clock_limits()
function set_cpu_boost()
{
boost=$1
boost_path="/sys/devices/system/cpu/cpufreq/boost"
amd_pstate_path="/sys/devices/system/cpu/amd_pstate/status"
if (($boost == 1)); then
echo 1 > "/sys/devices/system/cpu/cpufreq/boost"
echo 1 > "${boost_path}"
if [ -f "${amd_pstate_path}" ]; then
echo "active" > "${amd_pstate_path}"
fi
else
echo 1 > "/sys/devices/system/cpu/cpufreq/boost"
echo 0 > "/sys/devices/system/cpu/cpufreq/boost"
if [ -f "${amd_pstate_path}" ]; then
echo "passive" > "${amd_pstate_path}"
fi
echo 1 > "${boost_path}"
echo 0 > "${boost_path}"
fi
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "PowerControl",
"version": "2.0.4",
"version": "2.0.5",
"description": "PowerControl plugin.",
"scripts": {
"build": "shx rm -rf dist && rollup -c",
Expand Down

0 comments on commit ea6e1e9

Please sign in to comment.