Bug 1556007 - Improve reasons for why a user is not WebRender qualified. r=jrmuizel
authorAndrew Osmond <aosmond@mozilla.com>
Fri, 31 May 2019 11:33:10 -0400
changeset 476694 d6e4e46dde44d7745040216569ed81546fb450d3
parent 476693 be852a7ddc6e3e945ee48f2248a24850a67e588f
child 476695 750046b87c63930678adff852290f1b1f76b534c
push id36105
push usercbrindusan@mozilla.com
push dateTue, 04 Jun 2019 03:48:44 +0000
treeherdermozilla-central@c909c105f914 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1556007
milestone69.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 1556007 - Improve reasons for why a user is not WebRender qualified. r=jrmuizel Differential Revision: https://phabricator.services.mozilla.com/D33302
gfx/src/gfxTelemetry.cpp
gfx/src/gfxTelemetry.h
gfx/thebes/gfxPlatform.cpp
--- a/gfx/src/gfxTelemetry.cpp
+++ b/gfx/src/gfxTelemetry.cpp
@@ -39,16 +39,22 @@ const char* FeatureStatusToString(Featur
     case FeatureStatus::BlockedScreenTooLarge:
       return "blocked-screen-too-large";
     case FeatureStatus::BlockedScreenUnknown:
       return "blocked-screen-unknown";
     case FeatureStatus::BlockedNoGfxInfo:
       return "blocked-no-gfx-info";
     case FeatureStatus::BlockedOverride:
       return "blocked-override";
+    case FeatureStatus::BlockedReleaseChannelIntel:
+      return "blocked-release-channel-intel";
+    case FeatureStatus::BlockedReleaseChannelAMD:
+      return "blocked-release-channel-amd";
+    case FeatureStatus::BlockedReleaseChannelBattery:
+      return "blocked-release-channel-battery";
     case FeatureStatus::Blacklisted:
       return "blacklisted";
     case FeatureStatus::OptIn:
       return "opt-in";
     case FeatureStatus::Failed:
       return "failed";
     case FeatureStatus::Disabled:
       return "disabled";
--- a/gfx/src/gfxTelemetry.h
+++ b/gfx/src/gfxTelemetry.h
@@ -35,16 +35,19 @@ enum class FeatureStatus {
   BlockedDeviceUnknown,
   BlockedDeviceTooOld,
   BlockedVendorUnsupported,
   BlockedHasBattery,
   BlockedScreenTooLarge,
   BlockedScreenUnknown,
   BlockedNoGfxInfo,
   BlockedOverride,
+  BlockedReleaseChannelIntel,
+  BlockedReleaseChannelAMD,
+  BlockedReleaseChannelBattery,
 
   // This feature has been blocked by the graphics blacklist.
   Blacklisted,
 
   // This feature is disabled by default, and so activation isn't attempted
   // unless something explicitly enables it.
   OptIn,
 
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2612,65 +2612,50 @@ static FeatureState& WebRenderHardwareQu
       gfxInfo->GetAdapterDeviceID(adapterDeviceID);
       nsresult valid;
       int32_t deviceID = adapterDeviceID.ToInteger(&valid, 16);
       if (valid != NS_OK) {
         featureWebRenderQualified.Disable(
             FeatureStatus::BlockedDeviceUnknown, "Bad device id",
             NS_LITERAL_CSTRING("FEATURE_FAILURE_BAD_DEVICE_ID"));
       } else {
-#ifdef NIGHTLY_BUILD
-        // For AMD/Intel devices, if we have a battery, ignore it if the screen
-        // is small enough. Note that we always check for a battery with NVIDIA
-        // because we do not have a limited/curated set of devices to support
-        // WebRender on.
-        const int32_t kMaxPixelsBattery = 1920 * 1200;  // WUXGA
         const int32_t screenPixels = aScreenSize.width * aScreenSize.height;
-        bool disableForBattery = aHasBattery;
-        if ((adapterVendorID == u"0x8086" || adapterVendorID == u"0x1002") &&
-            screenPixels > 0 && screenPixels <= kMaxPixelsBattery) {
-          disableForBattery = false;
-        }
-#else
-        bool disableForBattery = aHasBattery;
-#endif
-
-        if (disableForBattery) {
-          featureWebRenderQualified.Disable(
-              FeatureStatus::BlockedHasBattery, "Has battery",
-              NS_LITERAL_CSTRING("FEATURE_FAILURE_WR_HAS_BATTERY"));
-        } else if (adapterVendorID == u"0x10de") {
+
+        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::BlockedDeviceTooOld, "Device too old",
                 NS_LITERAL_CSTRING("FEATURE_FAILURE_DEVICE_TOO_OLD"));
           }
-#ifdef EARLY_BETA_OR_EARLIER
         } 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 >= 0x6600 && deviceID < 0x66b0) ||
               (deviceID >= 0x6700 && deviceID < 0x6720) ||
               (deviceID >= 0x6780 && deviceID < 0x6840) ||
               (deviceID >= 0x6860 && deviceID < 0x6880) ||
               (deviceID >= 0x6900 && deviceID < 0x6a00) ||
               (deviceID == 0x7300) ||
               (deviceID >= 0x9830 && deviceID < 0x9870) ||
               (deviceID >= 0x9900 && deviceID < 0x9a00)) {
             // we have a desktop CAYMAN, SI, CIK, VI, or GFX9 device
+#ifndef EARLY_BETA_OR_EARLIER
+            featureWebRenderQualified.Disable(
+                FeatureStatus::BlockedReleaseChannelAMD,
+                "Release channel and AMD",
+                NS_LITERAL_CSTRING("FEATURE_FAILURE_RELEASE_CHANNEL_AMD"));
+#endif  // !EARLY_BETA_OR_EARLIER
           } else {
             featureWebRenderQualified.Disable(
                 FeatureStatus::BlockedDeviceTooOld, "Device too old",
                 NS_LITERAL_CSTRING("FEATURE_FAILURE_DEVICE_TOO_OLD"));
           }
-#endif
-#ifdef NIGHTLY_BUILD
         } else if (adapterVendorID == u"0x8086") {  // Intel
           const uint16_t supportedDevices[] = {
               // skylake gt2+
               0x1912,
               0x1913,
               0x1915,
               0x1916,
               0x1917,
@@ -2752,43 +2737,73 @@ static FeatureState& WebRenderHardwareQu
           };
           bool supported = false;
           for (uint16_t id : supportedDevices) {
             if (deviceID == id) {
               supported = true;
               break;
             }
           }
-          if (!supported) {
-            featureWebRenderQualified.Disable(
-                FeatureStatus::BlockedDeviceTooOld, "Device too old",
-                NS_LITERAL_CSTRING("FEATURE_FAILURE_DEVICE_TOO_OLD"));
-          }
-#  ifdef MOZ_WIDGET_GTK
-          else {
+          if (supported) {
+#ifdef MOZ_WIDGET_GTK
             // Performance is not great on 4k screens with WebRender + Linux.
             // Disable it for now if it is too large.
             const int32_t kMaxPixelsLinux = 3440 * 1440;  // UWQHD
             if (screenPixels > kMaxPixelsLinux) {
               featureWebRenderQualified.Disable(
                   FeatureStatus::BlockedScreenTooLarge, "Screen size too large",
                   NS_LITERAL_CSTRING("FEATURE_FAILURE_SCREEN_SIZE_TOO_LARGE"));
             } else if (screenPixels <= 0) {
               featureWebRenderQualified.Disable(
                   FeatureStatus::BlockedScreenUnknown, "Screen size unknown",
                   NS_LITERAL_CSTRING("FEATURE_FAILURE_SCREEN_SIZE_UNKNOWN"));
+            } else {
+#endif  // MOZ_WIDGET_GTK
+#ifndef NIGHTLY_BUILD
+              featureWebRenderQualified.Disable(
+                  FeatureStatus::BlockedReleaseChannelIntel,
+                  "Release channel and Intel",
+                  NS_LITERAL_CSTRING("FEATURE_FAILURE_RELEASE_CHANNEL_INTEL"));
+#endif  // !NIGHTLY_BUILD
+#ifdef MOZ_WIDGET_GTK
             }
+#endif  // MOZ_WIDGET_GTK
+          } else {
+            featureWebRenderQualified.Disable(
+                FeatureStatus::BlockedDeviceTooOld, "Device too old",
+                NS_LITERAL_CSTRING("FEATURE_FAILURE_DEVICE_TOO_OLD"));
           }
-#  endif  // MOZ_WIDGET_GTK
-#endif    // NIGHTLY_BUILD
         } else {
           featureWebRenderQualified.Disable(
               FeatureStatus::BlockedVendorUnsupported, "Unsupported vendor",
               NS_LITERAL_CSTRING("FEATURE_FAILURE_UNSUPPORTED_VENDOR"));
         }
+
+        // We leave checking the battery for last because we would like to know
+        // which users were denied WebRender only because they have a battery.
+        if (featureWebRenderQualified.IsEnabled() && aHasBattery) {
+          // For AMD/Intel devices, if we have a battery, ignore it if the
+          // screen is small enough. Note that we always check for a battery
+          // with NVIDIA because we do not have a limited/curated set of devices
+          // to support WebRender on.
+          const int32_t kMaxPixelsBattery = 1920 * 1200;  // WUXGA
+          if ((adapterVendorID == u"0x8086" || adapterVendorID == u"0x1002") &&
+              screenPixels > 0 && screenPixels <= kMaxPixelsBattery) {
+#ifndef NIGHTLY_BUILD
+            featureWebRenderQualified.Disable(
+                FeatureStatus::BlockedReleaseChannelBattery,
+                "Release channel and battery",
+                NS_LITERAL_CSTRING("FEATURE_FAILURE_RELEASE_CHANNEL_BATTERY"));
+#endif  // !NIGHTLY_BUILD
+          } else {
+            featureWebRenderQualified.Disable(
+                FeatureStatus::BlockedHasBattery, "Has battery",
+                NS_LITERAL_CSTRING("FEATURE_FAILURE_WR_HAS_BATTERY"));
+          }
+        }
       }
     }
   } else {
     featureWebRenderQualified.Disable(
         FeatureStatus::BlockedNoGfxInfo, "gfxInfo is broken",
         NS_LITERAL_CSTRING("FEATURE_FAILURE_WR_NO_GFX_INFO"));
   }
   return featureWebRenderQualified;