Bug 678030. gfxinfo: Report subsys ids in crashes. r=ajuma,bjacob
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Sat, 20 Aug 2011 19:01:13 -0400
changeset 75611 e6fc16452e5273dacee60363a8909d8f8419d539
parent 75610 c51e35b364e662459866a3f53dbb627b8d97f9e0
child 75612 512ce8163e8890207f5de5a4bec9fae5948bc719
push id3
push userfelipc@gmail.com
push dateFri, 30 Sep 2011 20:09:13 +0000
reviewersajuma, bjacob
bugs678030
milestone9.0a1
Bug 678030. gfxinfo: Report subsys ids in crashes. r=ajuma,bjacob The hope is that this will be useful for identifying OEMs that are blocking driver updates. try: -b do -p win32 -u all -t none
widget/src/windows/GfxInfo.cpp
widget/src/windows/GfxInfo.h
--- a/widget/src/windows/GfxInfo.cpp
+++ b/widget/src/windows/GfxInfo.cpp
@@ -470,16 +470,18 @@ GfxInfo::Init()
 
     FreeLibrary(setupapi);
   }
 
   mAdapterVendorID  = ParseIDFromDeviceID(mDeviceID,  "VEN_", 4);
   mAdapterVendorID2 = ParseIDFromDeviceID(mDeviceID2, "VEN_", 4);
   mAdapterDeviceID  = ParseIDFromDeviceID(mDeviceID,  "&DEV_", 4);
   mAdapterDeviceID2 = ParseIDFromDeviceID(mDeviceID2, "&DEV_", 4);
+  mAdapterSubsysID  = ParseIDFromDeviceID(mDeviceID,  "&SUBSYS_", 8);
+  mAdapterSubsysID2 = ParseIDFromDeviceID(mDeviceID2, "&SUBSYS_", 8);
 
   const char *spoofedDriverVersionString = PR_GetEnv("MOZ_GFX_SPOOF_DRIVER_VERSION");
   if (spoofedDriverVersionString) {
     mDriverVersion.AssignASCII(spoofedDriverVersionString);
   }
 
   const char *spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_VENDOR_ID");
   if (spoofedVendor) {
@@ -690,16 +692,17 @@ GfxInfo::AddCrashReportAnnotations()
       deviceIDString);
   
   /* Add an App Note for now so that we get the data immediately. These
    * can go away after we store the above in the socorro db */
   nsCAutoString note;
   /* AppendPrintf only supports 32 character strings, mrghh. */
   note.AppendPrintf("AdapterVendorID: %04x, ", vendorID);
   note.AppendPrintf("AdapterDeviceID: %04x, ", deviceID);
+  note.AppendPrintf("AdapterSubsysID: %08x, ", mAdapterSubsysID);
   note.AppendPrintf("AdapterDriverVersion: ");
   note.Append(NS_LossyConvertUTF16toASCII(adapterDriverVersionString));
 
   if (vendorID == 0) {
       /* if we didn't find a valid vendorID lets append the mDeviceID string to try to find out why */
       note.Append(", ");
       note.AppendWithConversion(mDeviceID);
       note.Append(", ");
@@ -712,16 +715,17 @@ GfxInfo::AddCrashReportAnnotations()
     nsAutoString adapterDriverVersionString2;
 
     note.Append("Has dual GPUs. GPU #2: ");
     GetAdapterDeviceID2(&deviceID2);
     GetAdapterVendorID2(&vendorID2);
     GetAdapterDriverVersion2(adapterDriverVersionString2);
     note.AppendPrintf("AdapterVendorID2: %04x, ", vendorID2);
     note.AppendPrintf("AdapterDeviceID2: %04x, ", deviceID2);
+    note.AppendPrintf("AdapterSubsysID2: %08x, ", mAdapterSubsysID2);
     note.AppendPrintf("AdapterDriverVersion2: ");
     note.Append(NS_LossyConvertUTF16toASCII(adapterDriverVersionString2));
   }
   CrashReporter::AppendAppNotesToCrashReport(note);
 
 #endif
 }
 
--- a/widget/src/windows/GfxInfo.h
+++ b/widget/src/windows/GfxInfo.h
@@ -97,23 +97,25 @@ private:
   nsString mDeviceString;
   nsString mDeviceID;
   nsString mDriverVersion;
   nsString mDriverDate;
   nsString mDeviceKey;
   nsString mDeviceKeyDebug;
   PRUint32 mAdapterVendorID;
   PRUint32 mAdapterDeviceID;
+  PRUint32 mAdapterSubsysID;
   nsString mDeviceString2;
   nsString mDriverVersion2;
   nsString mDeviceID2;
   nsString mDriverDate2;
   nsString mDeviceKey2;
   PRUint32 mAdapterVendorID2;
   PRUint32 mAdapterDeviceID2;
+  PRUint32 mAdapterSubsysID2;
   PRUint32 mWindowsVersion;
   PRBool mHasDualGPU;
   PRBool mIsGPU2Active;
   PRBool mHasDriverVersionMismatch;
 };
 
 } // namespace widget
 } // namespace mozilla