Bug 1677825 - Disable hardware acceleration if WebRender fails to initialize on Linux. r=jrmuizel
authorAndrew Osmond <aosmond@mozilla.com>
Wed, 18 Nov 2020 02:44:03 +0000
changeset 557798 72e7d30ced00970f4d717f12ce3a01f5d202d1be
parent 557797 785624cc9edfc68ebc6428f8a3cac45fdeb74383
child 557799 2a64437827b9ee4c8d492ba7671cd6489cffc25c
push id37962
push userapavel@mozilla.com
push dateWed, 18 Nov 2020 21:51:58 +0000
treeherdermozilla-central@9d797387f57c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjrmuizel
bugs1677825
milestone85.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 1677825 - Disable hardware acceleration if WebRender fails to initialize on Linux. r=jrmuizel If we don't disable hardware acceleration when we lose WebRender, we will likely fallback to OpenGL compositing. This is not a supported configuration. We already do this step if we decide against using WebRender during configuration, but not if it was lost at runtime. Differential Revision: https://phabricator.services.mozilla.com/D97355
gfx/ipc/GPUProcessManager.cpp
--- a/gfx/ipc/GPUProcessManager.cpp
+++ b/gfx/ipc/GPUProcessManager.cpp
@@ -479,16 +479,24 @@ void GPUProcessManager::DisableWebRender
 
 #if defined(MOZ_WIDGET_ANDROID)
   // If aError is not wr::WebRenderError::INITIALIZE, nsWindow does not
   // re-create LayerManager. Needs to trigger re-creating LayerManager on
   // android
   if (aError != wr::WebRenderError::INITIALIZE) {
     NotifyDisablingWebRender();
   }
+#elif defined(MOZ_WIDGET_GTK)
+  // Hardware compositing should be disabled by default if we aren't using
+  // WebRender. We had to check if it is enabled at all, because it may
+  // already have been forced disabled (e.g. safe mode, headless). It may
+  // still be forced on by the user, and if so, this should have no effect.
+  gfxConfig::SetFailed(Feature::HW_COMPOSITING, FeatureStatus::Blocked,
+                       "Acceleration blocked by platform",
+                       "FEATURE_FAILURE_LOST_WEBRENDER"_ns);
 #endif
 
   if (mProcess) {
     OnRemoteProcessDeviceReset(mProcess);
   } else {
     OnInProcessDeviceReset();
   }
 }