TDP fixes

This commit is contained in:
Serge
2024-04-14 18:35:25 +02:00
parent ad8858b836
commit 6978689f3d

View File

@@ -299,16 +299,16 @@ namespace GHelper.Ally
return autoTDP; return autoTDP;
} }
private void SetTDP(int tdp) private void SetTDP(int tdp, float fps)
{ {
if (tdp < minTDP) tdp = minTDP; if (tdp < minTDP) tdp = minTDP;
if (tdp > maxTDP) tdp = maxTDP; if (tdp > maxTDP) tdp = maxTDP;
if (tdp == autoTDP) return; if (tdp == autoTDP) return;
Program.acpi.DeviceSet(AsusACPI.PPT_APUA0, tdp, "AutoTDP"); Program.acpi.DeviceSet(AsusACPI.PPT_APUA0, tdp, $"AutoTDP {fps}");
Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, tdp, "AutoTDP"); Program.acpi.DeviceSet(AsusACPI.PPT_APUA3, tdp, null);
Program.acpi.DeviceSet(AsusACPI.PPT_APUC1, tdp, "AutoTDP"); Program.acpi.DeviceSet(AsusACPI.PPT_APUC1, tdp, null);
autoTDP = tdp; autoTDP = tdp;
} }
@@ -318,13 +318,13 @@ namespace GHelper.Ally
if (fpsLimit <= 120) if (fpsLimit <= 120)
{ {
if (fps < fpsLimit - 4) if (fps <= fpsLimit - 4)
{ {
SetTDP(GetTDP() - 1); SetTDP(GetTDP() + 1, fps);
} }
else if (fps > fpsLimit - 1) else if (fps >= fpsLimit - 1)
{ {
SetTDP(GetTDP() + 1); SetTDP(GetTDP() - 1, fps);
} }
} }