Bug 1286653 - Re-run blacklist after device creation draft
authoreyim <eyim@mozilla.com>
Wed, 20 Jul 2016 15:59:22 -0400
changeset 390195 7d9beb54402d78d41ddc3ae8b0b60bd7bc34d497
parent 390029 d224fc999cb6accb208af0a105f14433375e2e77
child 525949 5c2c16e744aa96650ab75ae7cb5c82368f504fb5
push id23617
push userbmo:eyim@mozilla.com
push dateWed, 20 Jul 2016 20:00:16 +0000
bugs1286653
milestone50.0a1
Bug 1286653 - Re-run blacklist after device creation MozReview-Commit-ID: 2r3zYoagGZl
gfx/thebes/gfxWindowsPlatform.cpp
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -2437,16 +2437,29 @@ gfxWindowsPlatform::InitializeD3D11()
     d3d11.SetFailed(FeatureStatus::Failed, "Direct3D11 device failure simulated by preference",
                     NS_LITERAL_CSTRING("FEATURE_FAILURE_D3D11_SIM"));
     return;
   }
 
   if (XRE_IsParentProcess()) {
     if (!gfxConfig::UseFallback(Fallback::USE_D3D11_WARP_COMPOSITOR)) {
       AttemptD3D11DeviceCreation(d3d11);
+
+      // check device to see if blacklisted after device creation successful
+      if (mD3D11Device)
+      {
+        nsCString message;
+        nsCString failureId;
+        if (!gfxPlatform::IsGfxInfoStatusOkay(nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS, &message, failureId)) {
+            d3d11.Disable(FeatureStatus::Blacklisted, message.get(),
+                          failureId);
+          }
+        }  
+      }
+
       if (d3d11.GetValue() == FeatureStatus::CrashedInHandler) {
         return;
       }
 
       // If we failed to get a device, but WARP is allowed and might work,
       // re-enable D3D11 and switch to WARP.
       if (!mD3D11Device && IsWARPStable() && !gfxPrefs::LayersD3D11DisableWARP()) {
         gfxConfig::Reenable(Feature::D3D11_COMPOSITING, Fallback::USE_D3D11_WARP_COMPOSITOR);
@@ -2597,16 +2610,24 @@ gfxWindowsPlatform::InitializeD2D()
   }
 
   // Verify that Direct2D device creation succeeded.
   if (!Factory::SetDirect3D11Device(mD3D11ContentDevice)) {
     d2d1.SetFailed(FeatureStatus::Failed, "Failed to create a Direct2D device",
                    NS_LITERAL_CSTRING("FEATURE_FAILURE_D2D_CREATE_FAILED"));
     return;
   }
+  else
+  {
+    nsCString message;
+    nsCString failureId;
+    if (!gfxPlatform::IsGfxInfoStatusOkay(nsIGfxInfo::FEATURE_DIRECT2D, &message, failureId)) {
+      d2d1.Disable(FeatureStatus::Blacklisted, message.get(), failureId);
+    }
+  }
 
   MOZ_ASSERT(d2d1.IsEnabled());
   d2d1_1.SetSuccessful();
 }
 
 bool
 gfxWindowsPlatform::CreateD3D11DecoderDeviceHelper(
   IDXGIAdapter1* aAdapter, RefPtr<ID3D11Device>& aDevice, HRESULT& aResOut)