dri2: add complaints for more initialization failures.
authorEric Anholt <eric@anholt.net>
Tue, 27 Jan 2009 22:34:29 +0000 (14:34 -0800)
committerEric Anholt <eric@anholt.net>
Tue, 27 Jan 2009 22:34:29 +0000 (14:34 -0800)
Somehow we're running into DRI2Authenticate failing, and silent demotion to
swrast is bad.

src/glx/x11/dri2_glx.c

index 2bee67780bde8defb78725b362af5f7e03be45c6..d16f80912656aa4cc59a53678998da059574d90c 100644 (file)
@@ -282,8 +282,10 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen,
        return NULL;
 
     psc->driver = driOpenDriver(driverName);
-    if (psc->driver == NULL)
+    if (psc->driver == NULL) {
+       ErrorMessageF("driver pointer missing\n");
        goto handle_error;
+    }
 
     extensions = dlsym(psc->driver, __DRI_DRIVER_EXTENSIONS);
     if (extensions == NULL) {
@@ -309,11 +311,15 @@ static __GLXDRIscreen *dri2CreateScreen(__GLXscreenConfigs *psc, int screen,
        return NULL;
     }
 
-    if (drmGetMagic(psc->fd, &magic))
+    if (drmGetMagic(psc->fd, &magic)) {
+       ErrorMessageF("failed to get magic\n");
        return NULL;
+    }
 
-    if (!DRI2Authenticate(psc->dpy, RootWindow(psc->dpy, screen), magic))
+    if (!DRI2Authenticate(psc->dpy, RootWindow(psc->dpy, screen), magic)) {
+       ErrorMessageF("failed to authenticate magic %d\n", magic);
        return NULL;
+    }
 
     psc->__driScreen = 
        psc->dri2->createNewScreen(screen, psc->fd,