[Mesa-dev] [PATCH 3/4] glx/dri2: handle dri authenticating before calling the loader.

Jonathan Gray jsg at jsg.id.au
Tue Mar 18 07:59:17 PDT 2014


The loader may issue dri ioctls to determine the driver name.

Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
---
 src/glx/dri2_glx.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git src/glx/dri2_glx.c src/glx/dri2_glx.c
index 5a960b0..b61422f 100644
--- src/glx/dri2_glx.c
+++ src/glx/dri2_glx.c
@@ -1200,6 +1200,16 @@ dri2CreateScreen(int screen, struct glx_display * priv)
       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.
     */
@@ -1231,16 +1241,6 @@ dri2CreateScreen(int screen, struct glx_display * priv)
       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,
-- 
1.8.5.3



More information about the mesa-dev mailing list