Skip to content

Commit

Permalink
add advanced option for apu-slow-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
aarron-lee committed Dec 2, 2024
1 parent 8743243 commit 621b031
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
14 changes: 14 additions & 0 deletions py_modules/advanced_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
class DefaultSettings(Enum):
ENABLE_TDP_CONTROL = 'enableTdpControl'
ENABLE_GPU_CONTROL = 'enableGpuControl'
ENABLE_APU_SLOW_LIMIT = 'enableApuSlowLimit'
ENABLE_STEAM_PATCH = 'steamPatch'
ENABLE_POWER_CONTROL = 'enablePowercontrol'
ENABLE_BACKGROUND_POLLING = 'enableBackgroundPolling'
Expand Down Expand Up @@ -175,6 +176,19 @@ def get_default_options():

options.append(max_tdp_on_resume)

if not device_utils.is_intel():
# enable apu-slow-limit control
enable_apu_slow_limit = {
'name': 'Enable APU Slow Limit',
'type': 'boolean',
'defaultValue': False,
'description': 'Enables the --apu-slow-limit value for ryzenadj',
'currentValue': get_value(DefaultSettings.ENABLE_APU_SLOW_LIMIT, False),
'statePath': DefaultSettings.ENABLE_APU_SLOW_LIMIT.value
}

options.append(enable_apu_slow_limit)

return options


Expand Down
8 changes: 8 additions & 0 deletions py_modules/cpu_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,14 @@ def set_amd_tdp(tdp: int):
'--dgpu-skin-temp', f"95"
]

if advanced_options.get_advanced_options(
advanced_options.DefaultSettings.ENABLE_APU_SLOW_LIMIT.value
):
commands.append('--apu-slow-limit')
commands.append(f"{tdp}")

decky_plugin.logger.info(f'setting TDP via ryzenadj with args {commands}')

results = subprocess.call(commands)
return results
except Exception as e:
Expand Down
1 change: 1 addition & 0 deletions src/backend/utils.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { IS_DESKTOP } from "../components/atoms/DeckyFrontendLib";
export enum AdvancedOptionsEnum {
ENABLE_TDP_CONTROL = "enableTdpControl",
ENABLE_GPU_CONTROL = "enableGpuControl",
ENABLE_APU_SLOW_LIMIT = "enableApuSlowLimit",
STEAM_PATCH = "steamPatch",
ENABLE_POWER_CONTROL = "enablePowercontrol",
ENABLE_BACKGROUND_POLLING = "enableBackgroundPolling",
Expand Down

0 comments on commit 621b031

Please sign in to comment.