# include only conditionally ?
SUBDIRS += compiler
-## Optionally required by GBM, EGL
+## Optionally required by EGL
if HAVE_PLATFORM_WAYLAND
SUBDIRS += egl/wayland/wayland-drm
endif
#define MIN(x,y) (((x)<(y))?(x):(y))
-struct wl_drm {
- struct wl_display *display;
- struct wl_global *wl_drm_global;
-
- void *user_data;
- char *device_name;
- uint32_t flags;
-
- struct wayland_drm_callbacks callbacks;
-
- struct wl_buffer_interface buffer_interface;
-};
-
static void
destroy_buffer(struct wl_resource *resource)
{
wl_resource_post_event(resource, WL_DRM_CAPABILITIES, capabilities);
}
-struct wl_drm_buffer *
-wayland_drm_buffer_get(struct wl_drm *drm, struct wl_resource *resource)
-{
- if (resource == NULL)
- return NULL;
-
- if (wl_resource_instance_of(resource, &wl_buffer_interface,
- &drm->buffer_interface))
- return wl_resource_get_user_data(resource);
- else
- return NULL;
-}
-
struct wl_drm *
wayland_drm_init(struct wl_display *display, char *device_name,
const struct wayland_drm_callbacks *callbacks, void *user_data,
#include <wayland-server.h>
struct wl_display;
-struct wl_drm;
struct wl_resource;
+struct wl_drm_buffer;
+
+struct wayland_drm_callbacks {
+ int (*authenticate)(void *user_data, uint32_t id);
+
+ void (*reference_buffer)(void *user_data, uint32_t name, int fd,
+ struct wl_drm_buffer *buffer);
+
+ void (*release_buffer)(void *user_data, struct wl_drm_buffer *buffer);
+};
+
+
+struct wl_drm {
+ struct wl_display *display;
+ struct wl_global *wl_drm_global;
+
+ void *user_data;
+ char *device_name;
+ uint32_t flags;
+
+ struct wayland_drm_callbacks callbacks;
+
+ struct wl_buffer_interface buffer_interface;
+};
struct wl_drm_buffer {
struct wl_resource *resource;
void *driver_buffer;
};
-struct wayland_drm_callbacks {
- int (*authenticate)(void *user_data, uint32_t id);
-
- void (*reference_buffer)(void *user_data, uint32_t name, int fd,
- struct wl_drm_buffer *buffer);
-
- void (*release_buffer)(void *user_data, struct wl_drm_buffer *buffer);
-};
-
enum { WAYLAND_DRM_PRIME = 0x01 };
-struct wl_drm_buffer *
-wayland_drm_buffer_get(struct wl_drm *drm, struct wl_resource *resource);
+static inline struct wl_drm_buffer *
+wayland_drm_buffer_get(struct wl_drm *drm, struct wl_resource *resource)
+{
+ if (resource == NULL)
+ return NULL;
+
+ if (wl_resource_instance_of(resource, &wl_buffer_interface,
+ &drm->buffer_interface))
+ return wl_resource_get_user_data(resource);
+ else
+ return NULL;
+}
struct wl_drm *
wayland_drm_init(struct wl_display *display, char *device_name,
AM_CFLAGS += \
$(WAYLAND_SERVER_CFLAGS) \
-I$(top_srcdir)/src/egl/wayland/wayland-drm/
-libgbm_la_LIBADD += $(top_builddir)/src/egl/wayland/wayland-drm/libwayland-drm.la $(WAYLAND_SERVER_LIBS)
+libgbm_la_LIBADD += $(WAYLAND_SERVER_LIBS)
endif
if HAVE_DRI2
)
deps_gbm = []
args_gbm = []
-links_gbm = []
deps_gbm = []
incs_gbm = [
include_directories('main'), inc_include, inc_src, inc_loader,
endif
if with_platform_wayland
deps_gbm += dep_wayland_server
- links_gbm += libwayland_drm
incs_gbm += inc_wayland_drm
endif
include_directories : incs_gbm,
c_args : [c_vis_args, args_gbm],
link_args : [ld_args_gc_sections],
- link_with : [links_gbm, libloader, libmesa_util, libxmlconfig],
+ link_with : [libloader, libmesa_util, libxmlconfig],
dependencies : [deps_gbm, dep_dl],
version : '1.0.0',
install : true,