CLOSED TREE - Bug 624390 - With GLX, blacklist everything but NVIDIA proprietary driver - r=jmuizelaar, a=joe
authorBenoit Jacob <bjacob@mozilla.com>
Mon, 10 Jan 2011 16:14:14 -0500
changeset 60261 f9f48079910fb732a06f2e24a7d2968b502b17a0
parent 60260 0474f6b72e6ee48f019e5901b8728052747d0a08
child 60262 1c7797564bd299ffeb5255b352f7fe2f5f4b1c90
push id17899
push userbjacob@mozilla.com
push dateMon, 10 Jan 2011 21:21:41 +0000
treeherdermozilla-central@f9f48079910f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmuizelaar, joe
bugs624390
milestone2.0b9pre
first release with
nightly linux32
f9f48079910f / 4.0b9pre / 20110110160729 / files
nightly linux64
f9f48079910f / 4.0b9pre / 20110110160729 / files
nightly mac
f9f48079910f / 4.0b9pre / 20110110160729 / files
nightly win32
f9f48079910f / 4.0b9pre / 20110110160729 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
CLOSED TREE - Bug 624390 - With GLX, blacklist everything but NVIDIA proprietary driver - r=jmuizelaar, a=joe
gfx/thebes/GLContextProviderGLX.cpp
--- a/gfx/thebes/GLContextProviderGLX.cpp
+++ b/gfx/thebes/GLContextProviderGLX.cpp
@@ -44,16 +44,17 @@
 #define GET_NATIVE_WINDOW(aWidget) static_cast<QWidget*>(aWidget->GetNativeData(NS_NATIVE_SHELLWIDGET))->handle()
 #endif
 
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 
 #include "mozilla/X11Util.h"
 
+#include "prenv.h"
 #include "GLContextProvider.h"
 #include "nsDebug.h"
 #include "nsIWidget.h"
 #include "GLXLibrary.h"
 #include "gfxXlibSurface.h"
 #include "gfxContext.h"
 #include "gfxImageSurface.h"
 #include "gfxPlatform.h"
@@ -228,16 +229,25 @@ public:
                     Display *display,
                     GLXDrawable drawable,
                     GLXFBConfig cfg,
                     XVisualInfo *vinfo,
                     GLContextGLX *shareContext,
                     PRBool deleteDrawable,
                     gfxXlibSurface *pixmap = nsnull)
     {
+        const char *glxVendorString = sGLXLibrary.xQueryServerString(display, DefaultScreen(display), GLX_VENDOR);
+        if (strcmp(glxVendorString, "NVIDIA Corporation") &&
+            !PR_GetEnv("MOZ_GLX_IGNORE_BLACKLIST"))
+        {
+          printf("[GLX] currently only allowing the NVIDIA proprietary driver, as other drivers are giving too many crashes. "
+                 "To bypass this, define the MOZ_GLX_IGNORE_BLACKLIST environment variable.\n");
+          return nsnull;
+        }
+
         int db = 0, err;
         err = sGLXLibrary.xGetFBConfigAttrib(display, cfg,
                                              GLX_DOUBLEBUFFER, &db);
         if (GLX_BAD_ATTRIBUTE != err) {
 #ifdef DEBUG
             printf("[GLX] FBConfig is %sdouble-buffered\n", db ? "" : "not ");
 #endif
         }