From 5f066c3321acb244aaa249100bb6c07b986ad7d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Tue, 3 Jun 2014 16:45:23 +0900 Subject: [PATCH] gbm: Remove 64x64 restriction from GBM_BO_USE_CURSOR MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GBM_BO_USE_CURSOR_64X64 is kept so that existing users of GBM continue to build, but it no longer rejects widths or heights other than 64. Reviewed-by: Alex Deucher Signed-off-by: Michel Dänzer --- src/gallium/state_trackers/gbm/gbm_drm.c | 2 +- src/gbm/backends/dri/gbm_dri.c | 8 ++++---- src/gbm/main/gbm.c | 6 ------ src/gbm/main/gbm.h | 12 +++++++----- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/gallium/state_trackers/gbm/gbm_drm.c b/src/gallium/state_trackers/gbm/gbm_drm.c index 725f12f..fa84276 100644 --- a/src/gallium/state_trackers/gbm/gbm_drm.c +++ b/src/gallium/state_trackers/gbm/gbm_drm.c @@ -66,7 +66,7 @@ gbm_usage_to_gallium(uint usage) if (usage & GBM_BO_USE_RENDERING) resource_usage |= PIPE_BIND_RENDER_TARGET | PIPE_BIND_SAMPLER_VIEW; - if (usage & GBM_BO_USE_CURSOR_64X64) + if (usage & GBM_BO_USE_CURSOR) resource_usage |= PIPE_BIND_CURSOR; return resource_usage; diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index cec12d1..347bc99 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -346,7 +346,7 @@ gbm_dri_is_format_supported(struct gbm_device *gbm, return 0; } - if (usage & GBM_BO_USE_CURSOR_64X64 && + if (usage & GBM_BO_USE_CURSOR && usage & GBM_BO_USE_RENDERING) return 0; @@ -532,7 +532,7 @@ gbm_dri_bo_import(struct gbm_device *gbm, if (usage & GBM_BO_USE_SCANOUT) dri_use |= __DRI_IMAGE_USE_SCANOUT; - if (usage & GBM_BO_USE_CURSOR_64X64) + if (usage & GBM_BO_USE_CURSOR) dri_use |= __DRI_IMAGE_USE_CURSOR; if (dri->image->base.version >= 2 && !dri->image->validateUsage(bo->image, dri_use)) { @@ -568,7 +568,7 @@ create_dumb(struct gbm_device *gbm, struct drm_mode_destroy_dumb destroy_arg; int ret; - if (!(usage & GBM_BO_USE_CURSOR_64X64)) { + if (!(usage & GBM_BO_USE_CURSOR)) { errno = EINVAL; return NULL; } @@ -672,7 +672,7 @@ gbm_dri_bo_create(struct gbm_device *gbm, if (usage & GBM_BO_USE_SCANOUT) dri_use |= __DRI_IMAGE_USE_SCANOUT; - if (usage & GBM_BO_USE_CURSOR_64X64) + if (usage & GBM_BO_USE_CURSOR) dri_use |= __DRI_IMAGE_USE_CURSOR; /* Gallium drivers requires shared in order to get the handle/stride */ diff --git a/src/gbm/main/gbm.c b/src/gbm/main/gbm.c index 907ca3c..c39cbfa 100644 --- a/src/gbm/main/gbm.c +++ b/src/gbm/main/gbm.c @@ -348,12 +348,6 @@ gbm_bo_create(struct gbm_device *gbm, return NULL; } - if (usage & GBM_BO_USE_CURSOR_64X64 && - (width != 64 || height != 64)) { - errno = EINVAL; - return NULL; - } - return gbm->bo_create(gbm, width, height, format, usage); } diff --git a/src/gbm/main/gbm.h b/src/gbm/main/gbm.h index 92d472a..374cef8 100644 --- a/src/gbm/main/gbm.h +++ b/src/gbm/main/gbm.h @@ -192,10 +192,13 @@ enum gbm_bo_flags { */ GBM_BO_USE_SCANOUT = (1 << 0), /** - * Buffer is going to be used as cursor - the dimensions for the buffer - * must be 64x64 if this flag is passed. + * Buffer is going to be used as cursor */ - GBM_BO_USE_CURSOR_64X64 = (1 << 1), + GBM_BO_USE_CURSOR = (1 << 1), + /** + * Deprecated + */ + GBM_BO_USE_CURSOR_64X64 = GBM_BO_USE_CURSOR, /** * Buffer is to be used for rendering - for example it is going to be used * as the storage for a color buffer @@ -203,8 +206,7 @@ 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_64X64. but may not work for other - * combinations. + * with GBM_BO_USE_CURSOR. but may not work for other combinations. */ GBM_BO_USE_WRITE = (1 << 3), }; -- 2.0.0