Bug 1160157 - Add gfxCriticalError for failing to create D3D11 device in content side. r=milan
authorKevin Chen <kechen@mozilla.com>
Thu, 19 Jan 2017 22:19:00 +0800
changeset 330291 19507933747f4c345866d53e57dc8ff63f353e11
parent 330290 8c38fdf34cef2b7a822770965f67c887e8398146
child 330292 ee9b37dd70f59232bcb415ebedb724687801b61e
push id31236
push usercbook@mozilla.com
push dateFri, 20 Jan 2017 14:26:03 +0000
treeherdermozilla-central@3cedab21a7e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmilan
bugs1160157
milestone53.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 1160157 - Add gfxCriticalError for failing to create D3D11 device in content side. r=milan
gfx/layers/ipc/CompositorBridgeChild.cpp
gfx/thebes/gfxWindowsPlatform.cpp
--- a/gfx/layers/ipc/CompositorBridgeChild.cpp
+++ b/gfx/layers/ipc/CompositorBridgeChild.cpp
@@ -364,16 +364,23 @@ CompositorBridgeChild::RecvCompositorUpd
     MOZ_ASSERT(aLayersId == 0);
   } else if (aLayersId != 0) {
     // Update gfxPlatform if this is the first time we're seeing this compositor
     // update (we will get an update for each connected tab).
     static uint64_t sLastSeqNo = 0;
     if (sLastSeqNo != aSeqNo) {
       gfxPlatform::GetPlatform()->CompositorUpdated();
       sLastSeqNo = aSeqNo;
+
+      // If we still get device reset here, something must wrong when creating
+      // d3d11 devices.
+      if (gfxPlatform::GetPlatform()->DidRenderingDeviceReset()) {
+        gfxCriticalError() << "Unexpected reset device processing when \
+                               updating compositor.";
+      }
     }
 
     if (dom::TabChild* child = dom::TabChild::GetFrom(aLayersId)) {
       child->CompositorUpdated(aNewIdentifier);
     }
     if (!mCanSend) {
       return IPC_OK();
     }
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -1511,16 +1511,24 @@ gfxWindowsPlatform::InitializeD3D11()
   DeviceManagerDx* dm = DeviceManagerDx::Get();
   if (XRE_IsParentProcess()) {
     if (!dm->CreateCompositorDevices()) {
       return;
     }
   }
 
   dm->CreateContentDevices();
+
+  // Content process failed to create the d3d11 device while parent process
+  // succeed.
+  if (XRE_IsContentProcess() &&
+      !gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {
+    gfxCriticalError() << "[D3D11] Failed to create the D3D11 device in content \
+                           process.";
+  }
 }
 
 void
 gfxWindowsPlatform::InitializeD2DConfig()
 {
   FeatureState& d2d1 = gfxConfig::GetFeature(Feature::DIRECT2D);
 
   if (!gfxConfig::IsEnabled(Feature::D3D11_COMPOSITING)) {