Check if ADL overdrive caps method exists and InpOut opened OK.
This commit is contained in:
@@ -140,7 +140,8 @@ internal sealed class AmdGpu : GenericGpu
|
||||
ActivateSensor(_fullscreenFps);
|
||||
}
|
||||
|
||||
if (AtiAdlxx.ADL_Overdrive_Caps(_adapterInfo.AdapterIndex, ref supported, ref enabled, ref version) == AtiAdlxx.ADLStatus.ADL_OK)
|
||||
if (AtiAdlxx.ADL_Method_Exists(nameof(AtiAdlxx.ADL_Overdrive_Caps)) &&
|
||||
AtiAdlxx.ADL_Overdrive_Caps(_adapterInfo.AdapterIndex, ref supported, ref enabled, ref version) == AtiAdlxx.ADLStatus.ADL_OK)
|
||||
{
|
||||
_overdriveApiSupported = supported == AtiAdlxx.ADL_TRUE;
|
||||
_currentOverdriveApiLevel = version;
|
||||
|
||||
@@ -162,11 +162,8 @@ internal class RyzenSMU
|
||||
|
||||
_supportedCPU = Environment.Is64BitOperatingSystem == Environment.Is64BitProcess && SetAddresses(_cpuCodeName);
|
||||
|
||||
if (_supportedCPU)
|
||||
{
|
||||
InpOut.Open();
|
||||
if (_supportedCPU && InpOut.Open())
|
||||
SetupPmTableAddrAndSize();
|
||||
}
|
||||
}
|
||||
|
||||
private static CpuCodeName GetCpuCodeName(uint family, uint model, uint packageType)
|
||||
@@ -706,9 +703,7 @@ internal class RyzenSMU
|
||||
if (Ring0.WaitPciBusMutex(10))
|
||||
{
|
||||
if (Ring0.WritePciConfig(0x00, SMU_PCI_ADDR_REG, addr))
|
||||
{
|
||||
Ring0.WritePciConfig(0x00, SMU_PCI_DATA_REG, data);
|
||||
}
|
||||
|
||||
Ring0.ReleasePciBusMutex();
|
||||
}
|
||||
@@ -721,9 +716,7 @@ internal class RyzenSMU
|
||||
if (Ring0.WaitPciBusMutex(10))
|
||||
{
|
||||
if (Ring0.WritePciConfig(0x00, SMU_PCI_ADDR_REG, addr))
|
||||
{
|
||||
read = Ring0.ReadPciConfig(0x00, SMU_PCI_DATA_REG, out data);
|
||||
}
|
||||
|
||||
Ring0.ReleasePciBusMutex();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user