Skip to content

Commit

Permalink
handle pstate status earlier
Browse files Browse the repository at this point in the history
  • Loading branch information
aarron-lee committed Oct 1, 2024
1 parent a5e7a5b commit f89b3f6
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@ async def get_power_control_info(self):
}
try:
with file_timeout.time_limit(5):
response['scalingDriver'] = cpu_utils.get_scaling_driver()
response['supportsCpuBoost'] = cpu_utils.supports_cpu_boost()
response['powerControlsEnabled'] = power_utils.power_controls_enabled()
pstate_status = cpu_utils.get_pstate_status()
response['pstateStatus'] = pstate_status
if pstate_status == 'passive' and device_utils.is_intel():
cpu_utils.set_pstate_active()
response['pstateStatus'] = 'active'

response['scalingDriver'] = cpu_utils.get_scaling_driver()
response['supportsCpuBoost'] = cpu_utils.supports_cpu_boost()
response['powerControlsEnabled'] = power_utils.power_controls_enabled()
if response['powerControlsEnabled']:
response['eppOptions'] = power_utils.get_available_epp_options()
response['powerGovernorOptions'] = power_utils.get_available_governor_options()
Expand Down

0 comments on commit f89b3f6

Please sign in to comment.