Bug 677531 - GLXtest process stays around as zombie until the data is used by GfxInfo - r=matt.woodrow
authorBenoit Jacob <bjacob@mozilla.com>
Fri, 19 Aug 2011 11:39:00 -0400
changeset 76848 7c3883a2fc31f31ed2ad6524c97012cdba74b6ba
parent 76847 39fd1683ee6f05e901c1515c9851b0027135f750
child 76849 1d19ff806783f23b4847aee771568d5b807e2db2
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmatt
bugs677531
milestone9.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 677531 - GLXtest process stays around as zombie until the data is used by GfxInfo - r=matt.woodrow This gave zombies staying around when using layers.acceleration.force-enabled or .disabled or safe-mode, for instance.
widget/src/xpwidgets/nsBaseWidget.cpp
--- a/widget/src/xpwidgets/nsBaseWidget.cpp
+++ b/widget/src/xpwidgets/nsBaseWidget.cpp
@@ -823,31 +823,39 @@ nsBaseWidget::GetShouldAccelerate()
   accelerateByDefault = accelerateByDefault || 
                         (acceleratedEnv && (*acceleratedEnv != '0'));
 
   nsCOMPtr<nsIXULRuntime> xr = do_GetService("@mozilla.org/xre/runtime;1");
   PRBool safeMode = PR_FALSE;
   if (xr)
     xr->GetInSafeMode(&safeMode);
 
+  bool whitelisted = false;
+
+  // bug 655578: on X11 at least, we must always call GetFeatureStatus (even if we don't need that information)
+  // as that's what causes GfxInfo initialization which kills the zombie 'glxtest' process.
+  nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
+  if (gfxInfo) {
+    PRInt32 status;
+    if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_OPENGL_LAYERS, &status))) {
+      if (status == nsIGfxInfo::FEATURE_NO_INFO) {
+        whitelisted = true;
+      }
+    }
+  }
+
   if (disableAcceleration || safeMode)
     return PR_FALSE;
 
   if (forceAcceleration)
     return PR_TRUE;
-
-  nsCOMPtr<nsIGfxInfo> gfxInfo = do_GetService("@mozilla.org/gfx/info;1");
-  if (gfxInfo) {
-    PRInt32 status;
-    if (NS_SUCCEEDED(gfxInfo->GetFeatureStatus(nsIGfxInfo::FEATURE_OPENGL_LAYERS, &status))) {
-      if (status != nsIGfxInfo::FEATURE_NO_INFO) {
-        NS_WARNING("OpenGL-accelerated layers are not supported on this system.");
-        return PR_FALSE;
-      }
-    }
+  
+  if (!whitelisted) {
+    NS_WARNING("OpenGL-accelerated layers are not supported on this system.");
+    return PR_FALSE;
   }
 
   if (accelerateByDefault)
     return PR_TRUE;
 
   /* use the window acceleration flag */
   return mUseAcceleratedRendering;
 }