Bug 1499554 - Don't blacklist the GPU process for vendors not on the whitelist. r=jrmuizel
authorRyan Hunt <rhunt@eqrion.net>
Tue, 23 Oct 2018 04:43:28 +0000
changeset 490846 b7b09fca2cc5c9b06ecf3a4fb4494b9a867d4541
parent 490845 bebe2e4eab255b73ca22ba3b55684fcc0b222d16
child 490847 cc96d514beb84065d58268555e4f988269fe772a
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewersjrmuizel
bugs1499554
milestone65.0a1
Bug 1499554 - Don't blacklist the GPU process for vendors not on the whitelist. r=jrmuizel We currently allow the GPU process if we are not hardware accelerated. One of the reasons we might not use hardware acceleration is because the device vendor is not in the gfxInfo whitelist. In this case, we should be consistent and still use the GPU process. Differential Revision: https://phabricator.services.mozilla.com/D9446
widget/windows/GfxInfo.cpp
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -958,16 +958,29 @@ WindowsVersionToOperatingSystem(int32_t 
     case kWindows10:
       return OperatingSystem::Windows10;
     case kWindowsUnknown:
     default:
       return OperatingSystem::Unknown;
     }
 }
 
+static bool
+OnlyAllowFeatureOnWhitelistedVendor(int32_t aFeature)
+{
+  switch(aFeature) {
+    // The GPU process doesn't need hardware acceleration and can run on
+    // devices that we normally block from not being on our whitelist.
+    case nsIGfxInfo::FEATURE_GPU_PROCESS:
+      return false;
+    default:
+      return true;
+  }
+}
+
 // Return true if the CPU supports AVX, but the operating system does not.
 #if defined(_M_X64)
 static inline bool
 DetectBrokenAVX()
 {
   int regs[4];
   __cpuid(regs, 0);
   if (regs[0] == 0) {
@@ -1478,17 +1491,18 @@ GfxInfo::GetFeatureStatusImpl(int32_t aF
         NS_FAILED(GetAdapterDeviceID(adapterDeviceID)) ||
         NS_FAILED(GetAdapterDriverVersion(adapterDriverVersionString)))
     {
       aFailureId = "FEATURE_FAILURE_GET_ADAPTER";
       *aStatus = FEATURE_BLOCKED_DEVICE;
       return NS_OK;
     }
 
-    if (!adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorIntel), nsCaseInsensitiveStringComparator()) &&
+    if (OnlyAllowFeatureOnWhitelistedVendor(aFeature) &&
+        !adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorIntel), nsCaseInsensitiveStringComparator()) &&
         !adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), nsCaseInsensitiveStringComparator()) &&
         !adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorAMD), nsCaseInsensitiveStringComparator()) &&
         !adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorATI), nsCaseInsensitiveStringComparator()) &&
         !adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorMicrosoft), nsCaseInsensitiveStringComparator()) &&
         !adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorParallels), nsCaseInsensitiveStringComparator()) &&
         !adapterVendorID.Equals(GfxDriverInfo::GetDeviceVendor(VendorQualcomm), nsCaseInsensitiveStringComparator()) &&
         // FIXME - these special hex values are currently used in xpcshell tests introduced by
         // bug 625160 patch 8/8. Maybe these tests need to be adjusted now that we're only whitelisting