From b4e88b500c93d9728d2a3e30f6b0365bcb224b88 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sat, 3 Sep 2016 08:49:49 -0400 Subject: [PATCH] gbm: add missing R8 and GR88 formats Reviewed-by: Eric Engestrom Signed-off-by: Rob Clark --- src/gbm/backends/dri/gbm_dri.c | 8 +++++++- src/gbm/main/gbm.h | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gbm/backends/dri/gbm_dri.c b/src/gbm/backends/dri/gbm_dri.c index c3626e3..9c3a51b 100644 --- a/src/gbm/backends/dri/gbm_dri.c +++ b/src/gbm/backends/dri/gbm_dri.c @@ -867,8 +867,14 @@ gbm_dri_bo_create(struct gbm_device *gbm, bo->base.base.format = format; switch (format) { + case GBM_FORMAT_R8: + dri_format = __DRI_IMAGE_FORMAT_R8; + break; + case GBM_FORMAT_GR88: + dri_format = __DRI_IMAGE_FORMAT_GR88; + break; case GBM_FORMAT_RGB565: - dri_format =__DRI_IMAGE_FORMAT_RGB565; + dri_format = __DRI_IMAGE_FORMAT_RGB565; break; case GBM_FORMAT_XRGB8888: case GBM_BO_FORMAT_XRGB8888: diff --git a/src/gbm/main/gbm.h b/src/gbm/main/gbm.h index 293cae6..59daaa1 100644 --- a/src/gbm/main/gbm.h +++ b/src/gbm/main/gbm.h @@ -85,6 +85,12 @@ enum gbm_bo_format { /* color index */ #define GBM_FORMAT_C8 __gbm_fourcc_code('C', '8', ' ', ' ') /* [7:0] C */ +/* 8 bpp Red */ +#define GBM_FORMAT_R8 __gbm_fourcc_code('R', '8', ' ', ' ') /* [7:0] R */ + +/* 16 bpp RG */ +#define GBM_FORMAT_GR88 __gbm_fourcc_code('G', 'R', '8', '8') /* [15:0] G:R 8:8 little endian */ + /* 8 bpp RGB */ #define GBM_FORMAT_RGB332 __gbm_fourcc_code('R', 'G', 'B', '8') /* [7:0] R:G:B 3:3:2 */ #define GBM_FORMAT_BGR233 __gbm_fourcc_code('B', 'G', 'R', '8') /* [7:0] B:G:R 2:3:3 */ -- 2.7.4