Commit 0d1c263a authored by Jamie Nicol's avatar Jamie Nicol
Browse files

Bug 1676474 - Disable webrender partial present on Mali-Gxx. r=aosmond, a=RyanVM

Due to rendering issues reported on a Mali-G77, disable partial
present on all Mali-Gxx devices.

Differential Revision: https://phabricator.services.mozilla.com/D99216
parent 63e3dc6e
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -386,6 +386,16 @@ void gfxConfigManager::ConfigureWebRender() {
  if (mWrPartialPresent) {
    if (mFeatureWr->IsEnabled()) {
      mFeatureWrPartial->EnableByDefault();

      nsString adapter;
      mGfxInfo->GetAdapterDeviceID(adapter);
      // Block partial present on Mali-Gxx GPUs due to rendering issues.
      // See bug 1676474.
      if (adapter.Find("Mali-G", /*ignoreCase*/ true) >= 0) {
        mFeatureWrPartial->Disable(FeatureStatus::Blocked,
                                   "Partial present blocked on Mali-Gxx",
                                   "FEATURE_FAILURE_PARTIAL_PRESENT_MALI"_ns);
      }
    }
  }
}
+19 −4
Original line number Diff line number Diff line
@@ -26,6 +26,7 @@ class MockGfxInfo final : public nsIGfxInfo {
  bool mHasMixedRefreshRate;
  Maybe<bool> mHasBattery;
  const char* mVendorId;
  const char* mDeviceId;

  // Default allows WebRender + compositor, and is desktop NVIDIA.
  MockGfxInfo()
@@ -35,7 +36,8 @@ class MockGfxInfo final : public nsIGfxInfo {
        mMaxRefreshRate(-1),
        mHasMixedRefreshRate(false),
        mHasBattery(Some(false)),
        mVendorId("0x10de") {}
        mVendorId("0x10de"),
        mDeviceId("") {}

  NS_IMETHOD GetFeatureStatus(int32_t aFeature, nsACString& aFailureId,
                              int32_t* _retval) override {
@@ -71,6 +73,14 @@ class MockGfxInfo final : public nsIGfxInfo {
    return NS_OK;
  }

  NS_IMETHOD GetAdapterDeviceID(nsAString& aAdapterDeviceID) override {
    if (!mDeviceId) {
      return NS_ERROR_NOT_IMPLEMENTED;
    }
    aAdapterDeviceID.AssignASCII(mDeviceId);
    return NS_OK;
  }

  NS_IMETHOD_(int32_t) GetMaxRefreshRate(bool* aMixed) override {
    if (aMixed) {
      *aMixed = mHasMixedRefreshRate;
@@ -164,9 +174,6 @@ class MockGfxInfo final : public nsIGfxInfo {
  NS_IMETHOD GetAdapterDriver(nsAString& aAdapterDriver) override {
    return NS_ERROR_NOT_IMPLEMENTED;
  }
  NS_IMETHOD GetAdapterDeviceID(nsAString& aAdapterDeviceID) override {
    return NS_ERROR_NOT_IMPLEMENTED;
  }
  NS_IMETHOD GetAdapterSubsysID(nsAString& aAdapterSubsysID) override {
    return NS_ERROR_NOT_IMPLEMENTED;
  }
@@ -333,6 +340,14 @@ TEST_F(GfxConfigManager, WebRenderNoPartialPresent) {
  EXPECT_FALSE(mFeatures.mWrSoftware.IsEnabled());
}

TEST_F(GfxConfigManager, WebRenderPartialPresentMali) {
  mWrPartialPresent = true;
  mMockGfxInfo->mDeviceId = "Mali-G77";
  ConfigureWebRender();

  EXPECT_FALSE(mFeatures.mWrPartial.IsEnabled());
}

TEST_F(GfxConfigManager, WebRenderScaledResolutionWithHwStretching) {
  mScaledResolution = true;
  ConfigureWebRender();