wayland: Don't rely on static variable for identifying wl_drm buffers
[mesa.git] / src / gbm / backends / dri / gbm_dri.c
index f7da79cac1439148ad89d39934749dad05b67749..24ed2f1c6ab2bc5c18a4692239a7887e9cab9db7 100644 (file)
@@ -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;