diff options
author | Chris Redpath <chris.redpath@arm.com> | 2012-06-29 13:10:35 +0100 |
---|---|---|
committer | Alex Shi <alex.shi@linaro.org> | 2014-07-16 09:52:21 +0800 |
commit | c77e100714b7563156af3bc2f7db45ea6c876d7a (patch) | |
tree | 003b4bd671ad9b21afec1408af0f9e7788cc98b7 /drivers/video | |
parent | fa8b1b9aa3558231c489199779fb9f6c01844036 (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>
(cherry picked from commit a1cbc88b7203e2f554e516eb94401afd6d5aab1d)
Signed-off-by: Alex Shi <alex.shi@linaro.org>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/arm-hdlcd.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/drivers/video/arm-hdlcd.c b/drivers/video/arm-hdlcd.c index 526d771db991..9b5b21ab136f 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; |