Add ability to disable setting clock to min-max on resume from sleep for SD

This commit is contained in:
NGnius (Graham) 2023-02-20 11:34:31 -05:00
parent fb6c31b0e8
commit 9da7de788e
4 changed files with 24 additions and 11 deletions

View file

@ -273,7 +273,7 @@ impl Cpu {
setting: crate::settings::SettingVariant::Cpu,
},
)?;
} else if self.state.clock_limits_set || self.state.is_resuming {
} else if self.state.clock_limits_set || (self.state.is_resuming && !self.limits.skip_resume_reclock) {
self.state.clock_limits_set = false;
// disable manual clock limits
log::debug!("Setting CPU {} to default clockspeed", self.index);

View file

@ -125,7 +125,7 @@ impl Gpu {
setting: crate::settings::SettingVariant::Gpu,
},
)?;
} else if self.state.clock_limits_set || self.state.is_resuming {
} else if self.state.clock_limits_set || (self.state.is_resuming && !self.limits.skip_resume_reclock) {
self.state.clock_limits_set = false;
// disable manual clock limits
// max clock

View file

@ -83,6 +83,7 @@ pub(super) struct CpuLimits {
pub clock_min: MinMax<u64>,
pub clock_max: MinMax<u64>,
pub clock_step: u64,
pub skip_resume_reclock: bool,
}
impl Default for CpuLimits {
@ -91,6 +92,7 @@ impl Default for CpuLimits {
clock_min: MinMax { min: 1400, max: 3500 },
clock_max: MinMax { min: 400, max: 3500 },
clock_step: 100,
skip_resume_reclock: false,
}
}
}
@ -104,6 +106,7 @@ pub(super) struct GpuLimits {
pub clock_min: MinMax<u64>,
pub clock_max: MinMax<u64>,
pub clock_step: u64,
pub skip_resume_reclock: bool,
}
impl Default for GpuLimits {
@ -116,6 +119,7 @@ impl Default for GpuLimits {
clock_min: MinMax { min: 200, max: 1600 },
clock_max: MinMax { min: 200, max: 1600 },
clock_step: 100,
skip_resume_reclock: false,
}
}
}

View file

@ -7,42 +7,50 @@
{
"clock_min": {"min": 1400, "max": 3500},
"clock_max": {"min": 500, "max": 3500},
"clock_step": 100
"clock_step": 100,
"skip_resume_reclock": false
},
{
"clock_min": {"min": 1400, "max": 3500},
"clock_max": {"min": 500, "max": 3500},
"clock_step": 100
"clock_step": 100,
"skip_resume_reclock": false
},
{
"clock_min": {"min": 1400, "max": 3500},
"clock_max": {"min": 500, "max": 3500},
"clock_step": 100
"clock_step": 100,
"skip_resume_reclock": false
},
{
"clock_min": {"min": 1400, "max": 3500},
"clock_max": {"min": 500, "max": 3500},
"clock_step": 100
"clock_step": 100,
"skip_resume_reclock": false
},
{
"clock_min": {"min": 1400, "max": 3500},
"clock_max": {"min": 500, "max": 3500},
"clock_step": 100
"clock_step": 100,
"skip_resume_reclock": false
},
{
"clock_min": {"min": 1400, "max": 3500},
"clock_max": {"min": 500, "max": 3500},
"clock_step": 100
"clock_step": 100,
"skip_resume_reclock": false
},
{
"clock_min": {"min": 1400, "max": 3500},
"clock_max": {"min": 500, "max": 3500},
"clock_step": 100
"clock_step": 100,
"skip_resume_reclock": false
},
{
"clock_min": {"min": 1400, "max": 3500},
"clock_max": {"min": 500, "max": 3500},
"clock_step": 100
"clock_step": 100,
"skip_resume_reclock": false
}
],
"global_governors": false
@ -54,6 +62,7 @@
"ppt_step": 1,
"clock_min": {"min": 200, "max": 1600},
"clock_max": {"min": 200, "max": 1600},
"clock_step": 100
"clock_step": 100,
"skip_resume_reclock": false
}
}