mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-29 13:28:04 +00:00
Added a fan control sensor for ATI GPUs.
This commit is contained in:
parent
9cd1c629e5
commit
9f90d4063b
@ -38,10 +38,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Drawing;
|
using System.Drawing;
|
||||||
using System.Reflection;
|
|
||||||
|
|
||||||
namespace OpenHardwareMonitor.Hardware.ATI {
|
namespace OpenHardwareMonitor.Hardware.ATI {
|
||||||
public class ATIGPU : Hardware, IHardware {
|
public class ATIGPU : Hardware {
|
||||||
|
|
||||||
private string name;
|
private string name;
|
||||||
private Image icon;
|
private Image icon;
|
||||||
@ -54,6 +53,7 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
|||||||
private Sensor memoryClock;
|
private Sensor memoryClock;
|
||||||
private Sensor coreVoltage;
|
private Sensor coreVoltage;
|
||||||
private Sensor coreLoad;
|
private Sensor coreLoad;
|
||||||
|
private Sensor fanControl;
|
||||||
|
|
||||||
public ATIGPU(string name, int adapterIndex, int busNumber,
|
public ATIGPU(string name, int adapterIndex, int busNumber,
|
||||||
int deviceNumber)
|
int deviceNumber)
|
||||||
@ -64,16 +64,14 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
|||||||
this.busNumber = busNumber;
|
this.busNumber = busNumber;
|
||||||
this.deviceNumber = deviceNumber;
|
this.deviceNumber = deviceNumber;
|
||||||
|
|
||||||
ADLFanSpeedInfo speedInfo = new ADLFanSpeedInfo();
|
|
||||||
ADL.ADL_Overdrive5_FanSpeedInfo_Get(adapterIndex, 0, ref speedInfo);
|
|
||||||
|
|
||||||
this.temperature =
|
this.temperature =
|
||||||
new Sensor("GPU Core", 0, SensorType.Temperature, this);
|
new Sensor("GPU Core", 0, SensorType.Temperature, this);
|
||||||
this.fan = new Sensor("GPU", 0, SensorType.Fan, this, null);
|
this.fan = new Sensor("GPU Fan", 0, SensorType.Fan, this, null);
|
||||||
this.coreClock = new Sensor("GPU Core", 0, SensorType.Clock, this);
|
this.coreClock = new Sensor("GPU Core", 0, SensorType.Clock, this);
|
||||||
this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this);
|
this.memoryClock = new Sensor("GPU Memory", 1, SensorType.Clock, this);
|
||||||
this.coreVoltage = new Sensor("GPU Core", 0, SensorType.Voltage, this);
|
this.coreVoltage = new Sensor("GPU Core", 0, SensorType.Voltage, this);
|
||||||
this.coreLoad = new Sensor("GPU Core", 0, SensorType.Load, this);
|
this.coreLoad = new Sensor("GPU Core", 0, SensorType.Load, this);
|
||||||
|
this.fanControl = new Sensor("GPU Fan", 0, SensorType.Control, this);
|
||||||
Update();
|
Update();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -101,7 +99,7 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
|||||||
temperature.Value = 0.001f * adlt.Temperature;
|
temperature.Value = 0.001f * adlt.Temperature;
|
||||||
ActivateSensor(temperature);
|
ActivateSensor(temperature);
|
||||||
} else {
|
} else {
|
||||||
DeactivateSensor(temperature);
|
temperature.Value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ADLFanSpeedValue adlf = new ADLFanSpeedValue();
|
ADLFanSpeedValue adlf = new ADLFanSpeedValue();
|
||||||
@ -112,7 +110,17 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
|||||||
fan.Value = adlf.FanSpeed;
|
fan.Value = adlf.FanSpeed;
|
||||||
ActivateSensor(fan);
|
ActivateSensor(fan);
|
||||||
} else {
|
} else {
|
||||||
DeactivateSensor(fan);
|
fan.Value = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
adlf = new ADLFanSpeedValue();
|
||||||
|
adlf.SpeedType = ADL.ADL_DL_FANCTRL_SPEED_TYPE_PERCENT;
|
||||||
|
if (ADL.ADL_Overdrive5_FanSpeed_Get(adapterIndex, 0, ref adlf)
|
||||||
|
== ADL.ADL_OK) {
|
||||||
|
fanControl.Value = adlf.FanSpeed;
|
||||||
|
ActivateSensor(fanControl);
|
||||||
|
} else {
|
||||||
|
fanControl.Value = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
ADLPMActivity adlp = new ADLPMActivity();
|
ADLPMActivity adlp = new ADLPMActivity();
|
||||||
@ -137,10 +145,10 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
|||||||
coreLoad.Value = Math.Min(adlp.ActivityPercent, 100);
|
coreLoad.Value = Math.Min(adlp.ActivityPercent, 100);
|
||||||
ActivateSensor(coreLoad);
|
ActivateSensor(coreLoad);
|
||||||
} else {
|
} else {
|
||||||
DeactivateSensor(coreClock);
|
coreClock.Value = null;
|
||||||
DeactivateSensor(memoryClock);
|
memoryClock.Value = null;
|
||||||
DeactivateSensor(coreVoltage);
|
coreVoltage.Value = null;
|
||||||
DeactivateSensor(coreLoad);
|
coreLoad.Value = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user