gbm: add missing R8 and GR88 formats
authorRob Clark <robdclark@gmail.com>
Sat, 3 Sep 2016 12:49:49 +0000 (08:49 -0400)
committerRob Clark <robdclark@gmail.com>
Wed, 7 Sep 2016 15:30:41 +0000 (11:30 -0400)
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
src/gbm/backends/dri/gbm_dri.c
src/gbm/main/gbm.h

index c3626e39c072587e6604c9a3a94b2e5148270c9a..9c3a51b2b9de8e0eda133f151eccb7b07d5e0418 100644 (file)
@@ -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:
index 293cae658d2ae95dc3dae92d8b31d9c45a9643c3..59daaa164d1be5bb27b0f6526fc8c395367c5b7b 100644 (file)
@@ -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 */