1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Mesa 3-D graphics library
3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Version:  7.11
4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright (C) 2011 Benjamin Franzke <benjaminfranzke@googlemail.com>
6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person obtaining a
8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * copy of this software and associated documentation files (the "Software"),
9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * to deal in the Software without restriction, including without limitation
10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * and/or sell copies of the Software, and to permit persons to whom the
12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Software is furnished to do so, subject to the following conditions:
13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice shall be included
15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * in all copies or substantial portions of the Software.
16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *
17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * DEALINGS IN THE SOFTWARE.
24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "util/u_memory.h"
27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "util/u_inlines.h"
28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_compiler.h"
30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_screen.h"
31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_context.h"
32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "pipe/p_state.h"
33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "sw/wayland/wayland_sw_winsys.h"
35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "egllog.h"
37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "native_wayland.h"
39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include <wayland-client.h>
41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "wayland-egl-priv.h"
42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include <sys/types.h>
44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include <sys/stat.h>
45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include <fcntl.h>
46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct wayland_shm_display {
48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct wayland_display base;
49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   const struct native_event_handler *event_handler;
51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct wl_shm *wl_shm;
52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic INLINE struct wayland_shm_display *
55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgwayland_shm_display(const struct native_display *ndpy)
56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{
57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   return (struct wayland_shm_display *) ndpy;
58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}
59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic void
62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgwayland_shm_display_destroy(struct native_display *ndpy)
63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{
64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct wayland_shm_display *shmdpy = wayland_shm_display(ndpy);
65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   if (shmdpy->base.configs)
67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      FREE(shmdpy->base.configs);
68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   if (shmdpy->base.own_dpy)
69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      wl_display_disconnect(shmdpy->base.dpy);
70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   ndpy_uninit(ndpy);
72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   FREE(shmdpy);
74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}
75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic struct wl_buffer *
77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgwayland_create_shm_buffer(struct wayland_display *display,
78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                          struct wayland_surface *surface,
79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                          enum native_attachment attachment)
80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{
81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct wayland_shm_display *shmdpy = (struct wayland_shm_display *) display;
82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct pipe_screen *screen = shmdpy->base.base.screen;
83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct pipe_resource *resource;
84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct winsys_handle wsh;
85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   uint width, height;
86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   enum wl_shm_format format;
87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct wl_buffer *buffer;
88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct wl_shm_pool *pool;
89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   resource = resource_surface_get_single_resource(surface->rsurf, attachment);
91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   resource_surface_get_size(surface->rsurf, &width, &height);
92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
93f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   screen->resource_get_handle(screen, resource, &wsh);
94f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
95f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   pipe_resource_reference(&resource, NULL);
96f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
97f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   switch (surface->color_format) {
98f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   case PIPE_FORMAT_B8G8R8A8_UNORM:
99f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      format = WL_SHM_FORMAT_ARGB8888;
100f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      break;
101f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   case PIPE_FORMAT_B8G8R8X8_UNORM:
102f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      format = WL_SHM_FORMAT_XRGB8888;
103f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      break;
104f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   default:
105f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      return NULL;
106f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      break;
107f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   }
108f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
109f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   pool = wl_shm_create_pool(shmdpy->wl_shm, wsh.fd, wsh.size);
110f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   buffer = wl_shm_pool_create_buffer(pool, 0, width, height,
111f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                                      wsh.stride, format);
112f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   wl_shm_pool_destroy(pool);
113f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
114f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   return buffer;
115f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}
116f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
117f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic void
118f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgshm_handle_format(void *data, struct wl_shm *shm, uint32_t format)
119f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{
120f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct wayland_shm_display *shmdpy = data;
121f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
122f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   switch (format) {
123f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   case WL_SHM_FORMAT_ARGB8888:
124f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      shmdpy->base.formats |= HAS_ARGB8888;
125f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      break;
126f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   case WL_SHM_FORMAT_XRGB8888:
127f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      shmdpy->base.formats |= HAS_XRGB8888;
128f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      break;
129f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   }
130f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}
131f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
132f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct wl_shm_listener shm_listener = {
133f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   shm_handle_format
134f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
135f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
136f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic void
137f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgregistry_handle_global(void *data, struct wl_registry *registry, uint32_t name,
138f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                       const char *interface, uint32_t version)
139f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{
140f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct wayland_shm_display *shmdpy = data;
141f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
142f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   if (strcmp(interface, "wl_shm") == 0) {
143f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      shmdpy->wl_shm = wl_registry_bind(registry, name, &wl_shm_interface, 1);
144f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      wl_shm_add_listener(shmdpy->wl_shm, &shm_listener, shmdpy);
145f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   }
146f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}
147f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
148f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic const struct wl_registry_listener registry_listener = {
149f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org       registry_handle_global
150f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
151f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
152f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstatic boolean
153f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgwayland_shm_display_init_screen(struct native_display *ndpy)
154f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{
155f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct wayland_shm_display *shmdpy = wayland_shm_display(ndpy);
156f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct sw_winsys *winsys = NULL;
157f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
158f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   shmdpy->base.queue = wl_display_create_queue(shmdpy->base.dpy);
159f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   shmdpy->base.registry = wl_display_get_registry(shmdpy->base.dpy);
160f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   wl_proxy_set_queue((struct wl_proxy *) shmdpy->base.registry,
161f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                      shmdpy->base.queue);
162f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   wl_registry_add_listener(shmdpy->base.registry, &registry_listener, shmdpy);
163f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   if (wayland_roundtrip(&shmdpy->base) < 0 || shmdpy->wl_shm == NULL)
164f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      return FALSE;
165f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
166f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   if (shmdpy->base.formats == 0)
167f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      wl_display_roundtrip(shmdpy->base.dpy);
168f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   if (shmdpy->base.formats == 0)
169f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      return FALSE;
170f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
171f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   winsys = wayland_create_sw_winsys(shmdpy->base.dpy);
172f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   if (!winsys)
173f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      return FALSE;
174f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
175f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   shmdpy->base.base.screen =
176f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      shmdpy->event_handler->new_sw_screen(&shmdpy->base.base, winsys);
177f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
178f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   if (!shmdpy->base.base.screen) {
179f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      _eglLog(_EGL_WARNING, "failed to create shm screen");
180f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      return FALSE;
181f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   }
182f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
183f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   return TRUE;
184f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}
185f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
186f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct wayland_display *
187f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgwayland_create_shm_display(struct wl_display *dpy,
188f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                           const struct native_event_handler *event_handler)
189f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org{
190f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct wayland_shm_display *shmdpy;
191f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
192f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   shmdpy = CALLOC_STRUCT(wayland_shm_display);
193f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   if (!shmdpy)
194f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      return NULL;
195f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
196f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   shmdpy->event_handler = event_handler;
197f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
198f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   shmdpy->base.dpy = dpy;
199f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   if (!shmdpy->base.dpy) {
200f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      wayland_shm_display_destroy(&shmdpy->base.base);
201f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      return NULL;
202f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   }
203f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
204f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   shmdpy->base.base.init_screen = wayland_shm_display_init_screen;
205f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   shmdpy->base.base.destroy = wayland_shm_display_destroy;
206f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   shmdpy->base.create_buffer = wayland_create_shm_buffer;
207f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
208f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   return &shmdpy->base;
209f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}
210f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
211f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* vim: set sw=3 ts=8 sts=3 expandtab: */
212