mirror of
https://github.com/jkocon/g-helper.git
synced 2026-02-23 13:00:52 +01:00
Vivobook Eco mode https://github.com/seerge/g-helper/issues/2847
This commit is contained in:
@@ -67,6 +67,7 @@ public class AsusACPI
|
||||
public const uint VivoBookMode = 0x00110019; // Vivobook performance modes
|
||||
|
||||
public const uint GPUEco = 0x00090020;
|
||||
public const uint GPUEcoVivo = 0x00090120;
|
||||
|
||||
public const uint GPUXGConnected = 0x00090018;
|
||||
public const uint GPUXG = 0x00090019;
|
||||
@@ -170,6 +171,7 @@ public class AsusACPI
|
||||
private bool? _allAMD = null;
|
||||
private bool? _overdrive = null;
|
||||
|
||||
public static uint GPUEcoEndpoint => AppConfig.IsVivoZenbook() ? GPUEcoVivo : GPUEco;
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
|
||||
private static extern IntPtr CreateFile(
|
||||
@@ -445,14 +447,16 @@ public class AsusACPI
|
||||
|
||||
public int SetGPUEco(int eco)
|
||||
{
|
||||
int ecoFlag = DeviceGet(GPUEco);
|
||||
uint ecoEndpoint = GPUEcoEndpoint;
|
||||
|
||||
int ecoFlag = DeviceGet(ecoEndpoint);
|
||||
if (ecoFlag < 0) return -1;
|
||||
|
||||
if (ecoFlag == 1 && eco == 0)
|
||||
return DeviceSet(GPUEco, eco, "GPUEco");
|
||||
return DeviceSet(ecoEndpoint, eco, "GPUEco");
|
||||
|
||||
if (ecoFlag == 0 && eco == 1)
|
||||
return DeviceSet(GPUEco, eco, "GPUEco");
|
||||
return DeviceSet(ecoEndpoint, eco, "GPUEco");
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace GHelper
|
||||
labelFNV.Visible = comboFNV.Visible = textFNV.Visible = false;
|
||||
}
|
||||
|
||||
if (Program.acpi.DeviceGet(AsusACPI.GPUEco) < 0)
|
||||
if (Program.acpi.DeviceGet(AsusACPI.GPUEcoEndpoint) < 0)
|
||||
{
|
||||
checkGpuApps.Visible = false;
|
||||
checkUSBC.Visible = false;
|
||||
|
||||
@@ -571,7 +571,7 @@ namespace GHelper
|
||||
public void InitGPU()
|
||||
{
|
||||
|
||||
if (Program.acpi.DeviceGet(AsusACPI.GPUEco) == 1)
|
||||
if (Program.acpi.DeviceGet(AsusACPI.GPUEcoEndpoint) == 1)
|
||||
{
|
||||
gpuVisible = buttonGPU.Visible = false;
|
||||
return;
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace GHelper.Gpu
|
||||
|
||||
public void InitGPUMode()
|
||||
{
|
||||
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
||||
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEcoEndpoint);
|
||||
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
||||
|
||||
if (mux < 0) mux = Program.acpi.DeviceGet(AsusACPI.GPUMuxVivo);
|
||||
@@ -205,7 +205,7 @@ namespace GHelper.Gpu
|
||||
|
||||
if (!GpuAuto && !ForceGPU) return false;
|
||||
|
||||
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEco);
|
||||
int eco = Program.acpi.DeviceGet(AsusACPI.GPUEcoEndpoint);
|
||||
int mux = Program.acpi.DeviceGet(AsusACPI.GPUMux);
|
||||
|
||||
if (mux == 0)
|
||||
|
||||
@@ -356,7 +356,7 @@ namespace GHelper.Mode
|
||||
if (core == -1 && memory == -1 && clock_limit == -1) return;
|
||||
//if ((gpu_core > -5 && gpu_core < 5) && (gpu_memory > -5 && gpu_memory < 5)) launchAsAdmin = false;
|
||||
|
||||
if (Program.acpi.DeviceGet(AsusACPI.GPUEco) == 1) { Logger.WriteLine("Clocks: Eco"); return; }
|
||||
if (Program.acpi.DeviceGet(AsusACPI.GPUEcoEndpoint) == 1) { Logger.WriteLine("Clocks: Eco"); return; }
|
||||
if (HardwareControl.GpuControl is null) { Logger.WriteLine("Clocks: NoGPUControl"); return; }
|
||||
if (!HardwareControl.GpuControl!.IsNvidia) { Logger.WriteLine("Clocks: NotNvidia"); return; }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user