[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser/tor-browser-84.0-10.0-1] Bug 1676474 - Disable webrender partial present on Mali-Gxx. r=aosmond, a=RyanVM



commit 0d1c263a3403f7d74899ed89b37bd3787171a9e3
Author: Jamie Nicol <jnicol@xxxxxxxxxxx>
Date:   Wed Dec 9 13:07:33 2020 +0000

    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
---
 gfx/config/gfxConfigManager.cpp       | 10 ++++++++++
 gfx/tests/gtest/TestConfigManager.cpp | 23 +++++++++++++++++++----
 2 files changed, 29 insertions(+), 4 deletions(-)

diff --git a/gfx/config/gfxConfigManager.cpp b/gfx/config/gfxConfigManager.cpp
index 1f75d301ea66..994658d90228 100644
--- a/gfx/config/gfxConfigManager.cpp
+++ b/gfx/config/gfxConfigManager.cpp
@@ -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);
+      }
     }
   }
 }
diff --git a/gfx/tests/gtest/TestConfigManager.cpp b/gfx/tests/gtest/TestConfigManager.cpp
index bf43001ac419..707e3b277e90 100644
--- a/gfx/tests/gtest/TestConfigManager.cpp
+++ b/gfx/tests/gtest/TestConfigManager.cpp
@@ -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();



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits