From c08e91f7b31ea20a20177617ac5ccf19670c6b78 Mon Sep 17 00:00:00 2001 From: Sangwon Ha Date: Wed, 29 Apr 2015 14:24:38 +0900 Subject: [PATCH] Revert "Sync with codes from Mesa3D in Tizen Public" This reverts commit 0f65da9449c436b067ec8106acea36363c6612ef. Change-Id: I848c92fa62fc81002dabcac9e1d8f6e25f4c042a --- src/backend.c | 4 +--- src/gbm.c | 16 ++++++---------- src/gbm.h | 15 +++++---------- 3 files changed, 12 insertions(+), 23 deletions(-) diff --git a/src/backend.c b/src/backend.c index bf3f06b..a38b71f 100644 --- a/src/backend.c +++ b/src/backend.c @@ -36,15 +36,13 @@ #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 }, }; diff --git a/src/gbm.c b/src/gbm.c index cb24e92..6179e5b 100644 --- a/src/gbm.c +++ b/src/gbm.c @@ -36,7 +36,6 @@ #include #include #include -#include #include "gbm.h" #include "gbmint.h" @@ -110,7 +109,7 @@ _gbm_mesa_get_device(int fd) 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; } @@ -146,7 +145,7 @@ gbm_create_device(int fd) 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; } @@ -259,7 +258,7 @@ gbm_bo_get_fd(struct gbm_bo *bo) * \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) @@ -333,7 +332,7 @@ gbm_bo_destroy(struct gbm_bo *bo) * * \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 @@ -343,10 +342,8 @@ gbm_bo_create(struct gbm_device *gbm, 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)) @@ -376,8 +373,7 @@ gbm_bo_create(struct gbm_device *gbm, * \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 */ diff --git a/src/gbm.h b/src/gbm.h index 7b23c26..92d472a 100644 --- a/src/gbm.h +++ b/src/gbm.h @@ -192,13 +192,10 @@ enum gbm_bo_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 @@ -206,7 +203,8 @@ enum gbm_bo_flags { 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), }; @@ -287,9 +285,6 @@ gbm_surface_create(struct gbm_device *gbm, 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); -- 2.34.1