diff --git a/HandheldCompanion/Managers/PerformanceManager.cs b/HandheldCompanion/Managers/PerformanceManager.cs index 01ba30883..6e956b5a6 100644 --- a/HandheldCompanion/Managers/PerformanceManager.cs +++ b/HandheldCompanion/Managers/PerformanceManager.cs @@ -143,11 +143,12 @@ private void ProfileManager_Applied(Profile profile, ProfileUpdateSource source) StartTDPWatchdog(); } else if (cpuWatchdog.Enabled) - { + { + StopTDPWatchdog(true); + // restore default TDP (if not AutoTDP is enabled) if (!profile.AutoTDPEnabled) RestoreTDP(true); - StopTDPWatchdog(); } // apply profile defined AutoTDP @@ -157,11 +158,12 @@ private void ProfileManager_Applied(Profile profile, ProfileUpdateSource source) StartAutoTDPWatchdog(); } else if (autoWatchdog.Enabled) - { + { + StopAutoTDPWatchdog(true); + // restore default TDP (if not manual TDP is enabled) if (!profile.TDPOverrideEnabled) RestoreTDP(true); - StopAutoTDPWatchdog(); } // apply profile defined GPU @@ -172,8 +174,8 @@ private void ProfileManager_Applied(Profile profile, ProfileUpdateSource source) } else if (gfxWatchdog.Enabled) { + StopGPUWatchdog(true); RestoreGPUClock(true); - StopGPUWatchdog(); } // apply profile defined EPP @@ -188,23 +190,23 @@ private void ProfileManager_Discarded(Profile profile) // restore default TDP if (profile.TDPOverrideEnabled) { - RestoreTDP(true); - StopTDPWatchdog(); + StopTDPWatchdog(true); + RestoreTDP(true); } // restore default TDP if (profile.AutoTDPEnabled) - { - RestoreTDP(true); - StopAutoTDPWatchdog(); - StopTDPWatchdog(); + { + StopAutoTDPWatchdog(true); + StopTDPWatchdog(true); + RestoreTDP(true); } // restore default GPU frequency if (profile.GPUOverrideEnabled) { - RestoreGPUClock(true); - StopGPUWatchdog(); + StopGPUWatchdog(true); + RestoreGPUClock(true); } // (un)apply profile defined EPP @@ -541,14 +543,11 @@ internal void StartGPUWatchdog() gfxWatchdog.Start(); } - internal void StopGPUWatchdog() + internal void StopGPUWatchdog(bool immediate = false) { gfxWatchdogPendingStop = true; - } - - internal void StopTDPWatchdog() - { - cpuWatchdogPendingStop = true; + if (immediate) + gfxWatchdog.Stop(); } internal void StartTDPWatchdog() @@ -558,12 +557,19 @@ internal void StartTDPWatchdog() cpuWatchdog.Start(); } + internal void StopTDPWatchdog(bool immediate = false) + { + cpuWatchdogPendingStop = true; + if (immediate) + cpuWatchdog.Stop(); + } + internal void StartAutoTDPWatchdog() { autoWatchdog.Start(); } - internal void StopAutoTDPWatchdog() + internal void StopAutoTDPWatchdog(bool immediate = false) { autoWatchdog.Stop(); } diff --git a/HandheldCompanion/Views/QuickPages/QuickProfilesPage.xaml b/HandheldCompanion/Views/QuickPages/QuickProfilesPage.xaml index 3b516c49c..3167d4576 100644 --- a/HandheldCompanion/Views/QuickPages/QuickProfilesPage.xaml +++ b/HandheldCompanion/Views/QuickPages/QuickProfilesPage.xaml @@ -81,7 +81,7 @@ TextWrapping="Wrap" />