This reverts commit 411203902b.
This commit is contained in:
@@ -121,27 +121,14 @@ namespace LibreHardwareMonitor.Hardware.Gpu
|
||||
{
|
||||
if (control.ControlMode == ControlMode.Software)
|
||||
{
|
||||
if (_currentOverdriveApiLevel >= 6)
|
||||
AtiAdlxx.ADLFanSpeedValue fanSpeedValue = new AtiAdlxx.ADLFanSpeedValue
|
||||
{
|
||||
AtiAdlxx.ADLOD6FanSpeedValue fanSpeedValue = new AtiAdlxx.ADLOD6FanSpeedValue
|
||||
{
|
||||
SpeedType = AtiAdlxx.ADL_DL_FANCTRL_SPEED_TYPE_PERCENT,
|
||||
FanSpeed = (int)control.SoftwareValue
|
||||
};
|
||||
SpeedType = AtiAdlxx.ADL_DL_FANCTRL_SPEED_TYPE_PERCENT,
|
||||
Flags = AtiAdlxx.ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED,
|
||||
FanSpeed = (int)control.SoftwareValue
|
||||
};
|
||||
|
||||
AtiAdlxx.ADL_Overdrive6_FanSpeed_Set(_adapterIndex, ref fanSpeedValue);
|
||||
}
|
||||
else
|
||||
{
|
||||
AtiAdlxx.ADLFanSpeedValue fanSpeedValue = new AtiAdlxx.ADLFanSpeedValue
|
||||
{
|
||||
SpeedType = AtiAdlxx.ADL_DL_FANCTRL_SPEED_TYPE_PERCENT,
|
||||
Flags = AtiAdlxx.ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED,
|
||||
FanSpeed = (int)control.SoftwareValue
|
||||
};
|
||||
|
||||
AtiAdlxx.ADL_Overdrive5_FanSpeed_Set(_adapterIndex, 0, ref fanSpeedValue);
|
||||
}
|
||||
AtiAdlxx.ADL_Overdrive5_FanSpeed_Set(_adapterIndex, 0, ref fanSpeedValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,14 +154,7 @@ namespace LibreHardwareMonitor.Hardware.Gpu
|
||||
/// </summary>
|
||||
private void SetDefaultFanSpeed()
|
||||
{
|
||||
if (_currentOverdriveApiLevel >= 6)
|
||||
{
|
||||
AtiAdlxx.ADL_Overdrive6_FanSpeed_Reset(_adapterIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
AtiAdlxx.ADL_Overdrive5_FanSpeedToDefault_Set(_adapterIndex, 0);
|
||||
}
|
||||
AtiAdlxx.ADL_Overdrive5_FanSpeedToDefault_Set(_adapterIndex, 0);
|
||||
}
|
||||
|
||||
public override void Update()
|
||||
@@ -214,34 +194,22 @@ namespace LibreHardwareMonitor.Hardware.Gpu
|
||||
}
|
||||
|
||||
AtiAdlxx.ADLFanSpeedValue fanSpeedValue = new AtiAdlxx.ADLFanSpeedValue { SpeedType = AtiAdlxx.ADL_DL_FANCTRL_SPEED_TYPE_RPM };
|
||||
AtiAdlxx.ADLOD6FanSpeedValue fanSpeed6Value = new AtiAdlxx.ADLOD6FanSpeedValue { SpeedType = AtiAdlxx.ADL_DL_FANCTRL_SPEED_TYPE_RPM };
|
||||
if (_currentOverdriveApiLevel <= 5 && AtiAdlxx.ADL_Overdrive5_FanSpeed_Get(_adapterIndex, 0, ref fanSpeedValue) == AtiAdlxx.ADLStatus.ADL_OK)
|
||||
if (AtiAdlxx.ADL_Overdrive5_FanSpeed_Get(_adapterIndex, 0, ref fanSpeedValue) == AtiAdlxx.ADLStatus.ADL_OK)
|
||||
{
|
||||
_fan.Value = fanSpeedValue.FanSpeed;
|
||||
ActivateSensor(_fan);
|
||||
}
|
||||
else if (_currentOverdriveApiLevel >= 6 && AtiAdlxx.ADL_Overdrive6_FanSpeed_Get(_adapterIndex, ref fanSpeed6Value) == AtiAdlxx.ADLStatus.ADL_OK)
|
||||
{
|
||||
_fan.Value = fanSpeed6Value.FanSpeed;
|
||||
ActivateSensor(_fan);
|
||||
}
|
||||
else
|
||||
{
|
||||
_fan.Value = null;
|
||||
}
|
||||
|
||||
fanSpeedValue = new AtiAdlxx.ADLFanSpeedValue { SpeedType = AtiAdlxx.ADL_DL_FANCTRL_SPEED_TYPE_PERCENT };
|
||||
fanSpeed6Value = new AtiAdlxx.ADLOD6FanSpeedValue { SpeedType = AtiAdlxx.ADL_DL_FANCTRL_SPEED_TYPE_PERCENT };
|
||||
if (_currentOverdriveApiLevel <= 5 && AtiAdlxx.ADL_Overdrive5_FanSpeed_Get(_adapterIndex, 0, ref fanSpeedValue) == AtiAdlxx.ADLStatus.ADL_OK)
|
||||
if (AtiAdlxx.ADL_Overdrive5_FanSpeed_Get(_adapterIndex, 0, ref fanSpeedValue) == AtiAdlxx.ADLStatus.ADL_OK)
|
||||
{
|
||||
_controlSensor.Value = fanSpeedValue.FanSpeed;
|
||||
ActivateSensor(_controlSensor);
|
||||
}
|
||||
else if (_currentOverdriveApiLevel >= 6 && AtiAdlxx.ADL_Overdrive6_FanSpeed_Get(_adapterIndex, ref fanSpeed6Value) == AtiAdlxx.ADLStatus.ADL_OK)
|
||||
{
|
||||
_controlSensor.Value = fanSpeed6Value.FanSpeed;
|
||||
ActivateSensor(_controlSensor);
|
||||
}
|
||||
else
|
||||
{
|
||||
_controlSensor.Value = null;
|
||||
|
||||
@@ -96,15 +96,6 @@ namespace LibreHardwareMonitor.Interop
|
||||
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ADLStatus ADL_Overdrive5_FanSpeed_Set(int adapterIndex, int thermalControllerIndex, ref ADLFanSpeedValue fanSpeedValue);
|
||||
|
||||
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ADLStatus ADL_Overdrive6_FanSpeed_Get(int adapterIndex, ref ADLOD6FanSpeedValue FanSpeedValue);
|
||||
|
||||
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ADLStatus ADL_Overdrive6_FanSpeed_Set(int adapterIndex, ref ADLOD6FanSpeedValue FanSpeedValue);
|
||||
|
||||
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ADLStatus ADL_Overdrive6_FanSpeed_Reset(int adapterIndex);
|
||||
|
||||
[DllImport(DllName, CallingConvention = CallingConvention.Cdecl)]
|
||||
public static extern ADLStatus ADL2_OverdriveN_PerformanceStatus_Get(IntPtr context, int adapterIndex, out ADLODNPerformanceStatus performanceStatus);
|
||||
|
||||
@@ -364,20 +355,7 @@ namespace LibreHardwareMonitor.Interop
|
||||
public int FanSpeed;
|
||||
public int Flags;
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct ADLOD6FanSpeedValue
|
||||
{
|
||||
/// Indicates the units of the fan speed. Possible values: \ref ADL_OD6_FANSPEED_TYPE_PERCENT, \ref ADL_OD6_FANSPEED_TYPE_RPM
|
||||
public int SpeedType;
|
||||
/// Fan speed value (units as indicated above)
|
||||
public int FanSpeed;
|
||||
/// Value for future extension
|
||||
public int ExtValue;
|
||||
/// Mask for future extension
|
||||
public int ExtMask;
|
||||
}
|
||||
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct ADLFanSpeedInfo
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user