From fb038665c9bd89e9878ef515e99ee35757488d70 Mon Sep 17 00:00:00 2001 From: "NGnius (Graham)" Date: Sat, 10 Feb 2024 15:02:08 -0500 Subject: [PATCH] Update limits_override reference --- backend/src/settings/steam_deck/cpu.rs | 15 ++++++--- backend/src/settings/steam_deck/gpu.rs | 10 +++--- limits_override.ron | 42 ++++++++++++++++++++------ 3 files changed, 50 insertions(+), 17 deletions(-) diff --git a/backend/src/settings/steam_deck/cpu.rs b/backend/src/settings/steam_deck/cpu.rs index 0ba44c5..e76df46 100644 --- a/backend/src/settings/steam_deck/cpu.rs +++ b/backend/src/settings/steam_deck/cpu.rs @@ -353,13 +353,17 @@ impl Cpu { } fn read_max_cpu_clock(&self) -> u64 { - if !(self.limits.extras.experiments || self.limits.extras.quirks.contains("clock-autodetect")) { + if !(self.limits.extras.experiments + || self.limits.extras.quirks.contains("clock-autodetect")) + { return MAX_CLOCK; } if let super::Model::OLED = self.variant { - if let Ok(freq_khz) = usdpl_back::api::files::read_single::<_, u64, _>(cpu_max_clock_path(self.index)) { + if let Ok(freq_khz) = + usdpl_back::api::files::read_single::<_, u64, _>(cpu_max_clock_path(self.index)) + { log::debug!("Detected CPU max clock of {}KHz", freq_khz); - return freq_khz / 1000 + return freq_khz / 1000; } } MAX_CLOCK @@ -747,5 +751,8 @@ fn cpu_available_governors_path(index: usize) -> String { #[inline] fn cpu_max_clock_path(index: usize) -> String { - format!("/sys/devices/system/cpu/cpufreq/policy{}/cpuinfo_max_freq", index) + format!( + "/sys/devices/system/cpu/cpufreq/policy{}/cpuinfo_max_freq", + index + ) } diff --git a/backend/src/settings/steam_deck/gpu.rs b/backend/src/settings/steam_deck/gpu.rs index f638f10..46a7c00 100644 --- a/backend/src/settings/steam_deck/gpu.rs +++ b/backend/src/settings/steam_deck/gpu.rs @@ -143,7 +143,9 @@ impl Gpu { } fn read_max_gpu_clock(&self) -> u64 { - if !(self.limits.extras.experiments || self.limits.extras.quirks.contains("clock-autodetect")) { + if !(self.limits.extras.experiments + || self.limits.extras.quirks.contains("clock-autodetect")) + { return MAX_CLOCK; } if let super::Model::OLED = self.variant { @@ -152,12 +154,12 @@ impl Gpu { .read_value(GPU_CLOCK_READOUT_ATTRIBUTE.to_owned()) { let options = parse_pp_dpm_sclk(&String::from_utf8_lossy(&f)); - return options.get(options.len() - 1) + return options + .get(options.len() - 1) .map(|x| { let x = x.1 as u64; log::debug!("Detected GPU max clock of {}MHz", x); x - }) .unwrap_or(MAX_CLOCK); } @@ -635,7 +637,7 @@ impl crate::settings::OnUnload for Gpu { impl TGpu for Gpu { fn limits(&self) -> crate::api::GpuLimits { - let max_gpu_clock = self.read_max_gpu_clock(); + let max_gpu_clock = self.read_max_gpu_clock(); crate::api::GpuLimits { fast_ppt_limits: Some(RangeLimit { min: super::util::range_min_or_fallback(&self.limits.fast_ppt, MIN_FAST_PPT) diff --git a/limits_override.ron b/limits_override.ron index e963283..c97c3b8 100644 --- a/limits_override.ron +++ b/limits_override.ron @@ -17,7 +17,10 @@ Limits( tdp_divisor: None, tdp_step: None, skip_resume_reclock: false, - experiments: false, + extras: LimitExtras( + experiments: false, + quirks: [], +), ), GenericCpuLimit( clock_min: Some(RangeLimit( min: Some(1400), @@ -33,7 +36,10 @@ Limits( tdp_divisor: None, tdp_step: None, skip_resume_reclock: false, - experiments: false, + extras: LimitExtras( + experiments: false, + quirks: [], +), ), GenericCpuLimit( clock_min: Some(RangeLimit( min: Some(1400), @@ -49,7 +55,10 @@ Limits( tdp_divisor: None, tdp_step: None, skip_resume_reclock: false, - experiments: false, + extras: LimitExtras( + experiments: false, + quirks: [], +), ), GenericCpuLimit( clock_min: Some(RangeLimit( min: Some(1400), @@ -65,7 +74,10 @@ Limits( tdp_divisor: None, tdp_step: None, skip_resume_reclock: false, - experiments: false, + extras: LimitExtras( + experiments: false, + quirks: [], +), ), GenericCpuLimit( clock_min: Some(RangeLimit( min: Some(1400), @@ -81,7 +93,10 @@ Limits( tdp_divisor: None, tdp_step: None, skip_resume_reclock: false, - experiments: false, + extras: LimitExtras( + experiments: false, + quirks: [], +), ), GenericCpuLimit( clock_min: Some(RangeLimit( min: Some(1400), @@ -97,7 +112,10 @@ Limits( tdp_divisor: None, tdp_step: None, skip_resume_reclock: false, - experiments: false, + extras: LimitExtras( + experiments: false, + quirks: [], +), ), GenericCpuLimit( clock_min: Some(RangeLimit( min: Some(1400), @@ -113,7 +131,10 @@ Limits( tdp_divisor: None, tdp_step: None, skip_resume_reclock: false, - experiments: false, + extras: LimitExtras( + experiments: false, + quirks: [], +), ), GenericCpuLimit( clock_min: Some(RangeLimit( min: Some(1400), @@ -129,7 +150,10 @@ Limits( tdp_divisor: None, tdp_step: None, skip_resume_reclock: false, - experiments: false, + extras: LimitExtras( + experiments: false, + quirks: [], +), )], global_governors: true, extras: LimitExtras( @@ -174,7 +198,7 @@ Limits( skip_resume_reclock: false, extras: LimitExtras( experiments: false, - quirks: ["pp_dpm_fclk-not-updated-on-LCD", "pp_dpm_fclk-reversed"], + quirks: ["pp_dpm_fclk-reversed", "pp_dpm_fclk-not-updated-on-LCD"], ), ), ),