linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/10] ARM: versatile: support CLCD RGB565 layout with blue LSB
Date: Thu, 27 Jan 2011 12:58:10 +0000	[thread overview]
Message-ID: <E1PiRQQ-0003ma-4F@rmk-PC.arm.linux.org.uk> (raw)
In-Reply-To: <20110127125714.GD25968@n2100.arm.linux.org.uk>

RGB565 with blue in the LSB wasn't supported.  Add support for this
layout.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
---
 arch/arm/mach-versatile/core.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/arch/arm/mach-versatile/core.c b/arch/arm/mach-versatile/core.c
index 136c32e..2866c11 100644
--- a/arch/arm/mach-versatile/core.c
+++ b/arch/arm/mach-versatile/core.c
@@ -630,18 +630,22 @@ static void versatile_clcd_disable(struct clcd_fb *fb)
  */
 static void versatile_clcd_enable(struct clcd_fb *fb)
 {
+	struct fb_var_screeninfo *var = &fb->fb.var;
 	void __iomem *sys_clcd = __io_address(VERSATILE_SYS_BASE) + VERSATILE_SYS_CLCD_OFFSET;
 	u32 val;
 
 	val = readl(sys_clcd);
 	val &= ~SYS_CLCD_MODE_MASK;
 
-	switch (fb->fb.var.green.length) {
+	switch (var->green.length) {
 	case 5:
 		val |= SYS_CLCD_MODE_5551;
 		break;
 	case 6:
-		val |= SYS_CLCD_MODE_565_RLSB;
+		if (var->red.offset == 0)
+			val |= SYS_CLCD_MODE_565_RLSB;
+		else
+			val |= SYS_CLCD_MODE_565_BLSB;
 		break;
 	case 8:
 		val |= SYS_CLCD_MODE_888;
@@ -709,10 +713,19 @@ static void versatile_clcd_remove(struct clcd_fb *fb)
 			      fb->fb.screen_base, fb->fb.fix.smem_start);
 }
 
+static void versatile_clcd_decode(struct clcd_fb *fb, struct clcd_regs *regs)
+{
+	clcdfb_decode(fb, regs);
+
+	/* Always clear BGR for RGB565: we do the routing externally */
+	if (fb->fb.var.green.length == 6)
+		regs->cntl &= ~CNTL_BGR;
+}
+
 static struct clcd_board clcd_plat_data = {
 	.name		= "Versatile",
 	.check		= clcdfb_check,
-	.decode		= clcdfb_decode,
+	.decode		= versatile_clcd_decode,
 	.disable	= versatile_clcd_disable,
 	.enable		= versatile_clcd_enable,
 	.setup		= versatile_clcd_setup,
-- 
1.6.2.5

  reply	other threads:[~2011-01-27 12:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-27 12:57 [PATCH 00/10] Fix CLCD framebuffer formats and consolidate ARM platform CLCD support Russell King - ARM Linux
2011-01-27 12:58 ` Russell King - ARM Linux [this message]
2011-01-27 12:58 ` [PATCH 02/10] ARM: integrator: support CLCD RGB5551 layout for 16bpp Russell King - ARM Linux
2011-01-27 12:58 ` [PATCH 03/10] ARM: clcd: clean up CLCD announcement printks Russell King - ARM Linux
2011-01-27 12:59 ` [PATCH 04/10] ARM: clcd: use amba_part() to determine if we have a PL110 primecell Russell King - ARM Linux
2011-01-27 12:59 ` [PATCH 05/10] ARM: clcd: add method for describing display capabilities Russell King - ARM Linux
2011-01-27 12:59 ` [PATCH 06/10] ARM: add versatile family consolidated CLCD support Russell King - ARM Linux
2011-01-27 13:00 ` [PATCH 07/10] ARM: integrator: switch Integrator platforms to use consolidated CLCD Russell King - ARM Linux
2011-01-27 13:00 ` [PATCH 08/10] ARM: versatile: switch Versatile " Russell King - ARM Linux
2011-01-27 13:00 ` [PATCH 09/10] ARM: realview: switch Realview " Russell King - ARM Linux
2011-01-27 13:01 ` [PATCH 10/10] ARM: vexpress: switch Versatile Express " Russell King - ARM Linux
2011-02-17 23:37 ` [PATCH 00/10] Fix CLCD framebuffer formats and consolidate ARM platform CLCD support Russell King - ARM Linux
2011-02-18 11:15 ` Catalin Marinas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E1PiRQQ-0003ma-4F@rmk-PC.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).