mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2025-02-25 18:55:26 -06:00
Save clocks/voltage modification
This commit is contained in:
parent
65780bb881
commit
6dc0f7b13f
@ -41,6 +41,8 @@ pub struct GpuConfig {
|
||||
pub fan_curve: BTreeMap<i32, f64>,
|
||||
pub power_cap: i32,
|
||||
pub power_profile: PowerProfile,
|
||||
pub gpu_power_states: BTreeMap<u32, (i32, i32)>, //<id, (clockspeed, voltage)>
|
||||
pub vram_power_states: BTreeMap<u32, (i32, i32)>,
|
||||
}
|
||||
|
||||
impl GpuConfig {
|
||||
@ -57,6 +59,8 @@ impl GpuConfig {
|
||||
fan_control_enabled: false,
|
||||
power_cap: -1,
|
||||
power_profile: PowerProfile::Auto,
|
||||
gpu_power_states: BTreeMap::new(),
|
||||
vram_power_states: BTreeMap::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -157,7 +157,15 @@ impl GpuController {
|
||||
_ => None,
|
||||
};
|
||||
|
||||
self.set_power_profile(config.power_profile).unwrap();
|
||||
self.set_power_profile(config.power_profile.clone()).unwrap();
|
||||
|
||||
for (num, (clockspeed, voltage)) in &config.gpu_power_states {
|
||||
self.set_gpu_power_state(*num, *clockspeed, Some(*voltage)).expect("Failed to load power states");
|
||||
}
|
||||
|
||||
for (num, (clockspeed, voltage)) in &config.vram_power_states {
|
||||
self.set_vram_power_state(*num, *clockspeed, Some(*voltage)).expect("Failed to load power states");
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_config(&self) -> GpuConfig {
|
||||
@ -521,6 +529,8 @@ impl GpuController {
|
||||
|
||||
fs::write(self.hw_path.join("pp_od_clk_voltage"), line)?;
|
||||
|
||||
self.config.gpu_power_states.insert(num, (clockspeed, voltage.unwrap()));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@ -537,6 +547,8 @@ impl GpuController {
|
||||
|
||||
fs::write(self.hw_path.join("pp_od_clk_voltage"), line)?;
|
||||
|
||||
self.config.vram_power_states.insert(num, (clockspeed, voltage.unwrap()));
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user