Bug 711656: special case the entire Intel GMAX4500HD series r=bjacob,joe
authorDoug Sherk <dsherk2@mozilla.com>
Tue, 28 Feb 2012 00:19:24 -0500
changeset 87821 7ce4d9b55863af0a3afc5eec27cb91afeab49f61
parent 87820 499144e6fb864e01be9955bc86b066da849296d2
child 87825 4b60c0c155f98d995b8efdb9802cb2c6c393c658
push id22153
push userbugzilla@sherk.me
push dateTue, 28 Feb 2012 05:19:40 +0000
treeherdermozilla-central@7ce4d9b55863 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbjacob, joe
bugs711656
milestone13.0a1
first release with
nightly linux32
7ce4d9b55863 / 13.0a1 / 20120228031102 / files
nightly linux64
7ce4d9b55863 / 13.0a1 / 20120228031102 / files
nightly mac
7ce4d9b55863 / 13.0a1 / 20120228031102 / files
nightly win32
7ce4d9b55863 / 13.0a1 / 20120228031102 / files
nightly win64
7ce4d9b55863 / 13.0a1 / 20120228031102 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 711656: special case the entire Intel GMAX4500HD series r=bjacob,joe Until we fix this properly, this patch special cases this set of devices so that they get handled in almost the same way as they used to be.
widget/windows/GfxInfo.cpp
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -61,16 +61,25 @@ using namespace mozilla;
 using namespace mozilla::widget;
 
 #ifdef DEBUG
 NS_IMPL_ISUPPORTS_INHERITED1(GfxInfo, GfxInfoBase, nsIGfxInfoDebug)
 #endif
 
 static const PRUint32 allWindowsVersions = 0xffffffff;
 
+/** Bug 711656
+ * HACK HACK HACK, one specific configuration seems broken, even with the
+ * blocklist: Intel 4500/HD
+ * Rather than backing this out, add a special case for this set.
+ * This should get backed out eventually.
+ */
+static PRUint32 gDeviceID;
+static PRUint32 gVendorID;
+
 #define V(a,b,c,d) GFX_DRIVER_VERSION(a,b,c,d)
 
 
 GfxInfo::GfxInfo()
  :  mWindowsVersion(0),
     mHasDualGPU(false),
     mIsGPU2Active(false)
 {
@@ -378,16 +387,20 @@ GfxInfo::Init()
           break;
         }
       }
     }
 
     SetupDiDestroyDeviceInfoList(devinfo);
   }
 
+  /** Bug 711656: HACK HACK HACK */
+  gVendorID = ParseIDFromDeviceID(mDeviceID, "VEN_", 4);
+  gDeviceID = ParseIDFromDeviceID(mDeviceID, "&DEV_", 4);
+
   mAdapterVendorID.AppendPrintf("0x%04x", ParseIDFromDeviceID(mDeviceID, "VEN_", 4));
   mAdapterDeviceID.AppendPrintf("0x%04x", ParseIDFromDeviceID(mDeviceID, "&DEV_", 4));
   mAdapterSubsysID  = ParseIDFromDeviceID(mDeviceID,  "&SUBSYS_", 8);
 
   // We now check for second display adapter.
 
   // Device interface class for display adapters.
   CLSID GUID_DISPLAY_DEVICE_ARRIVAL;
@@ -896,16 +909,73 @@ GfxInfo::GetFeatureStatusImpl(PRInt32 aF
 {
   NS_ENSURE_ARG_POINTER(aStatus);
   aSuggestedDriverVersion.SetIsVoid(true);
   OperatingSystem os = WindowsVersionToOperatingSystem(mWindowsVersion);
   *aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
   if (aOS)
     *aOS = os;
 
+  /** Bug 711656: HACK HACK HACK
+   * Special case this, even though it's already in the blocklist. 
+   * Note that we're getting the driver version twice because the first one
+   * happens within the 'if (!aDriverInfo->Length())' check, but we don't want to
+   * modify that. Scope this within an anonymous block so that it's easier to
+   * remove later and clearer what is part of the hack.
+   */
+  {
+    nsAutoString adapterDriverVersionString;
+    GetAdapterDriverVersion(adapterDriverVersionString);
+
+    PRUint64 driverVersion;
+    if (!ParseDriverVersion(adapterDriverVersionString, &driverVersion)) {
+      return NS_ERROR_FAILURE;
+    }
+
+    static PRUint32 IntelGMAX4500HD[] = {
+      0x2a42, /* IntelGMA4500MHD_1 */
+      0x2a43, /* IntelGMA4500MHD_2 */
+      0x2e42, /* IntelB43_1 */
+      0x2e43, /* IntelB43_2 */
+      0x2e92, /* IntelB43_3 */
+      0x2e93, /* IntelB43_4 */
+      0x2e32, /* IntelG41_1 */
+      0x2e33, /* IntelG41_2 */
+      0x2e22, /* IntelG45_1 */
+      0x2e23, /* IntelG45_2 */
+      0x2e12, /* IntelQ45_1 */
+      0x2e13, /* IntelQ45_2 */
+      0x0042, /* IntelHDGraphics */
+      0x0046, /* IntelMobileHDGraphics */
+      0x0102, /* IntelSandyBridge_1 */
+      0x0106, /* IntelSandyBridge_2 */
+      0x0112, /* IntelSandyBridge_3 */
+      0x0116, /* IntelSandyBridge_4 */
+      0x0122, /* IntelSandyBridge_5 */
+      0x0126, /* IntelSandyBridge_6 */
+      0x010a, /* IntelSandyBridge_7 */
+      0x0080 /* IntelIvyBridge */
+    };
+
+    if (((mWindowsVersion == gfxWindowsPlatform::kWindowsXP &&
+         driverVersion < V(6,14,10,5284)) ||
+         (mWindowsVersion == gfxWindowsPlatform::kWindowsVista &&
+         driverVersion < V(8,15,10,2202)) ||
+         (mWindowsVersion == gfxWindowsPlatform::kWindows7 &&
+         driverVersion < V(8,15,10,2202))) &&
+        gVendorID == 0x8086 /* Intel */) {
+      for (PRUint32 i = 0; i < ArrayLength(IntelGMAX4500HD); i++) {
+        if (IntelGMAX4500HD[i] == gDeviceID) {
+          *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION;
+          return NS_OK;
+        }
+      } 
+    }
+  }
+
   // Don't evaluate special cases if we're checking the downloaded blocklist.
   if (!aDriverInfo.Length()) {
     nsAutoString adapterVendorID;
     nsAutoString adapterDeviceID;
     nsAutoString adapterDriverVersionString;
     if (NS_FAILED(GetAdapterVendorID(adapterVendorID)) ||
         NS_FAILED(GetAdapterDeviceID(adapterDeviceID)) ||
         NS_FAILED(GetAdapterDriverVersion(adapterDriverVersionString)))