Skip to content
This repository was archived by the owner on Jul 24, 2025. It is now read-only.

Commit 0873998

Browse files
Fix #1494
1 parent 13ffa2f commit 0873998

File tree

2 files changed

+20
-10
lines changed

2 files changed

+20
-10
lines changed

LenovoLegionToolkit.Lib/Controllers/GodMode/GodModeControllerV1.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,6 @@ public override async Task ApplyStateAsync()
159159
{
160160
if (Log.Instance.IsTraceEnabled)
161161
Log.Instance.Trace($"Apply failed. [setting=gpuPowerBoost]", ex);
162-
throw;
163162
}
164163
}
165164

@@ -176,7 +175,6 @@ public override async Task ApplyStateAsync()
176175
{
177176
if (Log.Instance.IsTraceEnabled)
178177
Log.Instance.Trace($"Apply failed. [setting=gpuConfigurableTgp]", ex);
179-
throw;
180178
}
181179
}
182180

@@ -193,7 +191,6 @@ public override async Task ApplyStateAsync()
193191
{
194192
if (Log.Instance.IsTraceEnabled)
195193
Log.Instance.Trace($"Apply failed. [setting=gpuTemperatureLimit]", ex);
196-
throw;
197194
}
198195
}
199196

LenovoLegionToolkit.Lib/Controllers/GodMode/GodModeControllerV2.cs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,23 @@ public override async Task ApplyStateAsync()
6565
{ CapabilityID.CPUShortTermPowerLimit, defaultPerformancePreset?.CPUShortTermPowerLimit },
6666
{ CapabilityID.CPUPeakPowerLimit, defaultPerformancePreset?.CPUPeakPowerLimit },
6767
{ CapabilityID.CPUCrossLoadingPowerLimit, defaultPerformancePreset?.CPUCrossLoadingPowerLimit },
68-
{ CapabilityID.CPUPL1Tau, defaultPerformancePreset?.CPUPL1Tau },
69-
{ CapabilityID.APUsPPTPowerLimit, defaultPerformancePreset?.APUsPPTPowerLimit },
68+
{ CapabilityID.CPUPL1Tau, defaultPerformancePreset?.CPUPL1Tau },
69+
{ CapabilityID.APUsPPTPowerLimit, defaultPerformancePreset?.APUsPPTPowerLimit },
7070
{ CapabilityID.CPUTemperatureLimit, defaultPerformancePreset?.CPUTemperatureLimit },
71-
{ CapabilityID.GPUPowerBoost, defaultPerformancePreset?.GPUPowerBoost },
71+
{ CapabilityID.GPUPowerBoost, defaultPerformancePreset?.GPUPowerBoost },
7272
{ CapabilityID.GPUConfigurableTGP, defaultPerformancePreset?.GPUConfigurableTGP },
73-
{ CapabilityID.GPUTemperatureLimit, defaultPerformancePreset?.GPUTemperatureLimit },
73+
{ CapabilityID.GPUTemperatureLimit, defaultPerformancePreset?.GPUTemperatureLimit },
7474
{ CapabilityID.GPUTotalProcessingPowerTargetOnAcOffsetFromBaseline, defaultPerformancePreset?.GPUTotalProcessingPowerTargetOnAcOffsetFromBaseline },
75-
{ CapabilityID.GPUToCPUDynamicBoost, defaultPerformancePreset?.GPUToCPUDynamicBoost },
75+
{ CapabilityID.GPUToCPUDynamicBoost, defaultPerformancePreset?.GPUToCPUDynamicBoost },
76+
};
77+
78+
var failAllowedSettings = new[]
79+
{
80+
CapabilityID.GPUPowerBoost,
81+
CapabilityID.GPUConfigurableTGP,
82+
CapabilityID.GPUTemperatureLimit,
83+
CapabilityID.GPUTotalProcessingPowerTargetOnAcOffsetFromBaseline,
84+
CapabilityID.GPUToCPUDynamicBoost,
7685
};
7786

7887
var fanTable = preset.FanTable ?? await GetDefaultFanTableAsync().ConfigureAwait(false);
@@ -93,7 +102,9 @@ public override async Task ApplyStateAsync()
93102
{
94103
if (Log.Instance.IsTraceEnabled)
95104
Log.Instance.Trace($"Failed to apply {id}. [value={value}]", ex);
96-
throw;
105+
106+
if (!failAllowedSettings.Contains(id))
107+
throw;
97108
}
98109
}
99110
else if (defaultPerformanceSettings.GetValueOrDefault(id) is { } defaultPerformanceValue)
@@ -109,7 +120,9 @@ public override async Task ApplyStateAsync()
109120
{
110121
if (Log.Instance.IsTraceEnabled)
111122
Log.Instance.Trace($"Failed to apply default {id}. [value={defaultPerformanceValue}]", ex);
112-
throw;
123+
124+
if (!failAllowedSettings.Contains(id))
125+
throw;
113126
}
114127
}
115128
else

0 commit comments

Comments
 (0)