Optimized mode switch from Ultimate

This commit is contained in:
Serge
2023-07-01 11:46:46 +02:00
parent c4adb1eb8b
commit ec7350cf5c
3 changed files with 15 additions and 11 deletions

View File

@@ -145,7 +145,7 @@ namespace GHelper.Gpu
if (status == 0 && eco == 1 && hardWay) RestartGPU(); if (status == 0 && eco == 1 && hardWay) RestartGPU();
await Task.Delay(TimeSpan.FromMilliseconds(100)); await Task.Delay(TimeSpan.FromMilliseconds(100));
settings.Invoke(delegate settings.Invoke(delegate
{ {
InitGPUMode(); InitGPUMode();
@@ -173,7 +173,7 @@ namespace GHelper.Gpu
} }
public bool AutoGPUMode() public bool AutoGPUMode(bool optimized = false)
{ {
bool GpuAuto = AppConfig.Is("gpu_auto"); bool GpuAuto = AppConfig.Is("gpu_auto");
@@ -186,8 +186,11 @@ namespace GHelper.Gpu
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco); int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux); int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
if (mux == 0) // GPU in Ultimate, ignore if (mux == 0)
{
if (optimized) SetGPUMode(AsusACPI.GPUModeStandard);
return false; return false;
}
else else
{ {

View File

@@ -34,8 +34,9 @@ public class Startup
using (TaskDefinition td = TaskService.Instance.NewTask()) using (TaskDefinition td = TaskService.Instance.NewTask())
{ {
td.RegistrationInfo.Description = "G-Helper Auto Start"; td.RegistrationInfo.Description = "G-Helper Auto Start";
td.Triggers.Add(new LogonTrigger { UserId = userId }); td.Triggers.Add(new LogonTrigger { UserId = userId, Delay = TimeSpan.FromSeconds(1) });
td.Actions.Add(strExeFilePath); td.Actions.Add(strExeFilePath);
if (ProcessHelper.IsUserAdministrator()) if (ProcessHelper.IsUserAdministrator())

View File

@@ -419,13 +419,6 @@ namespace GHelper
} }
private void ButtonOptimized_Click(object? sender, EventArgs e)
{
AppConfig.Set("gpu_auto", (AppConfig.Get("gpu_auto") == 1) ? 0 : 1);
VisualiseGPUMode();
gpuControl.AutoGPUMode();
}
private void ButtonScreenAuto_Click(object? sender, EventArgs e) private void ButtonScreenAuto_Click(object? sender, EventArgs e)
{ {
AppConfig.Set("screen_auto", 1); AppConfig.Set("screen_auto", 1);
@@ -753,6 +746,13 @@ namespace GHelper
} }
private void ButtonOptimized_Click(object? sender, EventArgs e)
{
AppConfig.Set("gpu_auto", (AppConfig.Get("gpu_auto") == 1) ? 0 : 1);
VisualiseGPUMode();
gpuControl.AutoGPUMode(true);
}
private void ButtonStopGPU_Click(object? sender, EventArgs e) private void ButtonStopGPU_Click(object? sender, EventArgs e)
{ {
gpuControl.KillGPUApps(); gpuControl.KillGPUApps();