2018-11-28 08:41:48 +00:00
|
|
|
From 7c21c1974c11ce6bf5901e7267104bde0ff00c15 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Oliver Smith <ollieparanoid@bitmessage.ch>
|
|
|
|
Date: Wed, 28 Nov 2018 08:19:16 +0100
|
|
|
|
Subject: [PATCH] compositor-fbdev: add support for ABGR
|
2017-07-17 18:11:23 +00:00
|
|
|
|
2018-11-28 08:41:48 +00:00
|
|
|
Thanks to Pablo Castellano for the original patch.
|
2017-07-17 18:11:23 +00:00
|
|
|
---
|
|
|
|
libweston/compositor-fbdev.c | 8 ++++++--
|
|
|
|
1 file changed, 6 insertions(+), 2 deletions(-)
|
|
|
|
|
|
|
|
diff --git a/libweston/compositor-fbdev.c b/libweston/compositor-fbdev.c
|
2018-11-28 08:41:48 +00:00
|
|
|
index a71b7bdc..44d15077 100644
|
2017-07-17 18:11:23 +00:00
|
|
|
--- a/libweston/compositor-fbdev.c
|
|
|
|
+++ b/libweston/compositor-fbdev.c
|
2018-11-28 08:41:48 +00:00
|
|
|
@@ -234,8 +234,8 @@ calculate_pixman_format(struct fb_var_screeninfo *vinfo,
|
|
|
|
vinfo->blue.msb_right != 0)
|
|
|
|
return 0;
|
|
|
|
|
2017-07-17 18:11:23 +00:00
|
|
|
- /* Work out the format type from the offsets. We only support RGBA and
|
|
|
|
- * ARGB at the moment. */
|
2018-11-28 08:41:48 +00:00
|
|
|
+ /* Work out the format type from the offsets. We only support RGBA, ARGB
|
|
|
|
+ * and ABGR at the moment. */
|
2017-07-17 18:11:23 +00:00
|
|
|
type = PIXMAN_TYPE_OTHER;
|
2018-11-28 08:41:48 +00:00
|
|
|
|
2017-07-17 18:11:23 +00:00
|
|
|
if ((vinfo->transp.offset >= vinfo->red.offset ||
|
2018-11-28 08:41:48 +00:00
|
|
|
@@ -247,6 +247,10 @@ calculate_pixman_format(struct fb_var_screeninfo *vinfo,
|
2017-07-17 18:11:23 +00:00
|
|
|
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;
|
2018-11-28 08:41:48 +00:00
|
|
|
|
2017-07-17 18:11:23 +00:00
|
|
|
if (type == PIXMAN_TYPE_OTHER)
|
|
|
|
return 0;
|
2018-11-28 08:41:48 +00:00
|
|
|
--
|
|
|
|
2.17.2
|
|
|
|
|