[PATCH 5/5] file name change from drm to gbm

Halley Zhao halley.zhao at intel.com
Thu Apr 19 18:49:59 PDT 2012


---
 configure.ac                                       |    4 +-
 src/egl/drivers/dri2/Makefile.am                   |    2 +-
 src/egl/drivers/dri2/egl_dri2.h                    |    2 +-
 src/egl/drivers/dri2/platform_wayland.c            |    2 +-
 src/egl/main/Makefile.am                           |    2 +-
 src/egl/wayland/.gitignore                         |    6 +-
 src/egl/wayland/Makefile.am                        |    2 +-
 src/egl/wayland/wayland-drm/Makefile.am            |   17 --
 .../wayland/wayland-drm/protocol/wayland-drm.xml   |  139 -----------
 src/egl/wayland/wayland-drm/wayland-drm.c          |  243
--------------------
 src/egl/wayland/wayland-drm/wayland-drm.h          |   29 ---
 src/egl/wayland/wayland-gbm/Makefile.am            |   17 ++
 .../wayland/wayland-gbm/protocol/wayland-gbm.xml   |  139 +++++++++++
 src/egl/wayland/wayland-gbm/wayland-gbm.c          |  243
++++++++++++++++++++
 src/egl/wayland/wayland-gbm/wayland-gbm.h          |   29 +++
 .../egl/common/native_wayland_drm_bufmgr_helper.c  |   23 --
 .../egl/common/native_wayland_drm_bufmgr_helper.h  |   34 ---
 .../egl/common/native_wayland_gbm_bufmgr_helper.c  |   23 ++
 .../egl/common/native_wayland_gbm_bufmgr_helper.h  |   34 +++
 .../state_trackers/egl/wayland/native_drm.c        |    2 +-
 20 files changed, 496 insertions(+), 496 deletions(-)
 delete mode 100755 src/egl/wayland/wayland-drm/Makefile.am
 delete mode 100644 src/egl/wayland/wayland-drm/protocol/wayland-drm.xml
 delete mode 100755 src/egl/wayland/wayland-drm/wayland-drm.c
 delete mode 100644 src/egl/wayland/wayland-drm/wayland-drm.h
 create mode 100755 src/egl/wayland/wayland-gbm/Makefile.am
 create mode 100755 src/egl/wayland/wayland-gbm/protocol/wayland-gbm.xml
 create mode 100755 src/egl/wayland/wayland-gbm/wayland-gbm.c
 create mode 100755 src/egl/wayland/wayland-gbm/wayland-gbm.h
 delete mode 100644
src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
 delete mode 100644
src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
 create mode 100644
src/gallium/state_trackers/egl/common/native_wayland_gbm_bufmgr_helper.c
 create mode 100644
src/gallium/state_trackers/egl/common/native_wayland_gbm_bufmgr_helper.h

diff --git a/configure.ac b/configure.ac
index 7e4991f..2f8bb2f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1702,7 +1702,7 @@ for plat in $egl_platforms; do
                 GALLIUM_WINSYS_DIRS="$GALLIUM_WINSYS_DIRS sw/wayland"
 
                 m4_ifdef([WAYLAND_SCANNER_RULES],
-
[WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/egl/wayland/wayland-drm/protocol'])])
+
[WAYLAND_SCANNER_RULES(['$(top_srcdir)/src/egl/wayland/wayland-gbm/protocol'])])
 	fi
         if test "$plat" = "drm" && test "x$enable_gbm" = "xno"; then
                 AC_MSG_ERROR([EGL platform drm needs gbm])
@@ -2004,7 +2004,7 @@ AC_CONFIG_FILES([configs/autoconf
 		src/egl/wayland/Makefile
 		src/egl/wayland/wayland-egl/Makefile
 		src/egl/wayland/wayland-egl/wayland-egl.pc
-		src/egl/wayland/wayland-drm/Makefile
+		src/egl/wayland/wayland-gbm/Makefile
 		src/glx/Makefile
 		src/mapi/shared-glapi/Makefile
 		src/gtest/Makefile
diff --git a/src/egl/drivers/dri2/Makefile.am
b/src/egl/drivers/dri2/Makefile.am
index e4d4abb..0ff1085 100644
--- a/src/egl/drivers/dri2/Makefile.am
+++ b/src/egl/drivers/dri2/Makefile.am
@@ -25,7 +25,7 @@ AM_CFLAGS = \
 	-I$(top_srcdir)/src/gbm/main \
 	-I$(top_srcdir)/src/gbm/backends/dri \
 	-I$(top_srcdir)/src/egl/wayland/wayland-egl \
-	-I$(top_srcdir)/src/egl/wayland/wayland-drm \
+	-I$(top_srcdir)/src/egl/wayland/wayland-gbm\
 	$(DEFINES) \
 	$(LIBDRM_CFLAGS) \
 	$(LIBUDEV_CFLAGS) \
diff --git a/src/egl/drivers/dri2/egl_dri2.h
b/src/egl/drivers/dri2/egl_dri2.h
index ae80562..2043ccd 100644
--- a/src/egl/drivers/dri2/egl_dri2.h
+++ b/src/egl/drivers/dri2/egl_dri2.h
@@ -37,7 +37,7 @@
 
 #ifdef HAVE_WAYLAND_PLATFORM
 #include <wayland-client.h>
-#include "wayland-drm.h"
+#include "wayland-gbm.h"
 #include "wayland-egl-priv.h"
 #endif
 
diff --git a/src/egl/drivers/dri2/platform_wayland.c
b/src/egl/drivers/dri2/platform_wayland.c
index cbc48eb..d35d305 100644
--- a/src/egl/drivers/dri2/platform_wayland.c
+++ b/src/egl/drivers/dri2/platform_wayland.c
@@ -38,7 +38,7 @@
 #include "egl_dri2.h"
 
 #include <wayland-client.h>
-#include "wayland-drm-client-protocol.h"
+#include "wayland-gbm-client-protocol.h"
 
 enum wl_gbm_format_flags {
    HAS_ARGB8888 = 1,
diff --git a/src/egl/main/Makefile.am b/src/egl/main/Makefile.am
index 9c3935b..8275e27 100644
--- a/src/egl/main/Makefile.am
+++ b/src/egl/main/Makefile.am
@@ -87,7 +87,7 @@ AM_CFLAGS += -DHAVE_WAYLAND_PLATFORM
 AM_CFLAGS += $(WAYLAND_CFLAGS)
 libEGL_la_LIBADD += $(WAYLAND_LIBS)
 libEGL_la_LIBADD += $(LIBDRM_LIBS)
-libEGL_la_LIBADD += ../wayland/wayland-drm/libwayland-drm.la
+libEGL_la_LIBADD += ../wayland/wayland-gbm/libwayland-gbm.la
 endif
 
 if HAVE_EGL_PLATFORM_DRM
diff --git a/src/egl/wayland/.gitignore b/src/egl/wayland/.gitignore
index 762383e..e893427 100644
--- a/src/egl/wayland/.gitignore
+++ b/src/egl/wayland/.gitignore
@@ -1,4 +1,4 @@
 Makefile
-wayland-drm-client-protocol.h
-wayland-drm-server-protocol.h
-wayland-drm-protocol.c
+wayland-gbm-client-protocol.h
+wayland-gbm-server-protocol.h
+wayland-gbm-protocol.c
diff --git a/src/egl/wayland/Makefile.am b/src/egl/wayland/Makefile.am
index ca7207c..b354f62 100644
--- a/src/egl/wayland/Makefile.am
+++ b/src/egl/wayland/Makefile.am
@@ -1 +1 @@
-SUBDIRS = wayland-drm wayland-egl
+SUBDIRS = wayland-gbm wayland-egl
diff --git a/src/egl/wayland/wayland-drm/Makefile.am
b/src/egl/wayland/wayland-drm/Makefile.am
deleted file mode 100755
index e7bd7b0..0000000
--- a/src/egl/wayland/wayland-drm/Makefile.am
+++ /dev/null
@@ -1,17 +0,0 @@
-AM_CFLAGS = -I$(top_srcdir)/src/egl/main \
-	    -I$(top_srcdir)/include \
-	    -I$(top_srcdir)/src/gbm/main \
-	    $(DEFINES) \
-	    $(WAYLAND_CFLAGS) 
-
-noinst_LTLIBRARIES = libwayland-drm.la
-libwayland_drm_la_SOURCES = wayland-drm.c wayland-drm-protocol.c
-noinst_HEADERS = wayland-drm.h
-
-include_HEADERS = wayland-drm-client-protocol.h
-
-BUILT_SOURCES = wayland-drm-protocol.c \
-		wayland-drm-server-protocol.h
-CLEANFILES = $(BUILT_SOURCES)
-
- at wayland_scanner_rules@
diff --git a/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml
b/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml
deleted file mode 100644
index 1615baf..0000000
--- a/src/egl/wayland/wayland-drm/protocol/wayland-drm.xml
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<protocol name="gbm">
-
-  <copyright>
-    Copyright © 2008-2011 Kristian Høgsberg
-    Copyright © 2010-2011 Intel Corporation
-
-    Permission to use, copy, modify, distribute, and sell this
-    software and its documentation for any purpose is hereby granted
-    without fee, provided that\n the above copyright notice appear in
-    all copies and that both that copyright notice and this permission
-    notice appear in supporting documentation, and that the name of
-    the copyright holders not be used in advertising or publicity
-    pertaining to distribution of the software without specific,
-    written prior permission.  The copyright holders make no
-    representations about the suitability of this software for any
-    purpose.  It is provided "as is" without express or implied
-    warranty.
-
-    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
-    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
-    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
-    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
-    THIS SOFTWARE.
-  </copyright>
-
-  <!-- gbm support. This object is created by the server and published
-       using the display's global event. -->
-  <interface name="wl_gbm" version="1">
-    <enum name="error">
-      <entry name="authenticate_fail" value="0"/>
-      <entry name="invalid_format" value="1"/>
-      <entry name="invalid_name" value="2"/>
-    </enum>
-
-    <enum name="format">
-      <!-- The gbm format codes match the #defines in drm_fourcc.h.
-           The formats actually supported by the compositor will be
-           reported by the format event. -->
-      <entry name="c8" value="0x20203843"/>
-      <entry name="rgb332" value="0x38424752"/>
-      <entry name="bgr233" value="0x38524742"/>
-      <entry name="xrgb4444" value="0x32315258"/>
-      <entry name="xbgr4444" value="0x32314258"/>
-      <entry name="rgbx4444" value="0x32315852"/>
-      <entry name="bgrx4444" value="0x32315842"/>
-      <entry name="argb4444" value="0x32315241"/>
-      <entry name="abgr4444" value="0x32314241"/>
-      <entry name="rgba4444" value="0x32314152"/>
-      <entry name="bgra4444" value="0x32314142"/>
-      <entry name="xrgb1555" value="0x35315258"/>
-      <entry name="xbgr1555" value="0x35314258"/>
-      <entry name="rgbx5551" value="0x35315852"/>
-      <entry name="bgrx5551" value="0x35315842"/>
-      <entry name="argb1555" value="0x35315241"/>
-      <entry name="abgr1555" value="0x35314241"/>
-      <entry name="rgba5551" value="0x35314152"/>
-      <entry name="bgra5551" value="0x35314142"/>
-      <entry name="rgb565" value="0x36314752"/>
-      <entry name="bgr565" value="0x36314742"/>
-      <entry name="rgb888" value="0x34324752"/>
-      <entry name="bgr888" value="0x34324742"/>
-      <entry name="xrgb8888" value="0x34325258"/>
-      <entry name="xbgr8888" value="0x34324258"/>
-      <entry name="rgbx8888" value="0x34325852"/>
-      <entry name="bgrx8888" value="0x34325842"/>
-      <entry name="argb8888" value="0x34325241"/>
-      <entry name="abgr8888" value="0x34324241"/>
-      <entry name="rgba8888" value="0x34324152"/>
-      <entry name="bgra8888" value="0x34324142"/>
-      <entry name="xrgb2101010" value="0x30335258"/>
-      <entry name="xbgr2101010" value="0x30334258"/>
-      <entry name="rgbx1010102" value="0x30335852"/>
-      <entry name="bgrx1010102" value="0x30335842"/>
-      <entry name="argb2101010" value="0x30335241"/>
-      <entry name="abgr2101010" value="0x30334241"/>
-      <entry name="rgba1010102" value="0x30334152"/>
-      <entry name="bgra1010102" value="0x30334142"/>
-      <entry name="yuyv" value="0x56595559"/>
-      <entry name="yvyu" value="0x55595659"/>
-      <entry name="uyvy" value="0x59565955"/>
-      <entry name="vyuy" value="0x59555956"/>
-      <entry name="ayuv" value="0x56555941"/>
-      <entry name="nv12" value="0x3231564e"/>
-      <entry name="nv21" value="0x3132564e"/>
-      <entry name="nv16" value="0x3631564e"/>
-      <entry name="nv61" value="0x3136564e"/>
-      <entry name="yuv410" value="0x39565559"/>
-      <entry name="yvu410" value="0x39555659"/>
-      <entry name="yuv411" value="0x31315559"/>
-      <entry name="yvu411" value="0x31315659"/>
-      <entry name="yuv420" value="0x32315559"/>
-      <entry name="yvu420" value="0x32315659"/>
-      <entry name="yuv422" value="0x36315559"/>
-      <entry name="yvu422" value="0x36315659"/>
-      <entry name="yuv444" value="0x34325559"/>
-      <entry name="yvu444" value="0x34325659"/>
-    </enum>
-
-    <!-- Call this request with the magic received from drmGetMagic().
-         It will be passed on to the drmAuthMagic() or
-         DRIAuthConnection() call.  This authentication must be
-         completed before create_buffer could be used. -->
-    <request name="authenticate">
-      <arg name="id" type="uint"/>
-    </request>
-
-    <!-- Create a wayland buffer for the named DRM buffer.  The DRM
-         surface must have a name using the flink ioctl -->
-    <request name="create_buffer">
-      <arg name="id" type="new_id" interface="wl_buffer"/>
-      <arg name="name" type="uint"/>
-      <arg name="width" type="int"/>
-      <arg name="height" type="int"/>
-      <arg name="stride" type="uint"/>
-      <arg name="format" type="uint"/>
-    </request>
-
-    <!-- Notification of the path of the drm device which is used by
-         the server.  The client should use this device for creating
-         local buffers.  Only buffers created from this device should
-         be be passed to the server using this drm object's
-         create_buffer request. -->
-    <event name="device">
-      <arg name="name" type="string"/>
-    </event>
-
-    <event name="format">
-      <arg name="format" type="uint"/>
-    </event>
-
-    <!-- Raised if the authenticate request succeeded -->
-    <event name="authenticated"/>
-  </interface>
-
-</protocol>
diff --git a/src/egl/wayland/wayland-drm/wayland-drm.c
b/src/egl/wayland/wayland-drm/wayland-drm.c
deleted file mode 100755
index e27bfca..0000000
--- a/src/egl/wayland/wayland-drm/wayland-drm.c
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * Copyright © 2011 Kristian Høgsberg
- * Copyright © 2011 Benjamin Franzke
- *
- * Permission is hereby granted, free of charge, to any person
obtaining a
- * copy of this software and associated documentation files (the
"Software"),
- * to deal in the Software without restriction, including without
limitation
- * the rights to use, copy, modify, merge, publish, distribute,
sublicense,
- * and/or sell copies of the Software, and to permit persons to whom
the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice (including the
next
- * paragraph) shall be included in all copies or substantial portions
of the
- * Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
- * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- *
- * Authors:
- *    Kristian Høgsberg <krh at bitplanet.net>
- *    Benjamin Franzke <benjaminfranzke at googlemail.com>
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stddef.h>
-
-#include <wayland-server.h>
-#include "wayland-drm.h"
-#include "wayland-drm-server-protocol.h"
-#include "gbm.h"
-/* Git master of Wayland is moving towards a stable version of the
- * protocol, but breaking from 0.85 in the process.  For the time
- * being, it's convenient to be able to build Mesa against both master
- * and 0.85.x of Wayland.  To make this work we'll do a compile-time
- * version check and work around the difference in API and protocol */
-#if defined (WAYLAND_VERSION_MAJOR) &&		\
-	WAYLAND_VERSION_MAJOR == 0 &&		\
-	WAYLAND_VERSION_MINOR == 85
-#define HAS_WAYLAND_0_85
-#endif
-
-struct wl_gbm {
-	struct wl_display *display;
-
-	void *user_data;
-	char *device_name;
-
-	struct wl_gbm_callbacks *callbacks;
-    struct gbm_device *gbm_device;
-};
-
-struct wl_gbm_buffer {
-	struct wl_buffer buffer;
-	struct wl_gbm *gbm;
-	uint32_t format;
-
-	void *driver_buffer;
-    struct gbm_bo* bo;
-};
-
-static void
-destroy_buffer(struct wl_resource *resource)
-{
-	struct wl_gbm_buffer *buffer = resource->data;
-	struct wl_gbm *gbm = buffer->gbm;
-
-    gbm_bo_destroy (buffer->bo);
-	free(buffer);
-}
-
-static void
-buffer_destroy(struct wl_client *client, struct wl_resource *resource)
-{
-#ifdef HAS_WAYLAND_0_85
-	wl_resource_destroy(resource, 0);
-#else
-	wl_resource_destroy(resource);
-#endif
-}
-
-#ifdef HAS_WAYLAND_0_85
-static void
-buffer_damage(struct wl_client *client, struct wl_resource *buffer,
-              int32_t x, int32_t y, int32_t width, int32_t height)
-{
-}
-#endif
-
-const static struct wl_buffer_interface gbm_buffer_interface = {
-#ifdef HAS_WAYLAND_0_85
-	buffer_damage,
-#endif
-	buffer_destroy
-};
-
-static void
-gbm_create_buffer(struct wl_client *client, struct wl_resource
*resource,
-		  uint32_t id, uint32_t name, int32_t width, int32_t height,
-		  uint32_t stride, uint32_t format)
-{
-	struct wl_gbm *gbm = resource->data;
-	struct wl_gbm_buffer *buffer;
-    int gbm_format;
-
-	switch (format) {
-	case WL_GBM_FORMAT_ARGB8888:
-        gbm_format = GBM_BO_FORMAT_ARGB8888;
-		break;
-	case WL_GBM_FORMAT_XRGB8888:
-        gbm_format = GBM_BO_FORMAT_XRGB8888;
-		break;
-	default:
-		wl_resource_post_error(resource,
-				       WL_GBM_ERROR_INVALID_FORMAT,
-				       "invalid format");
-		return;
-	}
-
-	buffer = calloc(1, sizeof *buffer);
-	if (buffer == NULL) {
-		wl_resource_post_no_memory(resource);
-		return;
-	}
-
-	buffer->gbm = gbm;
-	buffer->buffer.width = width;
-	buffer->buffer.height = height;
-	buffer->format = format;
-
-    buffer->bo = gbm_bo_create_from_handle(gbm->gbm_device, name,
&(buffer->driver_buffer),
-                                            width, height, stride,
gbm_format, GBM_BO_USE_RENDERING);
-    if (buffer->driver_buffer == NULL) {
-        wl_resource_post_error(resource,
-                       WL_GBM_ERROR_INVALID_NAME,
-                       "invalid name");
-        return;
-    }
-
-	buffer->buffer.resource.object.id = id;
-	buffer->buffer.resource.object.interface = &wl_buffer_interface;
-	buffer->buffer.resource.object.implementation =
-		(void (**)(void)) &gbm_buffer_interface;
-	buffer->buffer.resource.data = buffer;
-
-	buffer->buffer.resource.destroy = destroy_buffer;
-	buffer->buffer.resource.client = resource->client;
-
-	wl_client_add_resource(resource->client, &buffer->buffer.resource);
-}
-
-static void
-gbm_authenticate(struct wl_client *client,
-		 struct wl_resource *resource, uint32_t id)
-{
-	struct wl_gbm *gbm = resource->data;
-
-	if (gbm->callbacks->authenticate(gbm->user_data, id) < 0)
-		wl_resource_post_error(resource,
-				       WL_GBM_ERROR_AUTHENTICATE_FAIL,
-				       "authenicate failed");
-	else
-		wl_resource_post_event(resource, WL_GBM_AUTHENTICATED);
-}
-
-const static struct wl_gbm_interface gbm_interface = {
-	gbm_authenticate,
-	gbm_create_buffer
-};
-
-static void
-bind_gbm(struct wl_client *client, void *data, uint32_t version,
uint32_t id)
-{
-	struct wl_gbm *gbm = data;
-	struct wl_resource *resource;
-
-	resource = wl_client_add_object(client, &wl_gbm_interface,
-					&gbm_interface, id, data);
-	wl_resource_post_event(resource, WL_GBM_DEVICE, gbm->device_name);
-	wl_resource_post_event(resource, WL_GBM_FORMAT,
-			       WL_GBM_FORMAT_ARGB8888);
-	wl_resource_post_event(resource, WL_GBM_FORMAT,
-			       WL_GBM_FORMAT_XRGB8888);
-}
-
-struct wl_gbm *
-wl_gbm_init(struct wl_display *display, char *device_name, int fd, 
-                 struct wl_gbm_callbacks *callbacks, void *user_data)
-{
-	struct wl_gbm *gbm;
-
-	gbm = malloc(sizeof *gbm);
-
-	gbm->display = display;
-	gbm->device_name = strdup(device_name);
-	gbm->callbacks = callbacks;
-	gbm->user_data = user_data;
-    gbm->gbm_device = gbm_create_device(fd);
-
-	wl_display_add_global(display, &wl_gbm_interface, gbm, bind_gbm);
-
-	return gbm;
-}
-
-void
-wl_gbm_uninit(struct wl_gbm *gbm)
-{
-	free(gbm->device_name);
-
-	/* FIXME: need wl_display_del_{object,global} */
-
-	free(gbm);
-}
-
-int
-wayland_buffer_is_gbm(struct wl_buffer *buffer)
-{
-	return buffer->resource.object.implementation == 
-		(void (**)(void)) &gbm_buffer_interface;
-}
-
-uint32_t
-wl_gbm_buffer_get_format(struct wl_buffer *buffer_base)
-{
-	struct wl_gbm_buffer *buffer = (struct wl_gbm_buffer *) buffer_base;
-
-	return buffer->format;
-}
-
-void *
-wl_gbm_buffer_get_buffer(struct wl_buffer *buffer_base)
-{
-	struct wl_gbm_buffer *buffer = (struct wl_gbm_buffer *) buffer_base;
-
-	return buffer->driver_buffer;
-}
diff --git a/src/egl/wayland/wayland-drm/wayland-drm.h
b/src/egl/wayland/wayland-drm/wayland-drm.h
deleted file mode 100644
index 5498b79..0000000
--- a/src/egl/wayland/wayland-drm/wayland-drm.h
+++ /dev/null
@@ -1,29 +0,0 @@
-#ifndef WAYLAND_GBM_H
-#define WAYLAND_GBM_H
-
-#include <wayland-server.h>
-#include "wayland-drm-server-protocol.h"
-
-struct wl_gbm;
-
-struct wl_gbm_callbacks {
-	int (*authenticate)(void *user_data, uint32_t id);
-};
-
-struct wl_gbm *
-wl_gbm_init(struct wl_display *display, char *device_name, int fd, 
-		 struct wl_gbm_callbacks *callbacks, void *user_data);
-
-void
-wl_gbm_uninit(struct wl_gbm *gbm);
-
-int
-wayland_buffer_is_gbm(struct wl_buffer *buffer);
-
-uint32_t
-wl_gbm_buffer_get_format(struct wl_buffer *buffer_base);
-
-void *
-wl_gbm_buffer_get_buffer(struct wl_buffer *buffer);
-
-#endif
diff --git a/src/egl/wayland/wayland-gbm/Makefile.am
b/src/egl/wayland/wayland-gbm/Makefile.am
new file mode 100755
index 0000000..9d4669e
--- /dev/null
+++ b/src/egl/wayland/wayland-gbm/Makefile.am
@@ -0,0 +1,17 @@
+AM_CFLAGS = -I$(top_srcdir)/src/egl/main \
+	    -I$(top_srcdir)/include \
+	    -I$(top_srcdir)/src/gbm/main \
+	    $(DEFINES) \
+	    $(WAYLAND_CFLAGS) 
+
+noinst_LTLIBRARIES = libwayland-gbm.la
+libwayland_gbm_la_SOURCES = wayland-gbm.c wayland-gbm-protocol.c
+noinst_HEADERS = wayland-gbm.h
+
+include_HEADERS = wayland-gbm-client-protocol.h
+
+BUILT_SOURCES = wayland-gbm-protocol.c \
+		wayland-gbm-server-protocol.h
+CLEANFILES = $(BUILT_SOURCES)
+
+ at wayland_scanner_rules@
diff --git a/src/egl/wayland/wayland-gbm/protocol/wayland-gbm.xml
b/src/egl/wayland/wayland-gbm/protocol/wayland-gbm.xml
new file mode 100755
index 0000000..1615baf
--- /dev/null
+++ b/src/egl/wayland/wayland-gbm/protocol/wayland-gbm.xml
@@ -0,0 +1,139 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="gbm">
+
+  <copyright>
+    Copyright © 2008-2011 Kristian Høgsberg
+    Copyright © 2010-2011 Intel Corporation
+
+    Permission to use, copy, modify, distribute, and sell this
+    software and its documentation for any purpose is hereby granted
+    without fee, provided that\n the above copyright notice appear in
+    all copies and that both that copyright notice and this permission
+    notice appear in supporting documentation, and that the name of
+    the copyright holders not be used in advertising or publicity
+    pertaining to distribution of the software without specific,
+    written prior permission.  The copyright holders make no
+    representations about the suitability of this software for any
+    purpose.  It is provided "as is" without express or implied
+    warranty.
+
+    THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
+    SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
+    FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
+    SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
+    AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
+    ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
+    THIS SOFTWARE.
+  </copyright>
+
+  <!-- gbm support. This object is created by the server and published
+       using the display's global event. -->
+  <interface name="wl_gbm" version="1">
+    <enum name="error">
+      <entry name="authenticate_fail" value="0"/>
+      <entry name="invalid_format" value="1"/>
+      <entry name="invalid_name" value="2"/>
+    </enum>
+
+    <enum name="format">
+      <!-- The gbm format codes match the #defines in drm_fourcc.h.
+           The formats actually supported by the compositor will be
+           reported by the format event. -->
+      <entry name="c8" value="0x20203843"/>
+      <entry name="rgb332" value="0x38424752"/>
+      <entry name="bgr233" value="0x38524742"/>
+      <entry name="xrgb4444" value="0x32315258"/>
+      <entry name="xbgr4444" value="0x32314258"/>
+      <entry name="rgbx4444" value="0x32315852"/>
+      <entry name="bgrx4444" value="0x32315842"/>
+      <entry name="argb4444" value="0x32315241"/>
+      <entry name="abgr4444" value="0x32314241"/>
+      <entry name="rgba4444" value="0x32314152"/>
+      <entry name="bgra4444" value="0x32314142"/>
+      <entry name="xrgb1555" value="0x35315258"/>
+      <entry name="xbgr1555" value="0x35314258"/>
+      <entry name="rgbx5551" value="0x35315852"/>
+      <entry name="bgrx5551" value="0x35315842"/>
+      <entry name="argb1555" value="0x35315241"/>
+      <entry name="abgr1555" value="0x35314241"/>
+      <entry name="rgba5551" value="0x35314152"/>
+      <entry name="bgra5551" value="0x35314142"/>
+      <entry name="rgb565" value="0x36314752"/>
+      <entry name="bgr565" value="0x36314742"/>
+      <entry name="rgb888" value="0x34324752"/>
+      <entry name="bgr888" value="0x34324742"/>
+      <entry name="xrgb8888" value="0x34325258"/>
+      <entry name="xbgr8888" value="0x34324258"/>
+      <entry name="rgbx8888" value="0x34325852"/>
+      <entry name="bgrx8888" value="0x34325842"/>
+      <entry name="argb8888" value="0x34325241"/>
+      <entry name="abgr8888" value="0x34324241"/>
+      <entry name="rgba8888" value="0x34324152"/>
+      <entry name="bgra8888" value="0x34324142"/>
+      <entry name="xrgb2101010" value="0x30335258"/>
+      <entry name="xbgr2101010" value="0x30334258"/>
+      <entry name="rgbx1010102" value="0x30335852"/>
+      <entry name="bgrx1010102" value="0x30335842"/>
+      <entry name="argb2101010" value="0x30335241"/>
+      <entry name="abgr2101010" value="0x30334241"/>
+      <entry name="rgba1010102" value="0x30334152"/>
+      <entry name="bgra1010102" value="0x30334142"/>
+      <entry name="yuyv" value="0x56595559"/>
+      <entry name="yvyu" value="0x55595659"/>
+      <entry name="uyvy" value="0x59565955"/>
+      <entry name="vyuy" value="0x59555956"/>
+      <entry name="ayuv" value="0x56555941"/>
+      <entry name="nv12" value="0x3231564e"/>
+      <entry name="nv21" value="0x3132564e"/>
+      <entry name="nv16" value="0x3631564e"/>
+      <entry name="nv61" value="0x3136564e"/>
+      <entry name="yuv410" value="0x39565559"/>
+      <entry name="yvu410" value="0x39555659"/>
+      <entry name="yuv411" value="0x31315559"/>
+      <entry name="yvu411" value="0x31315659"/>
+      <entry name="yuv420" value="0x32315559"/>
+      <entry name="yvu420" value="0x32315659"/>
+      <entry name="yuv422" value="0x36315559"/>
+      <entry name="yvu422" value="0x36315659"/>
+      <entry name="yuv444" value="0x34325559"/>
+      <entry name="yvu444" value="0x34325659"/>
+    </enum>
+
+    <!-- Call this request with the magic received from drmGetMagic().
+         It will be passed on to the drmAuthMagic() or
+         DRIAuthConnection() call.  This authentication must be
+         completed before create_buffer could be used. -->
+    <request name="authenticate">
+      <arg name="id" type="uint"/>
+    </request>
+
+    <!-- Create a wayland buffer for the named DRM buffer.  The DRM
+         surface must have a name using the flink ioctl -->
+    <request name="create_buffer">
+      <arg name="id" type="new_id" interface="wl_buffer"/>
+      <arg name="name" type="uint"/>
+      <arg name="width" type="int"/>
+      <arg name="height" type="int"/>
+      <arg name="stride" type="uint"/>
+      <arg name="format" type="uint"/>
+    </request>
+
+    <!-- Notification of the path of the drm device which is used by
+         the server.  The client should use this device for creating
+         local buffers.  Only buffers created from this device should
+         be be passed to the server using this drm object's
+         create_buffer request. -->
+    <event name="device">
+      <arg name="name" type="string"/>
+    </event>
+
+    <event name="format">
+      <arg name="format" type="uint"/>
+    </event>
+
+    <!-- Raised if the authenticate request succeeded -->
+    <event name="authenticated"/>
+  </interface>
+
+</protocol>
diff --git a/src/egl/wayland/wayland-gbm/wayland-gbm.c
b/src/egl/wayland/wayland-gbm/wayland-gbm.c
new file mode 100755
index 0000000..d80b5a0
--- /dev/null
+++ b/src/egl/wayland/wayland-gbm/wayland-gbm.c
@@ -0,0 +1,243 @@
+/*
+ * Copyright © 2011 Kristian Høgsberg
+ * Copyright © 2011 Benjamin Franzke
+ *
+ * Permission is hereby granted, free of charge, to any person
obtaining a
+ * copy of this software and associated documentation files (the
"Software"),
+ * to deal in the Software without restriction, including without
limitation
+ * the rights to use, copy, modify, merge, publish, distribute,
sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom
the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
next
+ * paragraph) shall be included in all copies or substantial portions
of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT.  IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Kristian Høgsberg <krh at bitplanet.net>
+ *    Benjamin Franzke <benjaminfranzke at googlemail.com>
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stddef.h>
+
+#include <wayland-server.h>
+#include "wayland-gbm.h"
+#include "wayland-gbm-server-protocol.h"
+#include "gbm.h"
+/* Git master of Wayland is moving towards a stable version of the
+ * protocol, but breaking from 0.85 in the process.  For the time
+ * being, it's convenient to be able to build Mesa against both master
+ * and 0.85.x of Wayland.  To make this work we'll do a compile-time
+ * version check and work around the difference in API and protocol */
+#if defined (WAYLAND_VERSION_MAJOR) &&		\
+	WAYLAND_VERSION_MAJOR == 0 &&		\
+	WAYLAND_VERSION_MINOR == 85
+#define HAS_WAYLAND_0_85
+#endif
+
+struct wl_gbm {
+	struct wl_display *display;
+
+	void *user_data;
+	char *device_name;
+
+	struct wl_gbm_callbacks *callbacks;
+    struct gbm_device *gbm_device;
+};
+
+struct wl_gbm_buffer {
+	struct wl_buffer buffer;
+	struct wl_gbm *gbm;
+	uint32_t format;
+
+	void *driver_buffer;
+    struct gbm_bo* bo;
+};
+
+static void
+destroy_buffer(struct wl_resource *resource)
+{
+	struct wl_gbm_buffer *buffer = resource->data;
+	struct wl_gbm *gbm = buffer->gbm;
+
+    gbm_bo_destroy (buffer->bo);
+	free(buffer);
+}
+
+static void
+buffer_destroy(struct wl_client *client, struct wl_resource *resource)
+{
+#ifdef HAS_WAYLAND_0_85
+	wl_resource_destroy(resource, 0);
+#else
+	wl_resource_destroy(resource);
+#endif
+}
+
+#ifdef HAS_WAYLAND_0_85
+static void
+buffer_damage(struct wl_client *client, struct wl_resource *buffer,
+              int32_t x, int32_t y, int32_t width, int32_t height)
+{
+}
+#endif
+
+const static struct wl_buffer_interface gbm_buffer_interface = {
+#ifdef HAS_WAYLAND_0_85
+	buffer_damage,
+#endif
+	buffer_destroy
+};
+
+static void
+gbm_create_buffer(struct wl_client *client, struct wl_resource
*resource,
+		  uint32_t id, uint32_t name, int32_t width, int32_t height,
+		  uint32_t stride, uint32_t format)
+{
+	struct wl_gbm *gbm = resource->data;
+	struct wl_gbm_buffer *buffer;
+    int gbm_format;
+
+	switch (format) {
+	case WL_GBM_FORMAT_ARGB8888:
+        gbm_format = GBM_BO_FORMAT_ARGB8888;
+		break;
+	case WL_GBM_FORMAT_XRGB8888:
+        gbm_format = GBM_BO_FORMAT_XRGB8888;
+		break;
+	default:
+		wl_resource_post_error(resource,
+				       WL_GBM_ERROR_INVALID_FORMAT,
+				       "invalid format");
+		return;
+	}
+
+	buffer = calloc(1, sizeof *buffer);
+	if (buffer == NULL) {
+		wl_resource_post_no_memory(resource);
+		return;
+	}
+
+	buffer->gbm = gbm;
+	buffer->buffer.width = width;
+	buffer->buffer.height = height;
+	buffer->format = format;
+
+    buffer->bo = gbm_bo_create_from_handle(gbm->gbm_device, name,
&(buffer->driver_buffer),
+                                            width, height, stride,
gbm_format, GBM_BO_USE_RENDERING);
+    if (buffer->driver_buffer == NULL) {
+        wl_resource_post_error(resource,
+                       WL_GBM_ERROR_INVALID_NAME,
+                       "invalid name");
+        return;
+    }
+
+	buffer->buffer.resource.object.id = id;
+	buffer->buffer.resource.object.interface = &wl_buffer_interface;
+	buffer->buffer.resource.object.implementation =
+		(void (**)(void)) &gbm_buffer_interface;
+	buffer->buffer.resource.data = buffer;
+
+	buffer->buffer.resource.destroy = destroy_buffer;
+	buffer->buffer.resource.client = resource->client;
+
+	wl_client_add_resource(resource->client, &buffer->buffer.resource);
+}
+
+static void
+gbm_authenticate(struct wl_client *client,
+		 struct wl_resource *resource, uint32_t id)
+{
+	struct wl_gbm *gbm = resource->data;
+
+	if (gbm->callbacks->authenticate(gbm->user_data, id) < 0)
+		wl_resource_post_error(resource,
+				       WL_GBM_ERROR_AUTHENTICATE_FAIL,
+				       "authenicate failed");
+	else
+		wl_resource_post_event(resource, WL_GBM_AUTHENTICATED);
+}
+
+const static struct wl_gbm_interface gbm_interface = {
+	gbm_authenticate,
+	gbm_create_buffer
+};
+
+static void
+bind_gbm(struct wl_client *client, void *data, uint32_t version,
uint32_t id)
+{
+	struct wl_gbm *gbm = data;
+	struct wl_resource *resource;
+
+	resource = wl_client_add_object(client, &wl_gbm_interface,
+					&gbm_interface, id, data);
+	wl_resource_post_event(resource, WL_GBM_DEVICE, gbm->device_name);
+	wl_resource_post_event(resource, WL_GBM_FORMAT,
+			       WL_GBM_FORMAT_ARGB8888);
+	wl_resource_post_event(resource, WL_GBM_FORMAT,
+			       WL_GBM_FORMAT_XRGB8888);
+}
+
+struct wl_gbm *
+wl_gbm_init(struct wl_display *display, char *device_name, int fd, 
+                 struct wl_gbm_callbacks *callbacks, void *user_data)
+{
+	struct wl_gbm *gbm;
+
+	gbm = malloc(sizeof *gbm);
+
+	gbm->display = display;
+	gbm->device_name = strdup(device_name);
+	gbm->callbacks = callbacks;
+	gbm->user_data = user_data;
+    gbm->gbm_device = gbm_create_device(fd);
+
+	wl_display_add_global(display, &wl_gbm_interface, gbm, bind_gbm);
+
+	return gbm;
+}
+
+void
+wl_gbm_uninit(struct wl_gbm *gbm)
+{
+	free(gbm->device_name);
+
+	/* FIXME: need wl_display_del_{object,global} */
+
+	free(gbm);
+}
+
+int
+wayland_buffer_is_gbm(struct wl_buffer *buffer)
+{
+	return buffer->resource.object.implementation == 
+		(void (**)(void)) &gbm_buffer_interface;
+}
+
+uint32_t
+wl_gbm_buffer_get_format(struct wl_buffer *buffer_base)
+{
+	struct wl_gbm_buffer *buffer = (struct wl_gbm_buffer *) buffer_base;
+
+	return buffer->format;
+}
+
+void *
+wl_gbm_buffer_get_buffer(struct wl_buffer *buffer_base)
+{
+	struct wl_gbm_buffer *buffer = (struct wl_gbm_buffer *) buffer_base;
+
+	return buffer->driver_buffer;
+}
diff --git a/src/egl/wayland/wayland-gbm/wayland-gbm.h
b/src/egl/wayland/wayland-gbm/wayland-gbm.h
new file mode 100755
index 0000000..54a55df
--- /dev/null
+++ b/src/egl/wayland/wayland-gbm/wayland-gbm.h
@@ -0,0 +1,29 @@
+#ifndef WAYLAND_GBM_H
+#define WAYLAND_GBM_H
+
+#include <wayland-server.h>
+#include "wayland-gbm-server-protocol.h"
+
+struct wl_gbm;
+
+struct wl_gbm_callbacks {
+	int (*authenticate)(void *user_data, uint32_t id);
+};
+
+struct wl_gbm *
+wl_gbm_init(struct wl_display *display, char *device_name, int fd, 
+		 struct wl_gbm_callbacks *callbacks, void *user_data);
+
+void
+wl_gbm_uninit(struct wl_gbm *gbm);
+
+int
+wayland_buffer_is_gbm(struct wl_buffer *buffer);
+
+uint32_t
+wl_gbm_buffer_get_format(struct wl_buffer *buffer_base);
+
+void *
+wl_gbm_buffer_get_buffer(struct wl_buffer *buffer);
+
+#endif
diff --git
a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
deleted file mode 100644
index 15463ec..0000000
---
a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.c
+++ /dev/null
@@ -1,23 +0,0 @@
-#include <stdint.h>
-#include <string.h>
-
-#include "native.h"
-#include "util/u_inlines.h"
-#include "state_tracker/drm_driver.h"
-
-#ifdef HAVE_WAYLAND_BACKEND
-
-#include <wayland-server.h>
-#include <wayland-drm-server-protocol.h>
-
-#include "native_wayland_drm_bufmgr_helper.h"
-
-
-struct pipe_resource *
-egl_g3d_wl_gbm_common_wl_buffer_get_resource(struct native_display
*ndpy,
-                                             struct wl_buffer *buffer)
-{
-   return wl_gbm_buffer_get_buffer(buffer);
-}
-
-#endif
diff --git
a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h b/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
deleted file mode 100644
index 57867eb..0000000
---
a/src/gallium/state_trackers/egl/common/native_wayland_drm_bufmgr_helper.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Mesa 3-D graphics library
- * Version:  7.11
- *
- * Copyright (C) 2011 Benjamin Franzke <benjaminfranzke at googlemail.com>
- *
- * Permission is hereby granted, free of charge, to any person
obtaining a
- * copy of this software and associated documentation files (the
"Software"),
- * to deal in the Software without restriction, including without
limitation
- * the rights to use, copy, modify, merge, publish, distribute,
sublicense,
- * and/or sell copies of the Software, and to permit persons to whom
the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be
included
- * in all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
SHALL
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
- */
-
-#ifndef _NATIVE_WAYLAND_GBM_BUFMGR_HELPER_H_
-#define _NATIVE_WAYLAND_GBM_BUFMGR_HELPER_H_
-
-#include "wayland-drm.h"
-struct pipe_resource *
-egl_g3d_wl_gbm_common_wl_buffer_get_resource(struct native_display
*ndpy,
-                                             struct wl_buffer *buffer);
-
-#endif /* _NATIVE_WAYLAND_GBM_BUFMGR_HELPER_H_ */
diff --git
a/src/gallium/state_trackers/egl/common/native_wayland_gbm_bufmgr_helper.c b/src/gallium/state_trackers/egl/common/native_wayland_gbm_bufmgr_helper.c
new file mode 100644
index 0000000..a227e8a
--- /dev/null
+++
b/src/gallium/state_trackers/egl/common/native_wayland_gbm_bufmgr_helper.c
@@ -0,0 +1,23 @@
+#include <stdint.h>
+#include <string.h>
+
+#include "native.h"
+#include "util/u_inlines.h"
+#include "state_tracker/drm_driver.h"
+
+#ifdef HAVE_WAYLAND_BACKEND
+
+#include <wayland-server.h>
+#include <wayland-gbm-server-protocol.h>
+
+#include "native_wayland_gbm_bufmgr_helper.h"
+
+
+struct pipe_resource *
+egl_g3d_wl_gbm_common_wl_buffer_get_resource(struct native_display
*ndpy,
+                                             struct wl_buffer *buffer)
+{
+   return wl_gbm_buffer_get_buffer(buffer);
+}
+
+#endif
diff --git
a/src/gallium/state_trackers/egl/common/native_wayland_gbm_bufmgr_helper.h b/src/gallium/state_trackers/egl/common/native_wayland_gbm_bufmgr_helper.h
new file mode 100644
index 0000000..4984c92
--- /dev/null
+++
b/src/gallium/state_trackers/egl/common/native_wayland_gbm_bufmgr_helper.h
@@ -0,0 +1,34 @@
+/*
+ * Mesa 3-D graphics library
+ * Version:  7.11
+ *
+ * Copyright (C) 2011 Benjamin Franzke <benjaminfranzke at googlemail.com>
+ *
+ * Permission is hereby granted, free of charge, to any person
obtaining a
+ * copy of this software and associated documentation files (the
"Software"),
+ * to deal in the Software without restriction, including without
limitation
+ * the rights to use, copy, modify, merge, publish, distribute,
sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom
the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT
SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef _NATIVE_WAYLAND_GBM_BUFMGR_HELPER_H_
+#define _NATIVE_WAYLAND_GBM_BUFMGR_HELPER_H_
+
+#include "wayland-gbm.h"
+struct pipe_resource *
+egl_g3d_wl_gbm_common_wl_buffer_get_resource(struct native_display
*ndpy,
+                                             struct wl_buffer *buffer);
+
+#endif /* _NATIVE_WAYLAND_GBM_BUFMGR_HELPER_H_ */
diff --git a/src/gallium/state_trackers/egl/wayland/native_drm.c
b/src/gallium/state_trackers/egl/wayland/native_drm.c
index a692654..9c5f4c2 100644
--- a/src/gallium/state_trackers/egl/wayland/native_drm.c
+++ b/src/gallium/state_trackers/egl/wayland/native_drm.c
@@ -38,7 +38,7 @@
 #include "native_wayland.h"
 
 #include <wayland-client.h>
-#include "wayland-drm-client-protocol.h"
+#include "wayland-gbm-client-protocol.h"
 #include "wayland-egl-priv.h"
 
 #include "common/native_wayland_drm_bufmgr_helper.h"
-- 
1.7.5.4




More information about the wayland-devel mailing list