mirror of
https://gitlab.steamos.cloud/holo/steamos-manager.git
synced 2025-07-12 01:12:30 -04:00
power: Allow returned GPU clocks range to overridden by a platform config
This commit is contained in:
parent
7c3f2baa05
commit
bdd095860e
5 changed files with 14 additions and 0 deletions
|
@ -268,6 +268,13 @@ pub(crate) async fn set_cpu_scaling_governor(governor: CPUScalingGovernor) -> Re
|
|||
}
|
||||
|
||||
pub(crate) async fn get_gpu_clocks_range() -> Result<(u32, u32)> {
|
||||
if let Some(range) = platform_config()
|
||||
.await?
|
||||
.as_ref()
|
||||
.and_then(|config| config.gpu_clocks)
|
||||
{
|
||||
return Ok((range.min, range.max));
|
||||
}
|
||||
let contents = read_gpu_sysfs_contents(GPU_CLOCK_LEVELS_SUFFIX).await?;
|
||||
let lines = contents.lines();
|
||||
let mut min = 1_000_000;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue