Bug 1560335 - Enable webrender for Pixel 2 on GeckoView Nightly. r=aosmond
authorJamie Nicol <jnicol@mozilla.com>
Tue, 10 Sep 2019 10:46:13 +0000
changeset 557134 3e23c7840a379fa64d2e763480fdb431a6678d5c
parent 557133 4275477d1193a591d439768b7e3ab5582ed38ee0
child 557135 81641e8ed75ca797b483ce3baefcec7e0060ab7d
push id2195
push userffxbld-merge
push dateMon, 25 Nov 2019 12:02:33 +0000
treeherdermozilla-release@19adee6f7bb3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaosmond
bugs1560335
milestone71.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 1560335 - Enable webrender for Pixel 2 on GeckoView Nightly. r=aosmond Differential Revision: https://phabricator.services.mozilla.com/D35436
gfx/src/gfxTelemetry.cpp
gfx/src/gfxTelemetry.h
gfx/thebes/gfxPlatform.cpp
widget/android/GfxInfo.cpp
--- a/gfx/src/gfxTelemetry.cpp
+++ b/gfx/src/gfxTelemetry.cpp
@@ -47,16 +47,18 @@ const char* FeatureStatusToString(Featur
     case FeatureStatus::BlockedReleaseChannelIntel:
       return "blocked-release-channel-intel";
     case FeatureStatus::BlockedReleaseChannelAMD:
       return "blocked-release-channel-amd";
     case FeatureStatus::BlockedReleaseChannelNvidia:
       return "blocked-release-channel-nvidia";
     case FeatureStatus::BlockedReleaseChannelBattery:
       return "blocked-release-channel-battery";
+    case FeatureStatus::BlockedReleaseChannelAndroid:
+      return "blocked-release-channel-android";
     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
@@ -39,16 +39,17 @@ enum class FeatureStatus {
   BlockedScreenTooLarge,
   BlockedScreenUnknown,
   BlockedNoGfxInfo,
   BlockedOverride,
   BlockedReleaseChannelIntel,
   BlockedReleaseChannelAMD,
   BlockedReleaseChannelNvidia,
   BlockedReleaseChannelBattery,
+  BlockedReleaseChannelAndroid,
 
   // 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
@@ -2620,16 +2620,17 @@ static bool CalculateWrQualifiedPrefValu
   // above to abort early as the pref would have a valid type.
   //  We also don't want those prefs to appear in about:config.
   if (Preferences::HasUserValue(WR_ROLLOUT_PREF_OVERRIDE)) {
     return Preferences::GetBool(WR_ROLLOUT_PREF_OVERRIDE);
   }
   return Preferences::GetBool(WR_ROLLOUT_PREF, WR_ROLLOUT_PREF_DEFAULTVALUE);
 }
 
+#ifndef MOZ_WIDGET_ANDROID
 static void HardwareTooOldForWR(FeatureState& aFeature) {
   aFeature.Disable(FeatureStatus::BlockedDeviceTooOld, "Device too old",
                    NS_LITERAL_CSTRING("FEATURE_FAILURE_DEVICE_TOO_OLD"));
 }
 
 static void UpdateWRQualificationForNvidia(FeatureState& aFeature,
                                            int32_t aDeviceId,
                                            bool* aOutGuardedByQualifiedPref) {
@@ -2835,16 +2836,17 @@ static void UpdateWRQualificationForInte
   // release users have this yet, and it's still guarded by the qualified pref.
 #else
   // Disqualify everywhere else
   aFeature.Disable(FeatureStatus::BlockedReleaseChannelIntel,
                    "Release channel and Intel",
                    NS_LITERAL_CSTRING("FEATURE_FAILURE_RELEASE_CHANNEL_INTEL"));
 #endif
 }
+#endif // !MOZ_WIDGET_ANDROID
 
 static FeatureState& WebRenderHardwareQualificationStatus(
     const IntSize& aScreenSize, bool aHasBattery,
     bool* aOutGuardedByQualifiedPref) {
   FeatureState& featureWebRenderQualified =
       gfxConfig::GetFeature(Feature::WEBRENDER_QUALIFIED);
   featureWebRenderQualified.EnableByDefault();
   MOZ_ASSERT(aOutGuardedByQualifiedPref && *aOutGuardedByQualifiedPref);
@@ -2870,16 +2872,17 @@ static FeatureState& WebRenderHardwareQu
   }
 
   if (status != nsIGfxInfo::FEATURE_STATUS_OK) {
     featureWebRenderQualified.Disable(FeatureStatus::Blacklisted,
                                       "No qualified hardware", failureId);
     return featureWebRenderQualified;
   }
 
+#ifndef MOZ_WIDGET_ANDROID
   nsAutoString adapterVendorID;
   gfxInfo->GetAdapterVendorID(adapterVendorID);
 
   nsAutoString adapterDeviceID;
   gfxInfo->GetAdapterDeviceID(adapterDeviceID);
   nsresult valid;
   int32_t deviceID = adapterDeviceID.ToInteger(&valid, 16);
   if (valid != NS_OK) {
@@ -2936,16 +2939,24 @@ static FeatureState& WebRenderHardwareQu
           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 // !MOZ_WIDGET_ANDROID
+#ifndef NIGHTLY_BUILD
+  featureWebRenderQualified.Disable(
+    FeatureStatus::BlockedReleaseChannelAndroid,
+    "Release channel and Android",
+    NS_LITERAL_CSTRING("FEATURE_FAILURE_RELEASE_CHANNEL_ANDROID"));
+#endif
+#endif
   return featureWebRenderQualified;
 }
 
 void gfxPlatform::InitWebRenderConfig() {
   bool prefEnabled = WebRenderPrefEnabled();
   bool envvarEnabled = WebRenderEnvvarEnabled();
 
   // WR? WR+   => means WR was enabled via gfx.webrender.all.qualified on
--- a/widget/android/GfxInfo.cpp
+++ b/widget/android/GfxInfo.cpp
@@ -522,16 +522,29 @@ nsresult GfxInfo::GetFeatureStatusImpl(
       if (isBlocked) {
         *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
         aFailureId = "FEATURE_FAILURE_VPx";
       } else {
         *aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
       }
       return NS_OK;
     }
+
+    if (aFeature == FEATURE_WEBRENDER) {
+      NS_LossyConvertUTF16toASCII model(mModel);
+      bool isBlocked = !model.Equals("Pixel 2", nsCaseInsensitiveCStringComparator());
+
+      if (isBlocked) {
+        *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
+        aFailureId = "FEATURE_FAILURE_WEBRENDER_BLOCKED_DEVICE";
+      } else {
+        *aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
+      }
+      return NS_OK;
+    }
   }
 
   return GfxInfoBase::GetFeatureStatusImpl(
       aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, aFailureId, &os);
 }
 
 static nsCString FeatureCacheOsVerPrefName(int32_t aFeature) {
   nsCString osPrefName;