From 467a62e36726bec90ef9d9dfee7e0c4267a81fcd Mon Sep 17 00:00:00 2001 From: Benjamin Franzke Date: Tue, 1 Mar 2011 17:26:32 +0100 Subject: egl_dri2: just pass dri2_dpy->authenticate t wayland_drm_init --- src/egl/drivers/dri2/egl_dri2.c | 11 ++--------- src/egl/drivers/dri2/platform_drm.c | 4 +++- src/egl/drivers/dri2/platform_wayland.c | 3 ++- src/egl/drivers/dri2/platform_x11.c | 8 +++++--- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 9c5959f5d7..029807b10c 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -1100,14 +1100,6 @@ dri2_export_drm_image_mesa(_EGLDriver *drv, _EGLDisplay *disp, _EGLImage *img, return EGL_TRUE; } -static int -dri2_authenticate(_EGLDisplay *disp, uint32_t id) -{ - struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); - - return dri2_dpy->authenticate(dri2_dpy, id); -} - #ifdef HAVE_WAYLAND_PLATFORM static EGLBoolean dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp, @@ -1121,7 +1113,8 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp, return EGL_FALSE; dri2_dpy->wl_server_drm = - wayland_drm_init(wl_dpy, disp, dri2_authenticate, + wayland_drm_init(wl_dpy, disp, + dri2_dpy->authenticate, dri2_dpy->device_name); if (!dri2_dpy->wl_server_drm) diff --git a/src/egl/drivers/dri2/platform_drm.c b/src/egl/drivers/dri2/platform_drm.c index a9a1bf9935..749ed5f91c 100644 --- a/src/egl/drivers/dri2/platform_drm.c +++ b/src/egl/drivers/dri2/platform_drm.c @@ -663,8 +663,10 @@ dri2_get_driver_for_fd(int fd) } static int -dri2_drm_authenticate(struct dri2_egl_display *dri2_dpy, uint32_t id) +dri2_drm_authenticate(_EGLDisplay *disp, uint32_t id) { + struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); + return drmAuthMagic(dri2_dpy->fd, id); } diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c index 2a83ccdf4f..6ae3f6554b 100644 --- a/src/egl/drivers/dri2/platform_wayland.c +++ b/src/egl/drivers/dri2/platform_wayland.c @@ -565,8 +565,9 @@ dri2_wayland_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp, } static int -dri2_wayland_authenticate(struct dri2_egl_display *dri2_dpy, uint32_t id) +dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id) { + struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); int ret = 0; dri2_dpy->wl_dpy->authenticated = false; diff --git a/src/egl/drivers/dri2/platform_x11.c b/src/egl/drivers/dri2/platform_x11.c index 9bb0a4e3fb..42cf57ede9 100644 --- a/src/egl/drivers/dri2/platform_x11.c +++ b/src/egl/drivers/dri2/platform_x11.c @@ -544,8 +544,9 @@ dri2_connect(struct dri2_egl_display *dri2_dpy) } static int -dri2_x11_authenticate(struct dri2_egl_display *dri2_dpy, uint32_t id) +dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id) { + struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); xcb_dri2_authenticate_reply_t *authenticate; xcb_dri2_authenticate_cookie_t authenticate_cookie; xcb_screen_iterator_t s; @@ -567,8 +568,9 @@ dri2_x11_authenticate(struct dri2_egl_display *dri2_dpy, uint32_t id) } static EGLBoolean -dri2_authenticate(struct dri2_egl_display *dri2_dpy) +dri2_authenticate(_EGLDisplay *disp) { + struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); drm_magic_t magic; if (drmGetMagic(dri2_dpy->fd, &magic)) { @@ -973,7 +975,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp) } if (dri2_dpy->conn) { - if (!dri2_connect(dri2_dpy)) + if (!dri2_connect(disp)) goto cleanup_conn; } -- cgit v1.2.3