Bug 1165732 - Block WARP when using the built-in VGA driver. r=bas, a=sledru
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 21 May 2015 12:42:04 -0400
changeset 260450 81118eddf50d
parent 260449 bad52430a6f8
child 260451 6d1785ddd96c
push id35
push userryanvm@gmail.com
push date2015-05-21 17:25 +0000
treeherdermozilla-esr38@81118eddf50d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas, sledru
bugs1165732
milestone38.0.1esrpre
Bug 1165732 - Block WARP when using the built-in VGA driver. r=bas, a=sledru WARP is amazingly slow on the VGA driver on Windows 7. Let's not use it.
gfx/thebes/gfxWindowsPlatform.cpp
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -1826,16 +1826,27 @@ gfxWindowsPlatform::InitD3D11Devices()
     if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_DIRECT3D_11_LAYERS, &status))) {
       if (status != nsIGfxInfo::FEATURE_STATUS_OK) {
 
         // It seems like nvdxgiwrap makes a mess of WARP. See bug 1154703 for more.
         if (gfxPrefs::LayersD3D11DisableWARP() || GetModuleHandleA("nvdxgiwrap.dll")) {
           return;
         }
 
+        if (!IsWin8OrLater()) {
+            /* On Windows 7 WARP runs very badly on the builtin vga driver */
+            nsString driver;
+            gfxInfo->GetAdapterDriver(driver);
+            // driver can start with vga or svga so only look for "framebuf..."
+            if (driver.Find("framebuf vga256 vga64k") != kNotFound) {
+                gfxCriticalError(CriticalLog::DefaultOptions(false)) << "Disabling WARP on builtin vga driver";
+                return;
+            }
+        }
+
         useWARP = true;
       }
     }
   }
 
   if (gfxPrefs::LayersD3D11ForceWARP()) {
     useWARP = true;
   }