Skip to content

Commit

Permalink
Fix #1494
Browse files Browse the repository at this point in the history
  • Loading branch information
BartoszCichecki committed Jan 1, 2025
1 parent 13ffa2f commit 0873998
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ public override async Task ApplyStateAsync()
{
if (Log.Instance.IsTraceEnabled)
Log.Instance.Trace($"Apply failed. [setting=gpuPowerBoost]", ex);
throw;
}
}

Expand All @@ -176,7 +175,6 @@ public override async Task ApplyStateAsync()
{
if (Log.Instance.IsTraceEnabled)
Log.Instance.Trace($"Apply failed. [setting=gpuConfigurableTgp]", ex);
throw;
}
}

Expand All @@ -193,7 +191,6 @@ public override async Task ApplyStateAsync()
{
if (Log.Instance.IsTraceEnabled)
Log.Instance.Trace($"Apply failed. [setting=gpuTemperatureLimit]", ex);
throw;
}
}

Expand Down
27 changes: 20 additions & 7 deletions LenovoLegionToolkit.Lib/Controllers/GodMode/GodModeControllerV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,23 @@ public override async Task ApplyStateAsync()
{ CapabilityID.CPUShortTermPowerLimit, defaultPerformancePreset?.CPUShortTermPowerLimit },
{ CapabilityID.CPUPeakPowerLimit, defaultPerformancePreset?.CPUPeakPowerLimit },
{ CapabilityID.CPUCrossLoadingPowerLimit, defaultPerformancePreset?.CPUCrossLoadingPowerLimit },
{ CapabilityID.CPUPL1Tau, defaultPerformancePreset?.CPUPL1Tau },
{ CapabilityID.APUsPPTPowerLimit, defaultPerformancePreset?.APUsPPTPowerLimit },
{ CapabilityID.CPUPL1Tau, defaultPerformancePreset?.CPUPL1Tau },
{ CapabilityID.APUsPPTPowerLimit, defaultPerformancePreset?.APUsPPTPowerLimit },
{ CapabilityID.CPUTemperatureLimit, defaultPerformancePreset?.CPUTemperatureLimit },
{ CapabilityID.GPUPowerBoost, defaultPerformancePreset?.GPUPowerBoost },
{ CapabilityID.GPUPowerBoost, defaultPerformancePreset?.GPUPowerBoost },
{ CapabilityID.GPUConfigurableTGP, defaultPerformancePreset?.GPUConfigurableTGP },
{ CapabilityID.GPUTemperatureLimit, defaultPerformancePreset?.GPUTemperatureLimit },
{ CapabilityID.GPUTemperatureLimit, defaultPerformancePreset?.GPUTemperatureLimit },
{ CapabilityID.GPUTotalProcessingPowerTargetOnAcOffsetFromBaseline, defaultPerformancePreset?.GPUTotalProcessingPowerTargetOnAcOffsetFromBaseline },
{ CapabilityID.GPUToCPUDynamicBoost, defaultPerformancePreset?.GPUToCPUDynamicBoost },
{ CapabilityID.GPUToCPUDynamicBoost, defaultPerformancePreset?.GPUToCPUDynamicBoost },
};

var failAllowedSettings = new[]
{
CapabilityID.GPUPowerBoost,
CapabilityID.GPUConfigurableTGP,
CapabilityID.GPUTemperatureLimit,
CapabilityID.GPUTotalProcessingPowerTargetOnAcOffsetFromBaseline,
CapabilityID.GPUToCPUDynamicBoost,
};

var fanTable = preset.FanTable ?? await GetDefaultFanTableAsync().ConfigureAwait(false);
Expand All @@ -93,7 +102,9 @@ public override async Task ApplyStateAsync()
{
if (Log.Instance.IsTraceEnabled)
Log.Instance.Trace($"Failed to apply {id}. [value={value}]", ex);
throw;

if (!failAllowedSettings.Contains(id))
throw;
}
}
else if (defaultPerformanceSettings.GetValueOrDefault(id) is { } defaultPerformanceValue)
Expand All @@ -109,7 +120,9 @@ public override async Task ApplyStateAsync()
{
if (Log.Instance.IsTraceEnabled)
Log.Instance.Trace($"Failed to apply default {id}. [value={defaultPerformanceValue}]", ex);
throw;

if (!failAllowedSettings.Contains(id))
throw;
}
}
else
Expand Down

0 comments on commit 0873998

Please sign in to comment.