GPU settings tweaks

This commit is contained in:
Serge
2023-05-09 16:51:15 +02:00
parent deb515066d
commit 432508cfc5
4 changed files with 36 additions and 38 deletions

View File

@@ -17,14 +17,10 @@ namespace GHelper
SleepKeyb = 1 << 5,
ShutdownLogo = 1 << 6,
ShutdownKeyb = 1 << 7,
Unknown1 = 1 << 8,
BootBar = 1u << (7 + 2),
AwakeBar = 1u << (7 + 3),
SleepBar = 1u << (7 + 4),
ShutdownBar = 1u << (7 + 5),
Unknown2 = 1 << 13,
Unknown3 = 1 << 14,
Unknown4 = 1 << 15,
BootLid = 1u << (15 + 1),
AwakeLid = 1u << (15 + 2),
SleepLid = 1u << (15 + 3),

View File

@@ -272,11 +272,6 @@ namespace GHelper
if (checkSleepLogo.Checked) flags.Add(AuraDev19b6.SleepLogo);
if (checkShutdownLogo.Checked) flags.Add(AuraDev19b6.ShutdownLogo);
flags.Add(AuraDev19b6.Unknown1);
flags.Add(AuraDev19b6.Unknown2);
flags.Add(AuraDev19b6.Unknown3);
flags.Add(AuraDev19b6.Unknown4);
Aura.ApplyAuraPower(flags);
}

View File

@@ -107,7 +107,7 @@ namespace GHelper
InitFans();
InitPower();
InitBoost();
InitGPU();
InitGPU(true);
comboBoost.SelectedValueChanged += ComboBoost_Changed;
@@ -119,10 +119,10 @@ namespace GHelper
private void TrackGPU_MouseUp(object? sender, MouseEventArgs e)
{
Program.settingsForm.AutoGPUSettings(true);
Program.settingsForm.SetGPUSettings(true);
}
public void InitGPU()
public void InitGPU(bool readClocks = false)
{
if (HardwareControl.GpuControl is not null && HardwareControl.GpuControl.IsNvidia)
{
@@ -138,17 +138,24 @@ namespace GHelper
{
panelGPU.Visible = true;
nvControl.GetClocks(out int core, out int memory, out string gpuTitle);
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
labelGPU.Text = gpuTitle;
int gpu_boost = Program.config.getConfigPerf("gpu_boost");
int gpu_temp = Program.config.getConfigPerf("gpu_temp");
int core = Program.config.getConfigPerf("gpu_core");
int memory = Program.config.getConfigPerf("gpu_memory");
if (gpu_boost < 0) gpu_boost = ASUSWmi.MaxGPUBoost;
if (gpu_temp < 0) gpu_temp = ASUSWmi.MaxGPUTemp;
if (core == -1) core = 0;
if (memory == 1) memory = 0;
if (readClocks)
{
nvControl.GetClocks(out core, out memory, out string gpuTitle);
labelGPU.Text = gpuTitle;
}
trackGPUCore.Value = Math.Max(Math.Min(core, NvidiaGpuControl.MaxCoreOffset), NvidiaGpuControl.MinCoreOffset);
trackGPUMemory.Value = Math.Max(Math.Min(memory, NvidiaGpuControl.MaxMemoryOffset), NvidiaGpuControl.MinMemoryOffset);
trackGPUBoost.Value = Math.Max(Math.Min(gpu_boost, ASUSWmi.MaxGPUBoost), ASUSWmi.MinGPUBoost);
trackGPUTemp.Value = Math.Max(Math.Min(gpu_temp, ASUSWmi.MaxGPUTemp), ASUSWmi.MinGPUTemp);
@@ -502,7 +509,7 @@ namespace GHelper
trackGPUBoost.Value = ASUSWmi.MaxGPUBoost;
trackGPUTemp.Value = ASUSWmi.MaxGPUTemp;
Program.settingsForm.AutoGPUSettings(true);
Program.settingsForm.SetGPUSettings(true);
}
private void ChartCPU_MouseUp(object? sender, MouseEventArgs e)

View File

@@ -1045,7 +1045,7 @@ namespace GHelper
}
public void AutoGPUSettings(bool launchAsAdmin = false)
public void SetGPUSettings(bool launchAsAdmin = false)
{
int gpu_boost = Program.config.getConfigPerf("gpu_boost");
@@ -1148,24 +1148,25 @@ namespace GHelper
customPower = 0;
if (Program.config.getConfigPerf("auto_apply_power") == 1)
{
if (delay > 0)
{
var timer = new System.Timers.Timer(1000);
timer.Elapsed += delegate
{
timer.Stop();
timer.Dispose();
SetPower();
};
timer.Start();
}
else
{
SetPower();
}
bool applyPower = Program.config.getConfigPerf("auto_apply_power") == 1;
bool applyGPU = true;
if (delay > 0)
{
var timer = new System.Timers.Timer(delay);
timer.Elapsed += delegate
{
timer.Stop();
timer.Dispose();
if (applyPower) SetPower();
SetGPUSettings();
};
timer.Start();
}
else
{
if (applyPower) SetPower();
SetGPUSettings();
}
}
@@ -1221,7 +1222,6 @@ namespace GHelper
}
AutoFans();
AutoGPUSettings();
AutoPower(1000);