gbm: add XBGR8888 support for dumb buffers
authorRob Herring <robh@kernel.org>
Wed, 28 Jun 2017 21:52:29 +0000 (17:52 -0400)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 30 Jun 2017 07:44:19 +0000 (08:44 +0100)
Add GBM_FORMAT_XBGR8888 format support which is needed for Android.

Signed-off-by: Rob Herring <robh@kernel.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
src/gbm/backends/dri/gbm_dri.c

index 53e590855be4dadd48dd3570deecd8fbc97f8e22..ecb360773c3188b4b202c8a591d3c06f694c766f 100644 (file)
@@ -1058,7 +1058,7 @@ create_dumb(struct gbm_device *gbm,
    is_cursor = (usage & GBM_BO_USE_CURSOR) != 0 &&
       format == GBM_FORMAT_ARGB8888;
    is_scanout = (usage & GBM_BO_USE_SCANOUT) != 0 &&
-      format == GBM_FORMAT_XRGB8888;
+      (format == GBM_FORMAT_XRGB8888 || format == GBM_FORMAT_XBGR8888);
    if (!is_cursor && !is_scanout) {
       errno = EINVAL;
       return NULL;