[Mesa-stable] [Mesa-dev] [PATCH] egl/x11: authenticate before doing chipset id ioctls

Mark Kettenis mark.kettenis at xs4all.nl
Tue Apr 26 10:26:30 UTC 2016


> From: Matt Turner <mattst88 at gmail.com>
> Date: Mon, 25 Apr 2016 14:37:56 -0700
> 
> On Tue, Apr 19, 2016 at 10:48 AM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> > On 19 April 2016 at 03:29, Jonathan Gray <jsg at jsg.id.au> wrote:
> >> For systems without udev or sysfs that use drm ioctls in the loader
> >> drm authentication must take place earlier or the loader will fail
> >> "MESA-LOADER: failed to get param for i915".
> >>
> >> Patch from Mark Kettenis.
> >>
> >> Cc: "11.2 11.1" <mesa-stable at lists.freedesktop.org>
> >> Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
> >> Signed-off-by: Jonathan Gray <jsg at jsg.id.au>
> > Reviewed-by: Emil Velikov <emil.velikov at collabora.com>
> >
> > I'll push this by end of tomorrow, unless we hear any objections.
> 
> This patch added the following warning:
> 
> ../../../mesa/src/egl/drivers/dri2/platform_x11.c:1140:4: warning:
> initialization from incompatible pointer type
>     .authenticate = dri2_x11_authenticate,
>     ^
> ../../../mesa/src/egl/drivers/dri2/platform_x11.c:1140:4: warning:
> (near initialization for ‘dri2_x11_display_vtbl.authenticate’)
> 
> I presume because the first parameter's type changed.

Ouch.  Completely missed that that function was used in the vtbl.  How
does the fix below look?


Index: mesa/src/egl/drivers/dri2/platform_x11.c
===================================================================
RCS file: /cvs/xenocara/lib/mesa/src/egl/drivers/dri2/platform_x11.c,v
retrieving revision 1.2
diff -u -p -r1.2 platform_x11.c
--- mesa/src/egl/drivers/dri2/platform_x11.c	20 Apr 2016 12:23:56 -0000	1.2
+++ mesa/src/egl/drivers/dri2/platform_x11.c	26 Apr 2016 10:25:56 -0000
@@ -537,7 +537,7 @@ dri2_x11_flush_front_buffer(__DRIdrawabl
 }
 
 static int
-dri2_x11_authenticate(struct dri2_egl_display *dri2_dpy, uint32_t id)
+dri2_x11_do_authenticate(struct dri2_egl_display *dri2_dpy, uint32_t id)
 {
    xcb_dri2_authenticate_reply_t *authenticate;
    xcb_dri2_authenticate_cookie_t authenticate_cookie;
@@ -577,7 +577,7 @@ dri2_x11_local_authenticate(struct dri2_
       return EGL_FALSE;
    }
    
-   if (dri2_x11_authenticate(dri2_dpy, magic) < 0) {
+   if (dri2_x11_do_authenticate(dri2_dpy, magic) < 0) {
       _eglLog(_EGL_WARNING, "DRI2: failed to authenticate");
       return EGL_FALSE;
    }
@@ -704,6 +704,14 @@ dri2_x11_connect(struct dri2_egl_display
    free(connect);
 
    return EGL_TRUE;
+}
+
+static int
+dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id)
+{
+   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
+
+   return dri2_x11_do_authenticate(dri2_dpy, id);
 }
 
 static EGLBoolean


More information about the mesa-stable mailing list