Changed ATI GPU enumeration.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+4
-1
@@ -48,7 +48,7 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = ADL.ADL_MAX_PATH)]
|
||||
public string UDID;
|
||||
public int BusNumber;
|
||||
public int DriverNumber;
|
||||
public int DeviceNumber;
|
||||
public int FunctionNumber;
|
||||
public int VendorID;
|
||||
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = ADL.ADL_MAX_PATH)]
|
||||
@@ -124,6 +124,9 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
public const int ADL_DL_FANCTRL_SUPPORTS_RPM_READ = 4;
|
||||
public const int ADL_DL_FANCTRL_SUPPORTS_RPM_WRITE = 8;
|
||||
|
||||
public const int ATI_VENDOR_ID1 = 1002;
|
||||
public const int ATI_VENDOR_ID2 = 0x1002;
|
||||
|
||||
private delegate int ADL_Main_Control_CreateDelegate(
|
||||
ADL_Main_Memory_AllocDelegate callback, int enumConnectedAdapters);
|
||||
private delegate int ADL_Adapter_AdapterInfo_GetDelegate(IntPtr info,
|
||||
|
||||
+11
-1
@@ -46,16 +46,22 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
private string name;
|
||||
private Image icon;
|
||||
private int adapterIndex;
|
||||
private int busNumber;
|
||||
private int deviceNumber;
|
||||
private Sensor temperature;
|
||||
private Sensor fan;
|
||||
private Sensor coreClock;
|
||||
private Sensor memoryClock;
|
||||
private Sensor coreVoltage;
|
||||
|
||||
public ATIGPU(string name, int adapterIndex) {
|
||||
public ATIGPU(string name, int adapterIndex, int busNumber,
|
||||
int deviceNumber)
|
||||
{
|
||||
this.name = name;
|
||||
this.icon = Utilities.EmbeddedResources.GetImage("ati.png");
|
||||
this.adapterIndex = adapterIndex;
|
||||
this.busNumber = busNumber;
|
||||
this.deviceNumber = deviceNumber;
|
||||
|
||||
ADLFanSpeedInfo speedInfo = new ADLFanSpeedInfo();
|
||||
ADL.ADL_Overdrive5_FanSpeedInfo_Get(adapterIndex, 0, ref speedInfo);
|
||||
@@ -69,6 +75,10 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
Update();
|
||||
}
|
||||
|
||||
public int BusNumber { get { return busNumber; } }
|
||||
|
||||
public int DeviceNumber { get { return deviceNumber; } }
|
||||
|
||||
public string Name {
|
||||
get { return name; }
|
||||
}
|
||||
|
||||
@@ -73,6 +73,16 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
report.AppendLine(adapterInfo[i].AdapterName);
|
||||
report.Append("UDID: ");
|
||||
report.AppendLine(adapterInfo[i].UDID);
|
||||
report.Append("Present: ");
|
||||
report.AppendLine(adapterInfo[i].Present.ToString());
|
||||
report.Append("VendorID: ");
|
||||
report.AppendLine(adapterInfo[i].VendorID.ToString());
|
||||
report.Append("BusNumber: ");
|
||||
report.AppendLine(adapterInfo[i].BusNumber.ToString());
|
||||
report.Append("DeviceNumber: ");
|
||||
report.AppendLine(adapterInfo[i].DeviceNumber.ToString());
|
||||
report.Append("FunctionNumber: ");
|
||||
report.AppendLine(adapterInfo[i].FunctionNumber.ToString());
|
||||
report.AppendLine();
|
||||
|
||||
if (isActive == 1) {
|
||||
@@ -80,10 +90,25 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
||||
ADL.ADL_Adapter_ID_Get(adapterInfo[i].AdapterIndex,
|
||||
out adapterID);
|
||||
|
||||
if (adapterID > 0 && adapterInfo[i].UDID != "") {
|
||||
hardware.Add(new ATIGPU(
|
||||
adapterInfo[i].AdapterName,
|
||||
adapterInfo[i].AdapterIndex));
|
||||
if (adapterID > 0 &&
|
||||
adapterInfo[i].UDID != "" &&
|
||||
adapterInfo[i].Present > 0 &&
|
||||
(adapterInfo[i].VendorID == ADL.ATI_VENDOR_ID1 ||
|
||||
adapterInfo[i].VendorID == ADL.ATI_VENDOR_ID2))
|
||||
{
|
||||
bool found = false;
|
||||
foreach (ATIGPU gpu in hardware)
|
||||
if (gpu.BusNumber == adapterInfo[i].BusNumber &&
|
||||
gpu.DeviceNumber == adapterInfo[i].DeviceNumber) {
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
if (!found)
|
||||
hardware.Add(new ATIGPU(
|
||||
adapterInfo[i].AdapterName,
|
||||
adapterInfo[i].AdapterIndex,
|
||||
adapterInfo[i].BusNumber,
|
||||
adapterInfo[i].DeviceNumber));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user