From b06ac16fba21b3714d2c67f80488126126cb4cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kamil=20Trzci=C5=84ski?= Date: Sun, 20 Nov 2022 14:59:22 +0100 Subject: [PATCH] Move AMD to GPU.AMDAdrenaline --- .../Helpers/{AMD.cs => AMD/AMDAdrenaline.cs} | 14 +++++++------- PowerControl/MenuStack.cs | 5 +++-- 2 files changed, 10 insertions(+), 9 deletions(-) rename PowerControl/Helpers/{AMD.cs => AMD/AMDAdrenaline.cs} (73%) diff --git a/PowerControl/Helpers/AMD.cs b/PowerControl/Helpers/AMD/AMDAdrenaline.cs similarity index 73% rename from PowerControl/Helpers/AMD.cs rename to PowerControl/Helpers/AMD/AMDAdrenaline.cs index 3dabf67..2d8a165 100644 --- a/PowerControl/Helpers/AMD.cs +++ b/PowerControl/Helpers/AMD/AMDAdrenaline.cs @@ -5,16 +5,16 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -namespace PowerControl.Helpers +namespace PowerControl.Helpers.GPU { - internal class AMD + internal class AMDAdrenaline { // TODO: This CLSID is likely to change over time and be broken // pnputil /enum-devices /class Display - const String GPUDriverKey = "SYSTEM\\CurrentControlSet\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\0000"; - const String DriverDesc = "DriverDesc"; - const String ExpectedDriverDesc = "AMD Custom GPU 0405"; - const String GPUScaling = "GPUScaling00"; + const string GPUDriverKey = "SYSTEM\\CurrentControlSet\\Control\\Class\\{4d36e968-e325-11ce-bfc1-08002be10318}\\0000"; + const string DriverDesc = "DriverDesc"; + const string ExpectedDriverDesc = "AMD Custom GPU 0405"; + const string GPUScaling = "GPUScaling00"; internal static bool IsGPUScalingEnabled() { @@ -25,7 +25,7 @@ namespace PowerControl.Helpers return false; var driverDesc = registry.GetValue(DriverDesc); - if (driverDesc is String && ((string)driverDesc) != ExpectedDriverDesc) + if (driverDesc is string && (string)driverDesc != ExpectedDriverDesc) return false; var scalingBytes = registry.GetValue(GPUScaling); diff --git a/PowerControl/MenuStack.cs b/PowerControl/MenuStack.cs index 0f44734..d662a3a 100644 --- a/PowerControl/MenuStack.cs +++ b/PowerControl/MenuStack.cs @@ -1,5 +1,6 @@ using CommonHelpers; using PowerControl.Helpers; +using PowerControl.Helpers.GPU; using System; using System.Collections.Generic; using System.Diagnostics; @@ -56,7 +57,7 @@ namespace PowerControl Name = "Resolution", ApplyDelay = 1000, ResetValue = () => { - if (!AMD.IsGPUScalingEnabled() && !Settings.Default.EnableExperimentalFeatures) + if (!AMDAdrenaline.IsGPUScalingEnabled() && !Settings.Default.EnableExperimentalFeatures) return null; return Helpers.PhysicalMonitorBrightnessController.GetAllResolutions().Last(); }, @@ -69,7 +70,7 @@ namespace PowerControl }, CurrentValue = delegate() { - if (!AMD.IsGPUScalingEnabled() && !Settings.Default.EnableExperimentalFeatures) + if (!AMDAdrenaline.IsGPUScalingEnabled() && !Settings.Default.EnableExperimentalFeatures) return null; return Helpers.PhysicalMonitorBrightnessController.GetResolution(); },