aboutsummaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorChris Redpath <chris.redpath@arm.com>2012-06-29 13:10:35 +0100
committerJon Medhurst <tixy@linaro.org>2013-07-01 11:04:25 +0100
commit585617333b9f883182dd285b50710deab04d4e00 (patch)
tree1e3d79f0a437fcd6116040261fa105824903389a /drivers/video
parentf03c663576a50642f1e9f142627a86de61a6574e (diff)
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 <chris.redpath@arm.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/arm-hdlcd.c23
1 files changed, 19 insertions, 4 deletions
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)<alpha><red><green><blue>(lsb)
+ * but this does not match what android expects and
+ * the colors are odd. Instead, use
+ * <alpha><blue><green><red>
+ * 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;