mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Better logic to handle availability of tdp limiters
This commit is contained in:
@@ -82,13 +82,14 @@ namespace GHelper.AutoTDP
|
||||
int availableFS = 0;
|
||||
int availablePL = 0;
|
||||
|
||||
//Requires RTSS to be installed
|
||||
if (RTSSFramerateSource.IsAvailable()) availableFS++;
|
||||
|
||||
//Intel MSR Limiter is available on Intel only
|
||||
if (!RyzenControl.IsAMD()) availablePL++;
|
||||
if (IntelMSRPowerLimiter.IsAvailable()) availablePL++;
|
||||
|
||||
//ASUS ACPI Power limiter is available
|
||||
if (AppConfig.IsASUS()) availablePL++;
|
||||
if (ASUSACPIPowerLimiter.IsAvailable()) availablePL++;
|
||||
|
||||
return availablePL > 0 && availableFS > 0;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using GHelper.AutoTDP.FramerateSource;
|
||||
using GHelper.AutoTDP.PowerLimiter;
|
||||
using GHelper.UI;
|
||||
using Ryzen;
|
||||
|
||||
@@ -123,7 +124,7 @@ namespace GHelper.AutoTDP
|
||||
{
|
||||
checkBoxEnabled.Checked = AppConfig.Get("auto_tdp_enabled", 0) == 1;
|
||||
|
||||
if (!RyzenControl.IsAMD())
|
||||
if (IntelMSRPowerLimiter.IsAvailable())
|
||||
comboBoxLimiter.Items.Add("Intel MSR Power Limiter");
|
||||
|
||||
|
||||
@@ -134,14 +135,14 @@ namespace GHelper.AutoTDP
|
||||
if (comboBoxLimiter.Items.Count > 0 && limiter is null)
|
||||
comboBoxLimiter.SelectedIndex = 0;
|
||||
|
||||
if (!RyzenControl.IsAMD() && limiter is not null && limiter.Equals("intel_msr"))
|
||||
if (IntelMSRPowerLimiter.IsAvailable() && limiter is not null && limiter.Equals("intel_msr"))
|
||||
{
|
||||
comboBoxLimiter.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
if (limiter is not null && limiter.Equals("asus_acpi"))
|
||||
if (limiter is not null && limiter.Equals("asus_acpi") && ASUSACPIPowerLimiter.IsAvailable())
|
||||
{
|
||||
comboBoxLimiter.SelectedIndex = !RyzenControl.IsAMD() ? 1 : 0;
|
||||
comboBoxLimiter.SelectedIndex = IntelMSRPowerLimiter.IsAvailable() ? 1 : 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,11 @@ namespace GHelper.AutoTDP.PowerLimiter
|
||||
|
||||
}
|
||||
|
||||
public static bool IsAvailable()
|
||||
{
|
||||
return AppConfig.IsASUS();
|
||||
}
|
||||
|
||||
public void SavePowerLimits()
|
||||
{
|
||||
DefaultA0 = Program.acpi.DeviceGet(AsusACPI.PPT_APUA0);
|
||||
|
||||
@@ -27,6 +27,11 @@ namespace GHelper.AutoTDP.PowerLimiter
|
||||
ReadPowerUnit();
|
||||
}
|
||||
|
||||
public static bool IsAvailable()
|
||||
{
|
||||
return !RyzenControl.IsAMD();
|
||||
}
|
||||
|
||||
public void SavePowerLimits()
|
||||
{
|
||||
DefaultEax = 0;
|
||||
|
||||
Reference in New Issue
Block a user