#define ARRAY_SIZE(a) (sizeof(a)/sizeof((a)[0]))
-extern const struct gbm_backend gbm_dri_backend;
-
struct backend_desc {
const char *name;
const struct gbm_backend *builtin;
};
static const struct backend_desc backends[] = {
- { "gbm_dri.so", &gbm_dri_backend },
+ { "gbm_dri.so", NULL },
{ "gbm_gallium_drm.so", NULL },
{ "gbm_tbm.so", NULL },
};
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
-#include <errno.h>
#include "gbm.h"
#include "gbmint.h"
int i;
if (fd < 0 || fstat(fd, &buf) < 0 || !S_ISCHR(buf.st_mode)) {
- errno = EINVAL;
+ fprintf(stderr, "_gbm_mesa_get_device: invalid fd: %d\n", fd);
return NULL;
}
struct stat buf;
if (fd < 0 || fstat(fd, &buf) < 0 || !S_ISCHR(buf.st_mode)) {
- errno = EINVAL;
+ fprintf(stderr, "gbm_create_device: invalid fd: %d\n", fd);
return NULL;
}
* \param bo The buffer object
* \param buf The data to write
* \param count The number of bytes to write
- * \return Returns 0 on success, otherwise -1 is returned an errno set
+ * \return Returns -1 on error, 0 otherwise
*/
GBM_EXPORT int
gbm_bo_write(struct gbm_bo *bo, const void *buf, size_t count)
*
* \return A newly allocated buffer that should be freed with gbm_bo_destroy()
* when no longer needed. If an error occurs during allocation %NULL will be
- * returned and errno set.
+ * returned.
*
* \sa enum gbm_bo_format for the list of formats
* \sa enum gbm_bo_flags for the list of usage flags
uint32_t width, uint32_t height,
uint32_t format, uint32_t usage)
{
- if (width == 0 || height == 0) {
- errno = EINVAL;
+ if (width == 0 || height == 0)
return NULL;
- }
if (usage & GBM_BO_USE_CURSOR_64X64 &&
(width != 64 || height != 64))
* \param usage The union of the usage flags for this buffer
*
* \return A newly allocated buffer object that should be freed with
- * gbm_bo_destroy() when no longer needed. On error, %NULL is returned
- * and errno is set.
+ * gbm_bo_destroy() when no longer needed.
*
* \sa enum gbm_bo_flags for the list of usage flags
*/
*/
GBM_BO_USE_SCANOUT = (1 << 0),
/**
- * Buffer is going to be used as cursor
+ * Buffer is going to be used as cursor - the dimensions for the buffer
+ * must be 64x64 if this flag is passed.
*/
- GBM_BO_USE_CURSOR = (1 << 1),
- /**
- * Deprecated
- */
- GBM_BO_USE_CURSOR_64X64 = GBM_BO_USE_CURSOR,
+ GBM_BO_USE_CURSOR_64X64 = (1 << 1),
/**
* Buffer is to be used for rendering - for example it is going to be used
* as the storage for a color buffer
GBM_BO_USE_RENDERING = (1 << 2),
/**
* Buffer can be used for gbm_bo_write. This is guaranteed to work
- * with GBM_BO_USE_CURSOR. but may not work for other combinations.
+ * with GBM_BO_USE_CURSOR_64X64. but may not work for other
+ * combinations.
*/
GBM_BO_USE_WRITE = (1 << 3),
};
uint32_t width, uint32_t height,
uint32_t format, uint32_t flags);
-int
-gbm_surface_needs_lock_front_buffer(struct gbm_surface *surface);
-
struct gbm_bo *
gbm_surface_lock_front_buffer(struct gbm_surface *surface);