Move AMD to GPU.AMDAdrenaline

This commit is contained in:
Kamil Trzciński 2022-11-20 14:59:22 +01:00
parent 7b1442db14
commit b06ac16fba
2 changed files with 10 additions and 9 deletions

View file

@ -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);

View file

@ -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();
},