summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Castellano <pablo@anche.no>2018-11-28 08:45:46 +0100
committerPekka Paalanen <pq@iki.fi>2018-12-20 07:58:20 +0000
commitf0ba93c1945be5dda160be1bc81c41255282a101 (patch)
tree61a2f936f506666c81fdc50a9e1035eaedc49147
parentb10066842680c996f45295b3b1130e7b08735a7f (diff)
compositor-fbdev: add support for ABGR
Make fbdev work with some Android downstream kernels, like the asus-grouper (Google Nexus 7 2012). Signed-off-by: Oliver Smith <ollieparanoid@bitmessage.ch>
-rw-r--r--libweston/compositor-fbdev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libweston/compositor-fbdev.c b/libweston/compositor-fbdev.c
index a71b7bdc..44d15077 100644
--- a/libweston/compositor-fbdev.c
+++ b/libweston/compositor-fbdev.c
@@ -234,8 +234,8 @@ calculate_pixman_format(struct fb_var_screeninfo *vinfo,
vinfo->blue.msb_right != 0)
return 0;
- /* Work out the format type from the offsets. We only support RGBA and
- * ARGB at the moment. */
+ /* Work out the format type from the offsets. We only support RGBA, ARGB
+ * and ABGR at the moment. */
type = PIXMAN_TYPE_OTHER;
if ((vinfo->transp.offset >= vinfo->red.offset ||
@@ -247,6 +247,10 @@ calculate_pixman_format(struct fb_var_screeninfo *vinfo,
vinfo->green.offset >= vinfo->blue.offset &&
vinfo->blue.offset >= vinfo->transp.offset)
type = PIXMAN_TYPE_RGBA;
+ else if (vinfo->transp.offset >= vinfo->blue.offset &&
+ vinfo->blue.offset >= vinfo->green.offset &&
+ vinfo->green.offset >= vinfo->red.offset)
+ type = PIXMAN_TYPE_ABGR;
if (type == PIXMAN_TYPE_OTHER)
return 0;