diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 364f29d..2deb631 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -37,6 +37,7 @@ decky = ["usdpl-back/decky"] crankshaft = ["usdpl-back/crankshaft"] encrypt = ["usdpl-back/encrypt"] online = ["ureq"] +dev_stuff = [] [profile.release] debug = false diff --git a/backend/src/settings/steam_deck/oc_limits.rs b/backend/src/settings/steam_deck/oc_limits.rs index 3e64bf6..21ca5f1 100644 --- a/backend/src/settings/steam_deck/oc_limits.rs +++ b/backend/src/settings/steam_deck/oc_limits.rs @@ -127,3 +127,22 @@ impl Default for GpuLimits { fn oc_limits_filepath() -> std::path::PathBuf { crate::utility::settings_dir().join(OC_LIMITS_FILEPATH) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn load_pt_oc() { + let mut file = std::fs::File::open("../pt_oc.json").unwrap(); + let settings: OverclockLimits = serde_json::from_reader(&mut file).unwrap(); + assert!(settings.cpus.cpus.len() == 8); + } + + #[cfg(feature = "dev_stuff")] + #[test] + fn emit_default_pt_oc() { + let mut file = std::fs::File::create("../pt_oc.json").unwrap(); + serde_json::to_writer_pretty(&mut file, &OverclockLimits::default()).unwrap(); + } +} diff --git a/pt_oc.json b/pt_oc.json index 36dba50..19665b0 100644 --- a/pt_oc.json +++ b/pt_oc.json @@ -1,68 +1,131 @@ { - "battery": { - "charge_rate": {"min": 250, "max": 2500} - }, - "cpus": { - "cpus": [ - { - "clock_min": {"min": 1400, "max": 3500}, - "clock_max": {"min": 500, "max": 3500}, - "clock_step": 100, - "skip_resume_reclock": false - }, - { - "clock_min": {"min": 1400, "max": 3500}, - "clock_max": {"min": 500, "max": 3500}, - "clock_step": 100, - "skip_resume_reclock": false - }, - { - "clock_min": {"min": 1400, "max": 3500}, - "clock_max": {"min": 500, "max": 3500}, - "clock_step": 100, - "skip_resume_reclock": false - }, - { - "clock_min": {"min": 1400, "max": 3500}, - "clock_max": {"min": 500, "max": 3500}, - "clock_step": 100, - "skip_resume_reclock": false - }, - { - "clock_min": {"min": 1400, "max": 3500}, - "clock_max": {"min": 500, "max": 3500}, - "clock_step": 100, - "skip_resume_reclock": false - }, - { - "clock_min": {"min": 1400, "max": 3500}, - "clock_max": {"min": 500, "max": 3500}, - "clock_step": 100, - "skip_resume_reclock": false - }, - { - "clock_min": {"min": 1400, "max": 3500}, - "clock_max": {"min": 500, "max": 3500}, - "clock_step": 100, - "skip_resume_reclock": false - }, - { - "clock_min": {"min": 1400, "max": 3500}, - "clock_max": {"min": 500, "max": 3500}, - "clock_step": 100, - "skip_resume_reclock": false - } - ], - "global_governors": false - }, - "gpu": { - "fast_ppt": {"min": 1000000, "max": 30000000}, - "slow_ppt": {"min": 1000000, "max": 29000000}, - "ppt_divisor": 1000000, - "ppt_step": 1, - "clock_min": {"min": 200, "max": 1600}, - "clock_max": {"min": 200, "max": 1600}, + "battery": { + "charge_rate": { + "min": 250, + "max": 2500 + } + }, + "cpus": { + "cpus": [ + { + "clock_min": { + "min": 1400, + "max": 3500 + }, + "clock_max": { + "min": 400, + "max": 3500 + }, "clock_step": 100, "skip_resume_reclock": false - } -} + }, + { + "clock_min": { + "min": 1400, + "max": 3500 + }, + "clock_max": { + "min": 400, + "max": 3500 + }, + "clock_step": 100, + "skip_resume_reclock": false + }, + { + "clock_min": { + "min": 1400, + "max": 3500 + }, + "clock_max": { + "min": 400, + "max": 3500 + }, + "clock_step": 100, + "skip_resume_reclock": false + }, + { + "clock_min": { + "min": 1400, + "max": 3500 + }, + "clock_max": { + "min": 400, + "max": 3500 + }, + "clock_step": 100, + "skip_resume_reclock": false + }, + { + "clock_min": { + "min": 1400, + "max": 3500 + }, + "clock_max": { + "min": 400, + "max": 3500 + }, + "clock_step": 100, + "skip_resume_reclock": false + }, + { + "clock_min": { + "min": 1400, + "max": 3500 + }, + "clock_max": { + "min": 400, + "max": 3500 + }, + "clock_step": 100, + "skip_resume_reclock": false + }, + { + "clock_min": { + "min": 1400, + "max": 3500 + }, + "clock_max": { + "min": 400, + "max": 3500 + }, + "clock_step": 100, + "skip_resume_reclock": false + }, + { + "clock_min": { + "min": 1400, + "max": 3500 + }, + "clock_max": { + "min": 400, + "max": 3500 + }, + "clock_step": 100, + "skip_resume_reclock": false + } + ], + "global_governors": false + }, + "gpu": { + "fast_ppt": { + "min": 1000000, + "max": 30000000 + }, + "slow_ppt": { + "min": 1000000, + "max": 29000000 + }, + "ppt_divisor": 1000000, + "ppt_step": 1, + "clock_min": { + "min": 200, + "max": 1600 + }, + "clock_max": { + "min": 200, + "max": 1600 + }, + "clock_step": 100, + "skip_resume_reclock": false + } +} \ No newline at end of file