power: Allow returned GPU clocks range to overridden by a platform config

This commit is contained in:
Vicki Pfau 2024-08-30 21:57:11 -07:00
parent 7c3f2baa05
commit bdd095860e
5 changed files with 14 additions and 0 deletions

View file

@ -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;