From 585617333b9f883182dd285b50710deab04d4e00 Mon Sep 17 00:00:00 2001 From: Chris Redpath Date: Fri, 29 Jun 2012 13:10:35 +0100 Subject: ARM HDLCD: Change default byte ordering to match Android assumption Change color byte location in 32-bit word from argb to abgr to match the assumption made in Android when 32-bit color displays are used. Signed-off-by: Chris Redpath --- drivers/video/arm-hdlcd.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) (limited to 'drivers/video') diff --git a/drivers/video/arm-hdlcd.c b/drivers/video/arm-hdlcd.c index 526d771db99..9b5b21ab136 100644 --- a/drivers/video/arm-hdlcd.c +++ b/drivers/video/arm-hdlcd.c @@ -116,10 +116,25 @@ static int hdlcd_set_bitfields(struct hdlcd_device *hdlcd, } if (!ret) { - var->green.offset = var->blue.length; - var->red.offset = var->green.offset + var->green.length; - if (var->bits_per_pixel == 32) - var->transp.offset = var->red.offset + var->red.length; + if(var->bits_per_pixel != 32) + { + var->green.offset = var->blue.length; + var->red.offset = var->green.offset + var->green.length; + } + else + { + /* Previously, the byte ordering for 32-bit color was + * (msb)(lsb) + * but this does not match what android expects and + * the colors are odd. Instead, use + * + * Since we tell fb what we are doing, console + * , X and directfb access should work fine. + */ + var->green.offset = var->red.length; + var->blue.offset = var->green.offset + var->green.length; + var->transp.offset = var->blue.offset + var->blue.length; + } } return ret; -- cgit v1.2.3