mirror of
https://github.com/openhardwaremonitor/openhardwaremonitor
synced 2025-08-30 22:05:08 +00:00
Fixed Issue 213.
This commit is contained in:
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Michael Möller <m.moeller@gmx.ch>.
|
Michael Möller <m.moeller@gmx.ch>.
|
||||||
Portions created by the Initial Developer are Copyright (C) 2009-2010
|
Portions created by the Initial Developer are Copyright (C) 2009-2012
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
@@ -37,6 +37,7 @@
|
|||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
namespace OpenHardwareMonitor.Hardware.ATI {
|
namespace OpenHardwareMonitor.Hardware.ATI {
|
||||||
|
|
||||||
@@ -124,8 +125,7 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
|||||||
public const int ADL_DL_FANCTRL_SUPPORTS_RPM_WRITE = 8;
|
public const int ADL_DL_FANCTRL_SUPPORTS_RPM_WRITE = 8;
|
||||||
public const int ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED = 1;
|
public const int ADL_DL_FANCTRL_FLAG_USER_DEFINED_SPEED = 1;
|
||||||
|
|
||||||
public const int ATI_VENDOR_ID1 = 1002;
|
public const int ATI_VENDOR_ID = 0x1002;
|
||||||
public const int ATI_VENDOR_ID2 = 0x1002;
|
|
||||||
|
|
||||||
private delegate int ADL_Main_Control_CreateDelegate(
|
private delegate int ADL_Main_Control_CreateDelegate(
|
||||||
ADL_Main_Memory_AllocDelegate callback, int enumConnectedAdapters);
|
ADL_Main_Memory_AllocDelegate callback, int enumConnectedAdapters);
|
||||||
@@ -261,6 +261,23 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
|||||||
Marshal.PtrToStructure((IntPtr)((long)ptr + i * elementSize),
|
Marshal.PtrToStructure((IntPtr)((long)ptr + i * elementSize),
|
||||||
typeof(ADLAdapterInfo));
|
typeof(ADLAdapterInfo));
|
||||||
Marshal.FreeHGlobal(ptr);
|
Marshal.FreeHGlobal(ptr);
|
||||||
|
|
||||||
|
// the ADLAdapterInfo.VendorID field reported by ADL is wrong on
|
||||||
|
// Windows systems (parse error), so we fix this here
|
||||||
|
for (int i = 0; i < info.Length; i++) {
|
||||||
|
// try Windows UDID format
|
||||||
|
Match m = Regex.Match(info[i].UDID, "PCI_VEN_([A-Fa-f0-9]{1,4})&.*");
|
||||||
|
if (m.Success && m.Groups.Count == 2) {
|
||||||
|
info[i].VendorID = Convert.ToInt32(m.Groups[1].Value, 16);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// if above failed, try Unix UDID format
|
||||||
|
m = Regex.Match(info[i].UDID, "[0-9]+:[0-9]+:([0-9]+):[0-9]+:[0-9]+");
|
||||||
|
if (m.Success && m.Groups.Count == 2) {
|
||||||
|
info[i].VendorID = Convert.ToInt32(m.Groups[1].Value, 10);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Michael M<>ller <m.moeller@gmx.ch>.
|
Michael M<>ller <m.moeller@gmx.ch>.
|
||||||
Portions created by the Initial Developer are Copyright (C) 2009-2010
|
Portions created by the Initial Developer are Copyright (C) 2009-2012
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
@@ -87,8 +87,8 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
|||||||
report.Append("Present: ");
|
report.Append("Present: ");
|
||||||
report.AppendLine(adapterInfo[i].Present.ToString(
|
report.AppendLine(adapterInfo[i].Present.ToString(
|
||||||
CultureInfo.InvariantCulture));
|
CultureInfo.InvariantCulture));
|
||||||
report.Append("VendorID: ");
|
report.Append("VendorID: 0x");
|
||||||
report.AppendLine(adapterInfo[i].VendorID.ToString(
|
report.AppendLine(adapterInfo[i].VendorID.ToString("X",
|
||||||
CultureInfo.InvariantCulture));
|
CultureInfo.InvariantCulture));
|
||||||
report.Append("BusNumber: ");
|
report.Append("BusNumber: ");
|
||||||
report.AppendLine(adapterInfo[i].BusNumber.ToString(
|
report.AppendLine(adapterInfo[i].BusNumber.ToString(
|
||||||
@@ -104,8 +104,8 @@ namespace OpenHardwareMonitor.Hardware.ATI {
|
|||||||
CultureInfo.InvariantCulture));
|
CultureInfo.InvariantCulture));
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(adapterInfo[i].UDID) &&
|
if (!string.IsNullOrEmpty(adapterInfo[i].UDID) &&
|
||||||
(adapterInfo[i].VendorID == ADL.ATI_VENDOR_ID1 ||
|
adapterInfo[i].VendorID == ADL.ATI_VENDOR_ID)
|
||||||
adapterInfo[i].VendorID == ADL.ATI_VENDOR_ID2)) {
|
{
|
||||||
bool found = false;
|
bool found = false;
|
||||||
foreach (ATIGPU gpu in hardware)
|
foreach (ATIGPU gpu in hardware)
|
||||||
if (gpu.BusNumber == adapterInfo[i].BusNumber &&
|
if (gpu.BusNumber == adapterInfo[i].BusNumber &&
|
||||||
|
Reference in New Issue
Block a user