From 0b4ffbc25d71c88023ec2c7005c17d7252fcf97c Mon Sep 17 00:00:00 2001 From: Sangjin Lee Date: Wed, 16 Dec 2015 16:38:03 +0900 Subject: [PATCH] support old GBM_BO_FORMAT_XXX Change-Id: Ib291aa3fcfda62959dc70c79501727c6c9949bd0 Signed-off-by: Sangjin Lee --- src/gbm.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/src/gbm.c b/src/gbm.c index e1cd2d5..b6d207c 100644 --- a/src/gbm.c +++ b/src/gbm.c @@ -83,6 +83,16 @@ GBM_EXPORT int gbm_device_is_format_supported(struct gbm_device *gbm, uint32_t format, uint32_t usage) { + switch (format) + { + case GBM_BO_FORMAT_XRGB8888: + format = GBM_FORMAT_XRGB8888; + break; + case GBM_BO_FORMAT_ARGB8888: + format = GBM_FORMAT_ABGR8888; + break; + } + return gbm->is_format_supported(gbm, format, usage); } @@ -321,6 +331,16 @@ gbm_bo_create(struct gbm_device *gbm, (width != 64 || height != 64)) return NULL; + switch (format) + { + case GBM_BO_FORMAT_XRGB8888: + format = GBM_FORMAT_XRGB8888; + break; + case GBM_BO_FORMAT_ARGB8888: + format = GBM_FORMAT_ABGR8888; + break; + } + return gbm->bo_create(gbm, width, height, format, usage); } @@ -375,6 +395,16 @@ gbm_surface_create(struct gbm_device *gbm, uint32_t width, uint32_t height, uint32_t format, uint32_t flags) { + switch (format) + { + case GBM_BO_FORMAT_XRGB8888: + format = GBM_FORMAT_XRGB8888; + break; + case GBM_BO_FORMAT_ARGB8888: + format = GBM_FORMAT_ABGR8888; + break; + } + return gbm->surface_create(gbm, width, height, format, flags); } -- 2.7.4