gbm: add GBM_FORMAT_XBGR8888 format support
authorRob Herring <robh@kernel.org>
Tue, 19 Apr 2016 19:38:41 +0000 (14:38 -0500)
committerEmil Velikov <emil.l.velikov@gmail.com>
Thu, 21 Apr 2016 13:45:56 +0000 (14:45 +0100)
Add GBM_FORMAT_XBGR8888/__DRI_IMAGE_FORMAT_XBGR8888 format support which
is needed for Android.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/gbm/backends/dri/gbm_dri.c

index 57cdeacdccd1fae7be66f02558c64c7815697405..236f2ae979b64213d874ae1ee36269288edcbdd8 100644 (file)
@@ -535,6 +535,7 @@ gbm_dri_is_format_supported(struct gbm_device *gbm,
 {
    switch (format) {
    case GBM_BO_FORMAT_XRGB8888:
+   case GBM_FORMAT_XBGR8888:
    case GBM_FORMAT_XRGB8888:
       break;
    case GBM_BO_FORMAT_ARGB8888:
@@ -617,6 +618,9 @@ gbm_dri_to_gbm_format(uint32_t dri_format)
    case __DRI_IMAGE_FORMAT_ARGB8888:
       ret = GBM_FORMAT_ARGB8888;
       break;
+   case __DRI_IMAGE_FORMAT_XBGR8888:
+      ret = GBM_FORMAT_XBGR8888;
+      break;
    case __DRI_IMAGE_FORMAT_ABGR8888:
       ret = GBM_FORMAT_ABGR8888;
       break;
@@ -867,6 +871,9 @@ gbm_dri_bo_create(struct gbm_device *gbm,
    case GBM_FORMAT_ABGR8888:
       dri_format = __DRI_IMAGE_FORMAT_ABGR8888;
       break;
+   case GBM_FORMAT_XBGR8888:
+      dri_format = __DRI_IMAGE_FORMAT_XBGR8888;
+      break;
    case GBM_FORMAT_ARGB2101010:
       dri_format = __DRI_IMAGE_FORMAT_ARGB2101010;
       break;