Bug 1153381 - Add a D3D11 ANGLE blacklist. r=mstange, ba=sledru
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Fri, 10 Apr 2015 16:17:27 -0400
changeset 258453 05508ccf3ae8
parent 258452 4359c16b7f44
child 258454 ea8d9c8087ac
child 258456 4b9fb6cbf6d4
child 258458 7ca7e178de40
push id4670
push userryanvm@gmail.com
push date2015-04-13 19:15 +0000
treeherdermozilla-beta@05508ccf3ae8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmstange
bugs1153381
milestone38.0
Bug 1153381 - Add a D3D11 ANGLE blacklist. r=mstange, ba=sledru This blocks the Intel 4500 style GPUs so that Google Maps works properly.
gfx/gl/GLLibraryEGL.cpp
gfx/thebes/gfxPlatform.cpp
gfx/thebes/gfxPlatform.h
widget/GfxInfoBase.cpp
widget/nsIGfxInfo.idl
widget/windows/GfxInfo.cpp
--- a/gfx/gl/GLLibraryEGL.cpp
+++ b/gfx/gl/GLLibraryEGL.cpp
@@ -263,17 +263,17 @@ GLLibraryEGL::EnsureInitialized()
         // manager, and it's pointless to try to fix it.  We also don't try
         // D3D11 ANGLE if the layer manager is prefering D3D9 (hrm, do we care?)
         if (gfxPrefs::LayersOffMainThreadCompositionEnabled() &&
             !gfxPrefs::LayersPreferD3D9())
         {
             if (gfxPrefs::WebGLANGLEForceD3D11()) {
                 newDisplay = GetAndInitDisplay(*this,
                                                LOCAL_EGL_D3D11_ONLY_DISPLAY_ANGLE);
-            } else if (gfxPrefs::WebGLANGLETryD3D11()) {
+            } else if (gfxPrefs::WebGLANGLETryD3D11() && gfxPlatform::CanUseDirect3D11ANGLE()) {
                 newDisplay = GetAndInitDisplay(*this,
                                                LOCAL_EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE);
             }
         }
 
         if (newDisplay != EGL_NO_DISPLAY) {
             DebugOnly<EGLBoolean> success = fTerminate(mEGLDisplay);
             MOZ_ASSERT(success == LOCAL_EGL_TRUE);
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -2156,16 +2156,17 @@ gfxPlatform::OptimalFormatForContent(gfx
  * that should be consistent for the lifetime of the application (bug 840967).
  * As such, we will evaluate them all as soon as one of them is evaluated
  * and remember the values.  Changing these preferences during the run will
  * not have any effect until we restart.
  */
 static bool sLayersSupportsD3D9 = false;
 static bool sLayersSupportsD3D11 = false;
 static bool sLayersSupportsDXVA = false;
+static bool sANGLESupportsD3D11 = false;
 static bool sBufferRotationCheckPref = true;
 static bool sPrefBrowserTabsRemoteAutostart = false;
 
 static bool sLayersAccelerationPrefsInitialized = false;
 
 void
 InitLayersAccelerationPrefs()
 {
@@ -2202,16 +2203,21 @@ InitLayersAccelerationPrefs()
           // Always support D3D11 when WARP is allowed.
           sLayersSupportsD3D11 = true;
         }
         if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DXVA, &status))) {
           if (status == nsIGfxInfo::FEATURE_STATUS_OK) {
             sLayersSupportsDXVA = true;
           }
         }
+        if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT3D_11_ANGLE, &status))) {
+          if (status == nsIGfxInfo::FEATURE_STATUS_OK) {
+            sANGLESupportsD3D11 = true;
+          }
+        }
       }
     }
 #endif
 
     sLayersAccelerationPrefsInitialized = true;
   }
 }
 
@@ -2238,16 +2244,24 @@ gfxPlatform::CanUseDXVA()
 {
   // this function is called from the compositor thread, so it is not
   // safe to init the prefs etc. from here.
   MOZ_ASSERT(sLayersAccelerationPrefsInitialized);
   return sLayersSupportsDXVA;
 }
 
 bool
+gfxPlatform::CanUseDirect3D11ANGLE()
+{
+  MOZ_ASSERT(sLayersAccelerationPrefsInitialized);
+  return sANGLESupportsD3D11;
+}
+
+
+bool
 gfxPlatform::BufferRotationEnabled()
 {
   MutexAutoLock autoLock(*gGfxPlatformPrefsLock);
 
   return sBufferRotationCheckPref && gfxPrefs::BufferRotationEnabled();
 }
 
 void
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -490,16 +490,17 @@ public:
         // platform-specific override, by default do nothing
     }
 
     static bool OffMainThreadCompositingEnabled();
 
     static bool CanUseDirect3D9();
     static bool CanUseDirect3D11();
     static bool CanUseDXVA();
+    static bool CanUseDirect3D11ANGLE();
 
     /**
      * Is it possible to use buffer rotation.  Note that these
      * check the preference, but also allow for the override to
      * disable it using DisableBufferRotation.
      */
     static bool BufferRotationEnabled();
     static void DisableBufferRotation();
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -121,16 +121,19 @@ GetPrefNameForFeature(int32_t aFeature)
       name = BLACKLIST_PREF_BRANCH "layers.direct3d10-1";
       break;
     case nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS:
       name = BLACKLIST_PREF_BRANCH "layers.direct3d11";
       break;
     case nsIGfxInfo::FEATURE_DXVA:
       name = BLACKLIST_PREF_BRANCH "dxva";
       break;
+    case nsIGfxInfo::FEATURE_DIRECT3D_11_ANGLE:
+      name = BLACKLIST_PREF_BRANCH "direct3d11angle";
+      break;
     case nsIGfxInfo::FEATURE_OPENGL_LAYERS:
       name = BLACKLIST_PREF_BRANCH "layers.opengl";
       break;
     case nsIGfxInfo::FEATURE_WEBGL_OPENGL:
       name = BLACKLIST_PREF_BRANCH "webgl.opengl";
       break;
     case nsIGfxInfo::FEATURE_WEBGL_ANGLE:
       name = BLACKLIST_PREF_BRANCH "webgl.angle";
@@ -285,16 +288,18 @@ BlacklistFeatureToGfxFeature(const nsASt
   else if (aFeature.EqualsLiteral("DIRECT3D_9_LAYERS"))
     return nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS;
   else if (aFeature.EqualsLiteral("DIRECT3D_10_LAYERS"))
     return nsIGfxInfo::FEATURE_DIRECT3D_10_LAYERS;
   else if (aFeature.EqualsLiteral("DIRECT3D_10_1_LAYERS"))
     return nsIGfxInfo::FEATURE_DIRECT3D_10_1_LAYERS;
   else if (aFeature.EqualsLiteral("DIRECT3D_11_LAYERS"))
     return nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS;
+  else if (aFeature.EqualsLiteral("DIRECT3D_11_ANGLE"))
+    return nsIGfxInfo::FEATURE_DIRECT3D_11_ANGLE;
   else if (aFeature.EqualsLiteral("DXVA"))
     return nsIGfxInfo::FEATURE_DXVA;
   else if (aFeature.EqualsLiteral("OPENGL_LAYERS"))
     return nsIGfxInfo::FEATURE_OPENGL_LAYERS;
   else if (aFeature.EqualsLiteral("WEBGL_OPENGL"))
     return nsIGfxInfo::FEATURE_WEBGL_OPENGL;
   else if (aFeature.EqualsLiteral("WEBGL_ANGLE"))
     return nsIGfxInfo::FEATURE_WEBGL_ANGLE;
@@ -853,16 +858,17 @@ void
 GfxInfoBase::EvaluateDownloadedBlacklist(nsTArray<GfxDriverInfo>& aDriverInfo)
 {
   int32_t features[] = {
     nsIGfxInfo::FEATURE_DIRECT2D,
     nsIGfxInfo::FEATURE_DIRECT3D_9_LAYERS,
     nsIGfxInfo::FEATURE_DIRECT3D_10_LAYERS,
     nsIGfxInfo::FEATURE_DIRECT3D_10_1_LAYERS,
     nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS,
+    nsIGfxInfo::FEATURE_DIRECT3D_11_ANGLE,
     nsIGfxInfo::FEATURE_DXVA,
     nsIGfxInfo::FEATURE_OPENGL_LAYERS,
     nsIGfxInfo::FEATURE_WEBGL_OPENGL,
     nsIGfxInfo::FEATURE_WEBGL_ANGLE,
     nsIGfxInfo::FEATURE_WEBGL_MSAA,
     nsIGfxInfo::FEATURE_STAGEFRIGHT,
     0
   };
--- a/widget/nsIGfxInfo.idl
+++ b/widget/nsIGfxInfo.idl
@@ -3,17 +3,17 @@
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 /* NOTE: this interface is completely undesigned, not stable and likely to change */
 
-[scriptable, uuid(f5b38c7d-142e-4a94-8097-b2e083f8c19b)]
+[scriptable, uuid(d9333198-838d-4976-881f-4d9a77819453)]
 interface nsIGfxInfo : nsISupports
 {
   /*
    * These are win32-specific
    */
   readonly attribute boolean D2DEnabled;
   readonly attribute boolean DWriteEnabled;
   readonly attribute DOMString DWriteVersion;
@@ -84,16 +84,18 @@ interface nsIGfxInfo : nsISupports
   /* Whether Stagefright is supported */
   const long FEATURE_STAGEFRIGHT = 9;
   /* Whether Webrtc Hardware acceleration is supported */
   const long FEATURE_WEBRTC_HW_ACCELERATION = 10;
   /* Whether Direct3D 11 is supported for layers. */
   const long FEATURE_DIRECT3D_11_LAYERS = 11;
   /* Whether DXVA is supported for video decoding. */
   const long FEATURE_DXVA = 12;
+  /* Whether Direct3D 11 is supported for ANGLE. */
+  const long FEATURE_DIRECT3D_11_ANGLE = 13;
 
   /*
    * A set of return values from GetFeatureStatus
    */
 
   /* The driver is save to the best of our knowledge */
   const long FEATURE_STATUS_OK = 1;
   /* We don't know the status of the feature yet. The analysis probably hasn't finished yet. */
--- a/widget/windows/GfxInfo.cpp
+++ b/widget/windows/GfxInfo.cpp
@@ -1105,16 +1105,22 @@ GfxInfo::GetGfxDriverInfo()
 
     /* Bug 1137716: XXX this should really check for the matching Intel piece as well.
      * Unfortunately, we don't have the infrastructure to do that */
     APPEND_TO_DRIVER_BLOCKLIST_RANGE_GPU2(DRIVER_OS_WINDOWS_7,
         (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorNVIDIA), (GfxDeviceFamily*)GfxDriverInfo::GetDeviceFamily(Bug1137716),
       GfxDriverInfo::allFeatures, nsIGfxInfo::FEATURE_BLOCKED_DRIVER_VERSION,
       DRIVER_BETWEEN_INCLUSIVE, V(8,17,12,5730), V(8,17,12,6901), "Nvidia driver > 8.17.12.6901");
 
+    /* Bug 1153381: WebGL issues with D3D11 ANGLE on Intel. These may be fixed by an ANGLE update. */
+    APPEND_TO_DRIVER_BLOCKLIST2(DRIVER_OS_ALL,
+      (nsAString&)GfxDriverInfo::GetDeviceVendor(VendorIntel), (GfxDeviceFamily*)GfxDriverInfo::GetDeviceFamily(IntelGMAX4500HD),
+      nsIGfxInfo::FEATURE_DIRECT3D_11_ANGLE, nsIGfxInfo::FEATURE_BLOCKED_DEVICE,
+      DRIVER_LESS_THAN, GfxDriverInfo::allDriverVersions);
+
   }
   return *mDriverInfo;
 }
 
 nsresult
 GfxInfo::GetFeatureStatusImpl(int32_t aFeature,
                               int32_t *aStatus, 
                               nsAString & aSuggestedDriverVersion,