[Mesa-dev] [PATCH] egl: fix copy/pasted misnomer

nobled nobled at dreamwidth.org
Sun Jul 1 11:12:41 PDT 2012


This is a long-standing typo that propagated
from the wayland code, confusing drm_magic_t and
wayland object IDs.
---
 src/egl/drivers/dri2/egl_dri2.h                    |    2 +-
 src/egl/drivers/dri2/platform_drm.c                |    4 ++--
 src/egl/drivers/dri2/platform_wayland.c            |    4 ++--
 src/egl/drivers/dri2/platform_x11.c                |    4 ++--
 .../wayland/wayland-drm/protocol/wayland-drm.xml   |    2 +-
 src/egl/wayland/wayland-drm/wayland-drm.c          |    4 ++--
 src/egl/wayland/wayland-drm/wayland-drm.h          |    2 +-
 src/gallium/state_trackers/egl/x11/x11_screen.c    |    4 ++--
 src/gallium/state_trackers/egl/x11/x11_screen.h    |    2 +-
 9 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.h b/src/egl/drivers/dri2/egl_dri2.h
index c30e230..97b88a5 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -127,7 +127,7 @@ struct dri2_egl_display
    int			     formats;
 #endif

-   int (*authenticate) (_EGLDisplay *disp, uint32_t id);
+   int (*authenticate) (_EGLDisplay *disp, uint32_t magic);
 };

 struct dri2_egl_context
diff --git a/src/egl/drivers/dri2/platform_drm.c
b/src/egl/drivers/dri2/platform_drm.c
index 54067ff..8a6d385 100644
--- a/src/egl/drivers/dri2/platform_drm.c
+++ b/src/egl/drivers/dri2/platform_drm.c
@@ -382,11 +382,11 @@ dri2_drm_create_image_khr(_EGLDriver *drv,
_EGLDisplay *disp,
 }

 static int
-dri2_drm_authenticate(_EGLDisplay *disp, uint32_t id)
+dri2_drm_authenticate(_EGLDisplay *disp, uint32_t magic)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);

-   return drmAuthMagic(dri2_dpy->fd, id);
+   return drmAuthMagic(dri2_dpy->fd, magic);
 }

 EGLBoolean
diff --git a/src/egl/drivers/dri2/platform_wayland.c
b/src/egl/drivers/dri2/platform_wayland.c
index d291f0f..3423236 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -692,14 +692,14 @@ dri2_wayland_create_image_khr(_EGLDriver *drv,
_EGLDisplay *disp,
 }

 static int
-dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t id)
+dri2_wayland_authenticate(_EGLDisplay *disp, uint32_t magic)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
    int ret = 0;

    dri2_dpy->authenticated = 0;

-   wl_drm_authenticate(dri2_dpy->wl_drm, id);
+   wl_drm_authenticate(dri2_dpy->wl_drm, magic);
    wl_display_roundtrip(dri2_dpy->wl_dpy);

    if (!dri2_dpy->authenticated)
diff --git a/src/egl/drivers/dri2/platform_x11.c
b/src/egl/drivers/dri2/platform_x11.c
index 7486a91..f4629bf 100644
--- a/src/egl/drivers/dri2/platform_x11.c
+++ b/src/egl/drivers/dri2/platform_x11.c
@@ -564,7 +564,7 @@ dri2_connect(struct dri2_egl_display *dri2_dpy)
 }

 static int
-dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id)
+dri2_x11_authenticate(_EGLDisplay *disp, uint32_t magic)
 {
    struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
    xcb_dri2_authenticate_reply_t *authenticate;
@@ -574,7 +574,7 @@ dri2_x11_authenticate(_EGLDisplay *disp, uint32_t id)

    s = xcb_setup_roots_iterator(xcb_get_setup(dri2_dpy->conn));
    authenticate_cookie =
-      xcb_dri2_authenticate_unchecked(dri2_dpy->conn, s.data->root, id);
+      xcb_dri2_authenticate_unchecked(dri2_dpy->conn, s.data->root, magic);
    authenticate =
       xcb_dri2_authenticate_reply(dri2_dpy->conn, authenticate_cookie, NULL);

diff --git a/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml
b/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml
index 89fd8f0..5ed307e 100644
--- a/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml
+++ b/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml
@@ -105,7 +105,7 @@
          DRIAuthConnection() call.  This authentication must be
          completed before create_buffer could be used. -->
     <request name="authenticate">
-      <arg name="id" type="uint"/>
+      <arg name="magic" type="uint"/>
     </request>

     <!-- Create a wayland buffer for the named DRM buffer.  The DRM
diff --git a/src/egl/wayland/wayland-drm/wayland-drm.c
b/src/egl/wayland/wayland-drm/wayland-drm.c
index 5f831b3..313eec5 100644
--- a/src/egl/wayland/wayland-drm/wayland-drm.c
+++ b/src/egl/wayland/wayland-drm/wayland-drm.c
@@ -156,11 +156,11 @@ drm_create_buffer(struct wl_client *client,
struct wl_resource *resource,

 static void
 drm_authenticate(struct wl_client *client,
-		 struct wl_resource *resource, uint32_t id)
+		 struct wl_resource *resource, uint32_t magic)
 {
 	struct wl_drm *drm = resource->data;

-	if (drm->callbacks->authenticate(drm->user_data, id) < 0)
+	if (drm->callbacks->authenticate(drm->user_data, magic) < 0)
 		wl_resource_post_error(resource,
 				       WL_DRM_ERROR_AUTHENTICATE_FAIL,
 				       "authenicate failed");
diff --git a/src/egl/wayland/wayland-drm/wayland-drm.h
b/src/egl/wayland/wayland-drm/wayland-drm.h
index bec50a5..ab6a67e 100644
--- a/src/egl/wayland/wayland-drm/wayland-drm.h
+++ b/src/egl/wayland/wayland-drm/wayland-drm.h
@@ -10,7 +10,7 @@
 struct wl_drm;

 struct wayland_drm_callbacks {
-	int (*authenticate)(void *user_data, uint32_t id);
+	int (*authenticate)(void *user_data, uint32_t magic);

 	void *(*reference_buffer)(void *user_data, uint32_t name,
 				  int32_t width, int32_t height,
diff --git a/src/gallium/state_trackers/egl/x11/x11_screen.c
b/src/gallium/state_trackers/egl/x11/x11_screen.c
index f8f9e2a..41377b4 100644
--- a/src/gallium/state_trackers/egl/x11/x11_screen.c
+++ b/src/gallium/state_trackers/egl/x11/x11_screen.c
@@ -322,12 +322,12 @@ x11_screen_get_device_name(struct x11_screen *xscr)
 }

 int
-x11_screen_authenticate(struct x11_screen *xscr, uint32_t id)
+x11_screen_authenticate(struct x11_screen *xscr, uint32_t magic)
 {
    boolean authenticated;

    authenticated = DRI2Authenticate(xscr->dpy,
-         RootWindow(xscr->dpy, xscr->number), id);
+         RootWindow(xscr->dpy, xscr->number), magic);

    return authenticated ? 0 : -1;
 }
diff --git a/src/gallium/state_trackers/egl/x11/x11_screen.h
b/src/gallium/state_trackers/egl/x11/x11_screen.h
index ad7aa97..edfcf57 100644
--- a/src/gallium/state_trackers/egl/x11/x11_screen.h
+++ b/src/gallium/state_trackers/egl/x11/x11_screen.h
@@ -101,7 +101,7 @@ char *
 x11_screen_get_device_name(struct x11_screen *xscr);

 int
-x11_screen_authenticate(struct x11_screen *xscr, uint32_t id);
+x11_screen_authenticate(struct x11_screen *xscr, uint32_t magic);

 void
 x11_drawable_enable_dri2(struct x11_screen *xscr,
-- 
1.7.9.5


More information about the mesa-dev mailing list