Changed ATI GPU device enumeration.
authormoel.mich
Sun, 07 Feb 2010 16:42:26 +0000
changeset 29f0640baf7128
parent 28 9b205b2ab056
child 30 420adf504011
Changed ATI GPU device enumeration.
Hardware/ATI/ATIGroup.cs
OpenHardwareMonitor.csproj
     1.1 --- a/Hardware/ATI/ATIGroup.cs	Sun Feb 07 16:37:15 2010 +0000
     1.2 +++ b/Hardware/ATI/ATIGroup.cs	Sun Feb 07 16:42:26 2010 +0000
     1.3 @@ -73,6 +73,9 @@
     1.4                  int isActive;
     1.5                  ADL.ADL_Adapter_Active_Get(adapterInfo[i].AdapterIndex,
     1.6                    out isActive);
     1.7 +                int adapterID;
     1.8 +                ADL.ADL_Adapter_ID_Get(adapterInfo[i].AdapterIndex,
     1.9 +                  out adapterID);
    1.10  
    1.11                  report.Append("AdapterIndex: "); 
    1.12                  report.AppendLine(i.ToString());
    1.13 @@ -91,36 +94,26 @@
    1.14                  report.Append("DeviceNumber: ");
    1.15                  report.AppendLine(adapterInfo[i].DeviceNumber.ToString());
    1.16                  report.Append("FunctionNumber: ");
    1.17 -                report.AppendLine(adapterInfo[i].FunctionNumber.ToString());                
    1.18 +                report.AppendLine(adapterInfo[i].FunctionNumber.ToString());
    1.19 +                report.Append("AdapterID: 0x");
    1.20 +                report.AppendLine(adapterID.ToString("X"));
    1.21  
    1.22 -                if (isActive == 1) {
    1.23 -                  int adapterID;
    1.24 -                  ADL.ADL_Adapter_ID_Get(adapterInfo[i].AdapterIndex,
    1.25 -                    out adapterID);
    1.26 -
    1.27 -                  report.Append("AdapterID: 0x");
    1.28 -                  report.AppendLine(adapterID.ToString("X"));
    1.29 -
    1.30 -                  if (adapterID != 0 && 
    1.31 -                    adapterInfo[i].UDID != "" && 
    1.32 -                    adapterInfo[i].Present > 0 &&
    1.33 -                    (adapterInfo[i].VendorID == ADL.ATI_VENDOR_ID1 ||
    1.34 -                     adapterInfo[i].VendorID == ADL.ATI_VENDOR_ID2)) 
    1.35 -                  {
    1.36 -                    bool found = false;
    1.37 -                    foreach (ATIGPU gpu in hardware)
    1.38 -                      if (gpu.BusNumber == adapterInfo[i].BusNumber &&
    1.39 -                        gpu.DeviceNumber == adapterInfo[i].DeviceNumber) {
    1.40 -                        found = true;
    1.41 -                        break;
    1.42 -                      }
    1.43 -                    if (!found)
    1.44 -                      hardware.Add(new ATIGPU(
    1.45 -                        adapterInfo[i].AdapterName.Trim(),
    1.46 -                        adapterInfo[i].AdapterIndex,
    1.47 -                        adapterInfo[i].BusNumber, 
    1.48 -                        adapterInfo[i].DeviceNumber));
    1.49 -                  }
    1.50 +                if (adapterID != 0 && adapterInfo[i].UDID != "" &&
    1.51 +                  (adapterInfo[i].VendorID == ADL.ATI_VENDOR_ID1 ||
    1.52 +                   adapterInfo[i].VendorID == ADL.ATI_VENDOR_ID2)) {
    1.53 +                  bool found = false;
    1.54 +                  foreach (ATIGPU gpu in hardware)
    1.55 +                    if (gpu.BusNumber == adapterInfo[i].BusNumber &&
    1.56 +                      gpu.DeviceNumber == adapterInfo[i].DeviceNumber) {
    1.57 +                      found = true;
    1.58 +                      break;
    1.59 +                    }
    1.60 +                  if (!found)
    1.61 +                    hardware.Add(new ATIGPU(
    1.62 +                      adapterInfo[i].AdapterName.Trim(),
    1.63 +                      adapterInfo[i].AdapterIndex,
    1.64 +                      adapterInfo[i].BusNumber,
    1.65 +                      adapterInfo[i].DeviceNumber));
    1.66                  }
    1.67  
    1.68                  report.AppendLine();
     2.1 --- a/OpenHardwareMonitor.csproj	Sun Feb 07 16:37:15 2010 +0000
     2.2 +++ b/OpenHardwareMonitor.csproj	Sun Feb 07 16:42:26 2010 +0000
     2.3 @@ -80,7 +80,6 @@
     2.4      <Compile Include="Hardware\ATI\ADL.cs" />
     2.5      <Compile Include="Hardware\ATI\ATIGroup.cs" />
     2.6      <Compile Include="Hardware\ATI\ATIGPU.cs" />
     2.7 -    <Compile Include="Utilities\IconFactory.cs" />
     2.8      <Compile Include="Utilities\Configuration.cs" />
     2.9      <Compile Include="Utilities\CrashReport.cs" />
    2.10      <Compile Include="Utilities\EmbeddedResources.cs" />