From 360a141f24a9d00891665b7fedb77ffb116944ca Mon Sep 17 00:00:00 2001 From: Kristian Høgsberg Date: Thu, 26 Sep 2013 12:25:11 -0700 Subject: 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 --- src/gbm/backends/dri/gbm_dri.c | 5 ++++- src/gbm/backends/dri/gbm_driint.h | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gbm/backends') diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index f7da79cac14..24ed2f1c6ab 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -376,7 +376,10 @@ gbm_dri_bo_import(struct gbm_device *gbm, { struct wl_drm_buffer *wb; - wb = wayland_drm_buffer_get((struct wl_resource *) buffer); + if (!dri->wl_drm) + return NULL; + + wb = wayland_drm_buffer_get(dri->wl_drm, (struct wl_resource *) buffer); if (!wb) return NULL; diff --git a/src/gbm/backends/dri/gbm_driint.h b/src/gbm/backends/dri/gbm_driint.h index 18fc3c0919e..90d764fb44f 100644 --- a/src/gbm/backends/dri/gbm_driint.h +++ b/src/gbm/backends/dri/gbm_driint.h @@ -66,6 +66,8 @@ struct gbm_dri_device { int *width, int *height, unsigned int *attachments, int count, int *out_count, void *data); + + struct wl_drm *wl_drm; }; struct gbm_dri_bo { -- cgit v1.2.3