compositor-fbdev: Add support for ABGR in calculate_pixman_format

Submitted by Pablo Castellano on July 18, 2017, 10:06 p.m.

Details

Message ID 1500415598-4858-1-git-send-email-pablo@anche.no
State New
Headers show
Series "compositor-fbdev: Add support for ABGR in calculate_pixman_format" ( rev: 1 ) in Wayland

Not browsing as part of any series.

Commit Message

Pablo Castellano July 18, 2017, 10:06 p.m.
In PostmarketOS we have added support for the Asus grouper device
(Google Nexus 7 2012 tablet), which uses ABGR.

This mode seems to be less common and previously it was not correctly
handled by calculate_pixman_format()

For more information, see:
https://github.com/postmarketOS/pmbootstrap/wiki/asus-grouper-%28Google-Nexus-7-2012%29

Signed-off-by: Pablo Castellano <pablo@anche.no>
---
 libweston/compositor-fbdev.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/libweston/compositor-fbdev.c b/libweston/compositor-fbdev.c
index e80a504..37c8005 100644
--- a/libweston/compositor-fbdev.c
+++ b/libweston/compositor-fbdev.c
@@ -211,8 +211,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 ||
@@ -224,6 +224,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;

Comments

On Wed, 19 Jul 2017 00:06:38 +0200
Pablo Castellano <pablo@anche.no> wrote:

> In PostmarketOS we have added support for the Asus grouper device
> (Google Nexus 7 2012 tablet), which uses ABGR.
> 
> This mode seems to be less common and previously it was not correctly
> handled by calculate_pixman_format()
> 
> For more information, see:
> https://github.com/postmarketOS/pmbootstrap/wiki/asus-grouper-%28Google-Nexus-7-2012%29
> 
> Signed-off-by: Pablo Castellano <pablo@anche.no>

Hi,

the web page mentions Tegra. Is there really no way to get DRM drivers
on that device?


Thanks,
pq

> ---
>  libweston/compositor-fbdev.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/libweston/compositor-fbdev.c b/libweston/compositor-fbdev.c
> index e80a504..37c8005 100644
> --- a/libweston/compositor-fbdev.c
> +++ b/libweston/compositor-fbdev.c
> @@ -211,8 +211,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 ||
> @@ -224,6 +224,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;