summaryrefslogtreecommitdiffstats
path: root/src/egl/drivers/dri2
diff options
context:
space:
mode:
authorKristian Høgsberg <[email protected]>2013-09-26 12:25:11 -0700
committerKristian Høgsberg <[email protected]>2013-10-11 15:14:35 -0700
commit360a141f24a9d00891665b7fedb77ffb116944ca (patch)
tree79ebe6820c6a23471849307af1d5b03f1b965de2 /src/egl/drivers/dri2
parentfe6974382b353efebf06dfb2d00b0b2c752fb666 (diff)
wayland: Don't rely on static variable for identifying wl_drm buffers
Now that libEGL has been fixed to not leak all kinds of symbols, gbm links to its own copy of the libwayland-drm.a helper library. That means we can't rely on comparing the addresses of a static vtable symbol in that library to determine if a wl_buffer is a wl_drm_buffer. Instead, we move the vtable into the wl_drm struct and use that for comparing. https://bugs.freedesktop.org/show_bug.cgi?id=69437 Cc: 9.2 <[email protected]>
Diffstat (limited to 'src/egl/drivers/dri2')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 04ab5649e52..18ecdc8df38 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1212,7 +1212,8 @@ dri2_create_image_wayland_wl_buffer(_EGLDisplay *disp, _EGLContext *ctx,
EGLint err;
int32_t plane;
- buffer = wayland_drm_buffer_get((struct wl_resource *) _buffer);
+ buffer = wayland_drm_buffer_get(dri2_dpy->wl_server_drm,
+ (struct wl_resource *) _buffer);
if (!buffer)
return NULL;
@@ -1852,6 +1853,10 @@ dri2_bind_wayland_display_wl(_EGLDriver *drv, _EGLDisplay *disp,
if (!dri2_dpy->wl_server_drm)
return EGL_FALSE;
+ /* We have to share the wl_drm instance with gbm, so gbm can convert
+ * wl_buffers to gbm bos. */
+ dri2_dpy->gbm_dri->wl_drm = dri2_dpy->wl_server_drm;
+
return EGL_TRUE;
}
@@ -1877,10 +1882,11 @@ dri2_query_wayland_buffer_wl(_EGLDriver *drv, _EGLDisplay *disp,
struct wl_resource *buffer_resource,
EGLint attribute, EGLint *value)
{
+ struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);
struct wl_drm_buffer *buffer;
const struct wl_drm_components_descriptor *format;
- buffer = wayland_drm_buffer_get(buffer_resource);
+ buffer = wayland_drm_buffer_get(dri2_dpy->wl_server_drm, buffer_resource);
if (!buffer)
return EGL_FALSE;