Bug 1523823. Enable WebRender by default on modern (CIK, VI, GFX9) desktop AMD hardware. r=kats
authorJeff Muizelaar <jrmuizel@gmail.com>
Wed, 30 Jan 2019 14:13:07 +0000
changeset 456056 65509fbdbc55
parent 456055 dd9435f9df3f
child 456057 7271b047bfa6
push id35468
push userrgurzau@mozilla.com
push dateWed, 30 Jan 2019 17:02:03 +0000
treeherdermozilla-central@37103bfa3dca [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1523823
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1523823. Enable WebRender by default on modern (CIK, VI, GFX9) desktop AMD hardware. r=kats This should help increase our WebRender usage so we're more likely to learn about problems with minimal additional risk. Differential Revision: https://phabricator.services.mozilla.com/D18020
gfx/thebes/gfxPlatform.cpp
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2652,36 +2652,56 @@ static FeatureState& WebRenderHardwareQu
                                         "No qualified hardware", aOutFailureId);
     } else if (aHasBattery) {
       featureWebRenderQualified.Disable(
           FeatureStatus::Blocked, "Has battery",
           NS_LITERAL_CSTRING("FEATURE_FAILURE_WR_HAS_BATTERY"));
     } else {
       nsAutoString adapterVendorID;
       gfxInfo->GetAdapterVendorID(adapterVendorID);
-      if (adapterVendorID != u"0x10de") {
+
+      nsAutoString adapterDeviceID;
+      gfxInfo->GetAdapterDeviceID(adapterDeviceID);
+      nsresult valid;
+      int32_t deviceID = adapterDeviceID.ToInteger(&valid, 16);
+      if (valid != NS_OK) {
         featureWebRenderQualified.Disable(
-            FeatureStatus::Blocked, "Not Nvidia",
-            NS_LITERAL_CSTRING("FEATURE_FAILURE_NOT_NVIDIA"));
+            FeatureStatus::Blocked, "Bad device id",
+            NS_LITERAL_CSTRING("FEATURE_FAILURE_BAD_DEVICE_ID"));
       } else {
-        nsAutoString adapterDeviceID;
-        gfxInfo->GetAdapterDeviceID(adapterDeviceID);
-        nsresult valid;
-        int32_t deviceID = adapterDeviceID.ToInteger(&valid, 16);
-        if (valid != NS_OK) {
+        if (adapterVendorID == u"0x10de") {
+          if (deviceID < 0x6c0) {
+            // 0x6c0 is the lowest Fermi device id. Unfortunately some Tesla
+            // devices that don't support D3D 10.1 have higher deviceIDs. They
+            // will be included, but blocked by ANGLE.
+            featureWebRenderQualified.Disable(
+                FeatureStatus::Blocked, "Device too old",
+                NS_LITERAL_CSTRING("FEATURE_FAILURE_DEVICE_TOO_OLD"));
+          }
+#ifdef NIGHTLY_BUILD
+        } else if (adapterVendorID == u"0x1002") {  // AMD
+          // AMD deviceIDs are not very well ordered. This
+          // condition is based off the information in gpu-db
+          if ((deviceID >= 0x6640 && deviceID < 0x6660) ||
+              (deviceID >= 0x67a0 && deviceID < 0x6800) ||
+              (deviceID >= 0x6860 && deviceID < 0x6880) ||
+              (deviceID >= 0x6900 && deviceID < 0x6a00) ||
+              (deviceID == 0x7300) ||
+              (deviceID >= 0x9830 && deviceID < 0x9870)) {
+            // we have a desktop CIK, VI, or GFX9 device
+          } else {
+            featureWebRenderQualified.Disable(
+                FeatureStatus::Blocked, "Device too old",
+                NS_LITERAL_CSTRING("FEATURE_FAILURE_DEVICE_TOO_OLD"));
+          }
+#endif
+        } else {
           featureWebRenderQualified.Disable(
-              FeatureStatus::Blocked, "Bad device id",
-              NS_LITERAL_CSTRING("FEATURE_FAILURE_BAD_DEVICE_ID"));
-        } else if (deviceID < 0x6c0) {
-          // 0x6c0 is the lowest Fermi device id. Unfortunately some Tesla
-          // devices that don't support D3D 10.1 have higher deviceIDs. They
-          // will be included, but blocked by ANGLE.
-          featureWebRenderQualified.Disable(
-              FeatureStatus::Blocked, "Device too old",
-              NS_LITERAL_CSTRING("FEATURE_FAILURE_DEVICE_TOO_OLD"));
+              FeatureStatus::Blocked, "Unsupported vendor",
+              NS_LITERAL_CSTRING("FEATURE_FAILURE_UNSUPPORTED_VENDOR"));
         }
       }
     }
   } else {
     featureWebRenderQualified.Disable(
         FeatureStatus::Blocked, "gfxInfo is broken",
         NS_LITERAL_CSTRING("FEATURE_FAILURE_WR_NO_GFX_INFO"));
   }