use wayland-gbm to create/destroy wl_buffer
[mesa-gbm:mesa.git] / src / egl / wayland / wayland-drm / wayland-drm.h
1 #ifndef WAYLAND_GBM_H
2 #define WAYLAND_GBM_H
3
4 #include <wayland-server.h>
5 #include "wayland-drm-server-protocol.h"
6
7 struct wl_gbm;
8
9 struct wl_gbm_callbacks {
10         int (*authenticate)(void *user_data, uint32_t id);
11
12         void *(*reference_buffer)(void *user_data, uint32_t name,
13                                   int32_t width, int32_t height,
14                                   uint32_t stride, uint32_t format);
15
16         void (*release_buffer)(void *user_data, void *buffer);
17 };
18
19 struct wl_gbm *
20 wl_gbm_init(struct wl_display *display, char *device_name, int fd, 
21                  struct wl_gbm_callbacks *callbacks, void *user_data);
22
23 void
24 wl_gbm_uninit(struct wl_gbm *gbm);
25
26 int
27 wayland_buffer_is_gbm(struct wl_buffer *buffer);
28
29 uint32_t
30 wl_gbm_buffer_get_format(struct wl_buffer *buffer_base);
31
32 void *
33 wl_gbm_buffer_get_buffer(struct wl_buffer *buffer);
34
35 #endif