loader: add special logic to distinguish nouveau from nouveau_vieux
[mesa.git] / src / glx / dri2_glx.c
index d4255599f31e594f97bd8469f78d0f1aefad7386..79f6ecc99336a11804248c98983eaace6c6884b0 100644 (file)
@@ -1201,6 +1201,16 @@ dri2CreateScreen(int screen, struct glx_display * priv)
       goto handle_error;
    }
 
       goto handle_error;
    }
 
+   if (drmGetMagic(psc->fd, &magic)) {
+      ErrorMessageF("failed to get magic\n");
+      goto handle_error;
+   }
+
+   if (!DRI2Authenticate(priv->dpy, RootWindow(priv->dpy, screen), magic)) {
+      ErrorMessageF("failed to authenticate magic %d\n", magic);
+      goto handle_error;
+   }
+
    /* If Mesa knows about the appropriate driver for this fd, then trust it.
     * Otherwise, default to the server's value.
     */
    /* If Mesa knows about the appropriate driver for this fd, then trust it.
     * Otherwise, default to the server's value.
     */
@@ -1232,16 +1242,6 @@ dri2CreateScreen(int screen, struct glx_display * priv)
       goto handle_error;
    }
 
       goto handle_error;
    }
 
-   if (drmGetMagic(psc->fd, &magic)) {
-      ErrorMessageF("failed to get magic\n");
-      goto handle_error;
-   }
-
-   if (!DRI2Authenticate(priv->dpy, RootWindow(priv->dpy, screen), magic)) {
-      ErrorMessageF("failed to authenticate magic %d\n", magic);
-      goto handle_error;
-   }
-
    if (psc->dri2->base.version >= 4) {
       psc->driScreen =
          psc->dri2->createNewScreen2(screen, psc->fd,
    if (psc->dri2->base.version >= 4) {
       psc->driScreen =
          psc->dri2->createNewScreen2(screen, psc->fd,