Bug 1364563 - Update render mode and fallback to software solution when GPU process is killed; r?dvander draft
authorKevin Chen <kechen@mozilla.com>
Thu, 29 Jun 2017 00:27:03 +0800
changeset 602206 ecfa5891c36860d7759fa5e851e6ef1a84940458
parent 602051 f3483af8ecf997453064201c49c48a682c7f3c29
child 635514 518df72f9cb60026785ad8eb29d3c84c01a6a06f
push id66338
push userbmo:kechen@mozilla.com
push dateThu, 29 Jun 2017 20:47:14 +0000
reviewersdvander
bugs1364563
milestone56.0a1
Bug 1364563 - Update render mode and fallback to software solution when GPU process is killed; r?dvander MozReview-Commit-ID: 5Sewt2wtku8
dom/ipc/ContentChild.cpp
gfx/ipc/GPUProcessManager.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -1310,16 +1310,17 @@ ContentChild::RecvReinitRendering(Endpoi
     return IPC_FAIL_NO_REASON(this);
   }
   if (!ImageBridgeChild::ReinitForContent(Move(aImageBridge), namespaces[2])) {
     return IPC_FAIL_NO_REASON(this);
   }
   if (!gfx::VRManagerChild::ReinitForContent(Move(aVRBridge))) {
     return IPC_FAIL_NO_REASON(this);
   }
+  gfxPlatform::GetPlatform()->CompositorUpdated();
 
   // Establish new PLayerTransactions.
   for (const auto& tabChild : tabs) {
     if (tabChild->LayersId()) {
       tabChild->ReinitRendering();
     }
   }
 
--- a/gfx/ipc/GPUProcessManager.cpp
+++ b/gfx/ipc/GPUProcessManager.cpp
@@ -423,16 +423,27 @@ GPUProcessManager::OnRemoteProcessDevice
   auto newTime = TimeStamp::Now();
   auto delta = (int32_t)(newTime - mDeviceResetLastTime).ToMilliseconds();
   mDeviceResetLastTime = newTime;
 
   if (ShouldLimitDeviceResets(mDeviceResetCount, delta)) {
     DestroyProcess();
     DisableGPUProcess("GPU processed experienced too many device resets");
 
+    // Reaches the limited TDR attempts, fallback to software solution.
+    gfxConfig::SetFailed(Feature::HW_COMPOSITING,
+      FeatureStatus::Blocked,
+      "Too many attemps of D3D11 creation, fallback to software solution.");
+    gfxConfig::SetFailed(Feature::D3D11_COMPOSITING,
+      FeatureStatus::Blocked,
+      "Too many attemps of D3D11 creation, fallback to software solution.");
+    gfxConfig::SetFailed(Feature::DIRECT2D,
+      FeatureStatus::Blocked,
+      "Too many attemps of D3D11 creation, fallback to software solution.");
+
     HandleProcessLost();
     return;
   }
 
   RebuildRemoteSessions();
   NotifyListenersOnCompositeDeviceReset();
 }