mirror of
https://github.com/ilya-zlobintsev/LACT.git
synced 2025-02-25 18:55:26 -06:00
fix: set performance level after the clocks table, reset it to auto before applying a custom value (#298)
* fix: set performance level after setting custom clocks * test
This commit is contained in:
parent
219d832b91
commit
d9553a91a1
@ -693,16 +693,6 @@ impl GpuController {
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(level) = config.performance_level {
|
||||
self.handle
|
||||
.set_power_force_performance_level(level)
|
||||
.context("Failed to set power performance level")?;
|
||||
} else if self.handle.get_power_force_performance_level().is_ok() {
|
||||
self.handle
|
||||
.set_power_force_performance_level(PerformanceLevel::Auto)
|
||||
.context("Failed to set performance level to PerformanceLevel::Auto")?;
|
||||
}
|
||||
|
||||
if let Some(mode_index) = config.power_profile_mode_index {
|
||||
if config.performance_level != Some(PerformanceLevel::Manual) {
|
||||
return Err(anyhow!(
|
||||
@ -718,6 +708,11 @@ impl GpuController {
|
||||
// Reset the clocks table in case the settings get reverted back to not having a clocks value configured
|
||||
self.handle.reset_clocks_table().ok();
|
||||
|
||||
// Reset performance level to work around some GPU quirks (found to be an issue on RDNA2)
|
||||
self.handle
|
||||
.set_power_force_performance_level(PerformanceLevel::Auto)
|
||||
.ok();
|
||||
|
||||
if config.is_core_clocks_used() {
|
||||
let mut table = self
|
||||
.handle
|
||||
@ -741,6 +736,13 @@ impl GpuController {
|
||||
.with_context(|| format!("Clocks table commands: {:?}", table.get_commands()))?;
|
||||
}
|
||||
|
||||
if let Some(level) = config.performance_level {
|
||||
self.handle
|
||||
.set_power_force_performance_level(level)
|
||||
.context("Failed to set power performance level")?;
|
||||
}
|
||||
// Else is not needed, it was previously reset to auto already
|
||||
|
||||
for (kind, states) in &config.power_states {
|
||||
if config.performance_level != Some(PerformanceLevel::Manual) {
|
||||
return Err(anyhow!(
|
||||
|
Loading…
Reference in New Issue
Block a user