diff options
author | Daniel Stone <[email protected]> | 2017-09-22 15:40:59 -0700 |
---|---|---|
committer | Daniel Stone <[email protected]> | 2017-09-26 21:48:17 +0100 |
commit | 5b7e65136440f60a6afe85c9517f42861ee07224 (patch) | |
tree | 09e56c10e40461af43d93379b9f2ffc8b461c4f4 /src/egl/drivers/dri2/egl_dri2.c | |
parent | 8822ea100cfd7482290c3c6b2a7200c8b888a7f4 (diff) |
Revert "wayland-drm: constify the callbacks struct"
The wayland-drm callback struct is referenced, rather than duplicated,
inside wayland-drm. Constifying this struct involved moving it on to the
stack; as a result, starting any EGL client on Wayland called into
random stack memory, and killed the compositor.
This reverts commit 1d0be5b3fe548ee33d4520092f583c76d42510a6 and
39d539e321c6c97433a15660c9d9a20ad8657ff0.
Signed-off-by: Daniel Stone <[email protected]>
Cc: Emil Velikov <[email protected]>
Cc: Krzysztof Sobiecki <[email protected]>
Fixes: 1d0be5b3fe54 ("wayland-drm: constify the callbacks struct")
Diffstat (limited to 'src/egl/drivers/dri2/egl_dri2.c')
-rw-r--r-- | src/egl/drivers/dri2/egl_dri2.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c index 0dce2246c15..8f589926963 100644 --- a/src/egl/drivers/dri2/egl_dri2.c +++ b/src/egl/drivers/dri2/egl_dri2.c @@ -2718,16 +2718,17 @@ dri2_wl_release_buffer(void *user_data, struct wl_drm_buffer *buffer) dri2_dpy->image->destroyImage(buffer->driver_buffer); } +static struct wayland_drm_callbacks wl_drm_callbacks = { + .authenticate = NULL, + .reference_buffer = dri2_wl_reference_buffer, + .release_buffer = dri2_wl_release_buffer +}; + static EGLBoolean dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp, struct wl_display *wl_dpy) { struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp); - const struct wayland_drm_callbacks wl_drm_callbacks = { - .authenticate = (int(*)(void *, uint32_t)) dri2_dpy->vtbl->authenticate, - .reference_buffer = dri2_wl_reference_buffer, - .release_buffer = dri2_wl_release_buffer - }; int flags = 0; uint64_t cap; @@ -2736,6 +2737,9 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp, if (dri2_dpy->wl_server_drm) return EGL_FALSE; + wl_drm_callbacks.authenticate = + (int(*)(void *, uint32_t)) dri2_dpy->vtbl->authenticate; + if (drmGetCap(dri2_dpy->fd, DRM_CAP_PRIME, &cap) == 0 && cap == (DRM_PRIME_CAP_IMPORT | DRM_PRIME_CAP_EXPORT) && dri2_dpy->image->base.version >= 7 && |