Commit 621715c4 authored by Jason Ekstrand's avatar Jason Ekstrand Committed by chadversary

gbm: Allow for optional libgbm symbols

While we're here, we widen the table because the function name we're
about to add is longer than any of the others.
Reviewed-by: chadversary's avatarChad Versace <chad@kiwitree.net>
parent 3585a41b
......@@ -100,9 +100,9 @@ wgbm_platform_init(struct wgbm_platform *self)
goto error;
}
#define RETRIEVE_GBM_SYMBOL(type, function, args) \
#define RETRIEVE_GBM_SYMBOL(type, function, required, args) \
self->function = dlsym(self->gbmHandle, #function); \
if (!self->function) { \
if (required && !self->function) { \
wcore_errorf(WAFFLE_ERROR_FATAL, \
"dlsym(\"%s\", \"" #function "\") failed: %s", \
libgbm_filename, dlerror()); \
......
......@@ -35,13 +35,13 @@
#include "wcore_util.h"
#define GBM_FUNCTIONS(f) \
f(struct gbm_device * , gbm_create_device , (int fd)) \
f(int , gbm_device_get_fd , (struct gbm_device *dev)) \
f(void , gbm_device_destroy , (struct gbm_device *gbm)) \
f(struct gbm_surface *, gbm_surface_create , (struct gbm_device *gbm, uint32_t width, uint32_t height, uint32_t format, uint32_t flags)) \
f(void , gbm_surface_destroy , (struct gbm_surface *surface)) \
f(struct gbm_bo * , gbm_surface_lock_front_buffer, (struct gbm_surface *surface)) \
f(void , gbm_surface_release_buffer , (struct gbm_surface *surface, struct gbm_bo *bo))
f(struct gbm_device * , gbm_create_device , true, (int fd)) \
f(int , gbm_device_get_fd , true, (struct gbm_device *dev)) \
f(void , gbm_device_destroy , true, (struct gbm_device *gbm)) \
f(struct gbm_surface *, gbm_surface_create , true, (struct gbm_device *gbm, uint32_t width, uint32_t height, uint32_t format, uint32_t flags)) \
f(void , gbm_surface_destroy , true, (struct gbm_surface *surface)) \
f(struct gbm_bo * , gbm_surface_lock_front_buffer , true, (struct gbm_surface *surface)) \
f(void , gbm_surface_release_buffer , true, (struct gbm_surface *surface, struct gbm_bo *bo))
struct linux_platform;
......@@ -52,7 +52,7 @@ struct wgbm_platform {
// GBM function pointers
void *gbmHandle;
#define DECLARE(type, function, args) type (*function) args;
#define DECLARE(type, function, required, args) type (*function) args;
GBM_FUNCTIONS(DECLARE)
#undef DECLARE
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment