Skip to contentSkip to conversation

Fix CLCD framebuffer formats and consolidate ARM platform CLCD support

PATCH New Russell King - ARM Linux 2 participants 13 messages Jan 27, 2011 – Feb 18, 2011

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Fix CLCD framebuffer formats and consolidate ARM platform CLCD support

This patch series fixes the framebuffer formatting for the various CLCD colour modes - including those which the CLCD doesn't actually support.

PL110 in TFT mode only supports 888 and 5551 connectivity. Some ARM platforms have additional muxing on their outputs which rewire this to allow the 5551 output to be used in 565 mode:

FBMEM bit (RGB) 5551 565
0 R0 R0
1 R1 R1
2 R2 R2
3 R3 R3
4 R4 R4
5 G0 G0
6 G1 G1
7 G2 G2
8 G3 G3
9 G4 G4
10 B0 G5
11 B1 B0
12 B2 B1
13 B3 B2
14 B4 B3
15 I B4

This means that when BGR mode is selected, it in green mapping to bits 0, 9, 8, 7, 6, 5 in the framebuffer, which is not sane. There appears to be no external MUX selection for this format.

PL111 on the other hand supports 888, 5551, 565 and 444 natively, so it can support RGB and BGR pixel formats directly.

Introduce a set of capabilities one bit for each format (RGB888, BGR888, RGB5551, BGR5551 etc) describing what formats the panel itself can support, and also what the board can support. These are combined, and from that we select the appropriate 16bpp pixel format which the panel and board can support. Where a panel and board combination supports multiple 16bpp formats, pick the closest format to the requested format.

Implementations which do not supply the capabilities fall back to the old way of doing things, which is based on the cntl register to indicate whether we should be using RGB or BGR mode.

This then allows us to unify the CLCD support across Integrator, Versatile, Realview and Versatile Express. This has been successfully tested on:

Integrator/CP - RGB565, RGB5551, BGR5551.
Versatile PB926 - RGB565, BGR565, RGB5551, BGR5551.
Realview EB ARM11MPcore - RGB565, BGR565, RGB5551, BGR5551, RGB444, BGR444.

#1 lore raw

PATCH 1/10 ARM: versatile: support CLCD RGB565 layout with blue LSB

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

---
 arch/arm/mach-versatile/core.c |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)
arch/arm/mach-versatile/core.c +16 -3
index 136c32e..2866c11 100644
@@ -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,
Signature · 1 line
1.6.2.5
#2 lore raw

PATCH 2/10 ARM: integrator: support CLCD RGB5551 layout for 16bpp

In reply to Russell King - ARM Linux

When the CLCD is in anything but RGB888 mode, its outputs are configured for RGB5551 output. Integrator/CP supports RGB565 via an external multiplexer, which we configure for RGB5551 or RGB565 based only on the bits per pixel. So when userspace asks for the RGB555 layout, the mux remains in RGB565 mode, and we produce incorrect colours. Fix this.

Note that Integrator doesn't support BGR565 mode, but does support BGR5551.

---
 arch/arm/mach-integrator/include/mach/cm.h |    4 ++--
 arch/arm/mach-integrator/integrator_cp.c   |   14 ++++++++------
 2 files changed, 10 insertions(+), 8 deletions(-)
arch/arm/mach-integrator/include/mach/cm.h +2 -2
index 1ab353e..445d57a 100644
@@ -24,9 +24,9 @@ void cm_control(u32, u32);
 #define CM_CTRL_LCDBIASDN		(1 << 10)
 #define CM_CTRL_LCDMUXSEL_MASK		(7 << 11)
 #define CM_CTRL_LCDMUXSEL_GENLCD	(1 << 11)
-#define CM_CTRL_LCDMUXSEL_VGA_16BPP	(2 << 11)
+#define CM_CTRL_LCDMUXSEL_VGA565_TFT555	(2 << 11)
 #define CM_CTRL_LCDMUXSEL_SHARPLCD	(3 << 11)
-#define CM_CTRL_LCDMUXSEL_VGA_8421BPP	(4 << 11)
+#define CM_CTRL_LCDMUXSEL_VGA555_TFT555	(4 << 11)
 #define CM_CTRL_LCDEN0			(1 << 14)
 #define CM_CTRL_LCDEN1			(1 << 15)
 #define CM_CTRL_STATIC1			(1 << 16)
arch/arm/mach-integrator/integrator_cp.c +8 -6
index e9327da..8600902 100644
@@ -478,14 +478,16 @@ static struct clcd_panel vga = {
  */
 static void cp_clcd_enable(struct clcd_fb *fb)
 {
-	u32 val;
+	struct fb_var_screeninfo *var = &fb->fb.var;
+	u32 val = CM_CTRL_STATIC1 | CM_CTRL_STATIC2;
 
-	if (fb->fb.var.bits_per_pixel <= 8)
-		val = CM_CTRL_LCDMUXSEL_VGA_8421BPP;
+	if (var->bits_per_pixel <= 8 ||
+	    (var->bits_per_pixel == 16 && var->green.length == 5))
+		/* Pseudocolor, RGB555, BGR555 */
+		val |= CM_CTRL_LCDMUXSEL_VGA555_TFT555;
 	else if (fb->fb.var.bits_per_pixel <= 16)
-		val = CM_CTRL_LCDMUXSEL_VGA_16BPP
-			| CM_CTRL_LCDEN0 | CM_CTRL_LCDEN1
-			| CM_CTRL_STATIC1 | CM_CTRL_STATIC2;
+		/* truecolor RGB565 */
+		val |= CM_CTRL_LCDMUXSEL_VGA565_TFT555;
 	else
 		val = 0; /* no idea for this, don't trust the docs */
 
Signature · 1 line
1.6.2.5
#3 lore raw

PATCH 3/10 ARM: clcd: clean up CLCD announcement printks

In reply to Russell King - ARM Linux

Make the CLCD announcement printk say which primecell part number has been found. Display the revision as an unsigned decimal, and display only the first 8 hex digits of the base address unless it's larger.

---
 drivers/video/amba-clcd.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
drivers/video/amba-clcd.c +6 -2
index 1c2c683..aedbb34 100644
@@ -443,8 +443,8 @@ static int clcdfb_register(struct clcd_fb *fb)
 
 	fb_set_var(&fb->fb, &fb->fb.var);
 
-        printk(KERN_INFO "CLCD: %s hardware, %s display\n",
-               fb->board->name, fb->panel->mode.name);
+	dev_info(&fb->dev->dev, "%s hardware, %s display\n",
+	         fb->board->name, fb->panel->mode.name);
 
 	ret = register_framebuffer(&fb->fb);
 	if (ret == 0)
@@ -486,6 +486,10 @@ static int clcdfb_probe(struct amba_device *dev, struct amba_id *id)
 	fb->dev = dev;
 	fb->board = board;
 
+	dev_info(&fb->dev->dev, "PL%03x rev%u at 0x%08llx\n",
+		amba_part(dev), amba_rev(dev),
+		(unsigned long long)dev->res.start);
+
 	ret = fb->board->setup(fb);
 	if (ret)
 		goto free_fb;
Signature · 1 line
1.6.2.5
#4 lore raw

PATCH 4/10 ARM: clcd: use amba_part() to determine if we have a PL110 primecell

In reply to Russell King - ARM Linux

Instead of matching the entire peripheral ID, match against just the part number using the amba_xxx() macros.

---
 include/linux/amba/clcd.h |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
include/linux/amba/clcd.h +5 -5
index be33b3a..2e51121 100644
@@ -212,12 +212,12 @@ static inline void clcdfb_decode(struct clcd_fb *fb, struct clcd_regs *regs)
 		break;
 	case 16:
 		/*
-		 * PL110 cannot choose between 5551 and 565 modes in
-		 * its control register
+		 * PL110 cannot choose between 5551 and 565 modes in its
+		 * control register.  It is possible to use 565 with
+		 * custom external wiring.
 		 */
-		if ((fb->dev->periphid & 0x000fffff) == 0x00041110)
-			val |= CNTL_LCDBPP16;
-		else if (fb->fb.var.green.length == 5)
+		if (amba_part(fb->dev) == 0x110 ||
+		    fb->fb.var.green.length == 5)
 			val |= CNTL_LCDBPP16;
 		else
 			val |= CNTL_LCDBPP16_565;
Signature · 1 line
1.6.2.5
#5 lore raw

PATCH 5/10 ARM: clcd: add method for describing display capabilities

In reply to Russell King - ARM Linux

The ARM CLCD PL110 controller in TFT mode provides two output formats based on whether the controller is in 24bpp mode or not - either 5551 or 888. PL111 augments this with a 444 and 565 modes.

Some implementations provide an external MUX on the PL110 output to reassign the bits to achieve 565 mode.

Provide a system of capability flags to allow the CLCD driver to work out what is supported by each panel and board, and therefore which display formats are permitted.

---
 drivers/video/amba-clcd.c |   95 +++++++++++++++++++++++++++++++++++++++-----
 include/linux/amba/clcd.h |   82 ++++++++++++++++++++++++++++++--------
 2 files changed, 149 insertions(+), 28 deletions(-)
drivers/video/amba-clcd.c +84 -11
index aedbb34..8bd3706 100644
@@ -120,8 +120,23 @@ static void clcdfb_enable(struct clcd_fb *fb, u32 cntl)
 static int
 clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var)
 {
+	u32 caps;
 	int ret = 0;
 
+	if (fb->panel->caps && fb->board->caps)
+		caps = fb->panel->caps & fb->board->caps;
+	else {
+		/* Old way of specifying what can be used */
+		caps = fb->panel->cntl & CNTL_BGR ?
+			CLCD_CAP_BGR : CLCD_CAP_RGB;
+		/* But mask out 444 modes as they weren't supported */
+		caps &= ~CLCD_CAP_444;
+	}
+
+	/* Only TFT panels can do RGB888/BGR888 */
+	if (!(fb->panel->cntl & CNTL_LCDTFT))
+		caps &= ~CLCD_CAP_888;
+
 	memset(&var->transp, 0, sizeof(var->transp));
 
 	var->red.msb_right = 0;
@@ -133,6 +148,13 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var)
 	case 2:
 	case 4:
 	case 8:
+		/* If we can't do 5551, reject */
+		caps &= CLCD_CAP_5551;
+		if (!caps) {
+			ret = -EINVAL;
+			break;
+		}
+
 		var->red.length		= var->bits_per_pixel;
 		var->red.offset		= 0;
 		var->green.length	= var->bits_per_pixel;
@@ -140,23 +162,61 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var)
 		var->blue.length	= var->bits_per_pixel;
 		var->blue.offset	= 0;
 		break;
+
 	case 16:
-		var->red.length = 5;
-		var->blue.length = 5;
+		/* If we can't do 444, 5551 or 565, reject */
+		if (!(caps & (CLCD_CAP_444 | CLCD_CAP_5551 | CLCD_CAP_565))) {
+			ret = -EINVAL;
+			break;
+		}
+
 		/*
-		 * Green length can be 5 or 6 depending whether
-		 * we're operating in RGB555 or RGB565 mode.
+		 * Green length can be 4, 5 or 6 depending whether
+		 * we're operating in 444, 5551 or 565 mode.
 		 */
-		if (var->green.length != 5 && var->green.length != 6)
-			var->green.length = 6;
+		if (var->green.length == 4 && caps & CLCD_CAP_444)
+			caps &= CLCD_CAP_444;
+		if (var->green.length == 5 && caps & CLCD_CAP_5551)
+			caps &= CLCD_CAP_5551;
+		else if (var->green.length == 6 && caps & CLCD_CAP_565)
+			caps &= CLCD_CAP_565;
+		else {
+			/*
+			 * PL110 officially only supports RGB555,
+			 * but may be wired up to allow RGB565.
+			 */
+			if (caps & CLCD_CAP_565) {
+				var->green.length = 6;
+				caps &= CLCD_CAP_565;
+			} else if (caps & CLCD_CAP_5551) {
+				var->green.length = 5;
+				caps &= CLCD_CAP_5551;
+			} else {
+				var->green.length = 4;
+				caps &= CLCD_CAP_444;
+			}
+		}
+
+		if (var->green.length >= 5) {
+			var->red.length = 5;
+			var->blue.length = 5;
+		} else {
+			var->red.length = 4;
+			var->blue.length = 4;
+		}
 		break;
 	case 32:
-		if (fb->panel->cntl & CNTL_LCDTFT) {
-			var->red.length		= 8;
-			var->green.length	= 8;
-			var->blue.length	= 8;
+		/* If we can't do 888, reject */
+		caps &= CLCD_CAP_888;
+		if (!caps) {
+			ret = -EINVAL;
 			break;
 		}
+
+		var->red.length = 8;
+		var->green.length = 8;
+		var->blue.length = 8;
+		break;
 	default:
 		ret = -EINVAL;
 		break;
@@ -168,7 +228,20 @@ clcdfb_set_bitfields(struct clcd_fb *fb, struct fb_var_screeninfo *var)
 	 * the bitfield length defined above.
 	 */
 	if (ret == 0 && var->bits_per_pixel >= 16) {
-		if (fb->panel->cntl & CNTL_BGR) {
+		bool bgr, rgb;
+
+		bgr = caps & CLCD_CAP_BGR && var->blue.offset == 0;
+		rgb = caps & CLCD_CAP_RGB && var->red.offset == 0;
+
+		if (!bgr && !rgb)
+			/*
+			 * The requested format was not possible, try just
+			 * our capabilities.  One of BGR or RGB must be
+			 * supported.
+			 */
+			bgr = caps & CLCD_CAP_BGR;
+
+		if (bgr) {
 			var->blue.offset = 0;
 			var->green.offset = var->blue.offset + var->blue.length;
 			var->red.offset = var->green.offset + var->green.length;
include/linux/amba/clcd.h +65 -17

150 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#6 lore raw

PATCH 6/10 ARM: add versatile family consolidated CLCD support

In reply to Russell King - ARM Linux

This consolidates the CLCD panel definitions and memory allocation into one location.

Rename the Sanyo 2.5in and Epson 2.2in displays after their respective part numbers. Rather than using a general "Sanyo 2.5in" and "Epson 2.2in" description of the display panel, use the manufacturers part number to be more specific. This helps people identify what the timings actually refer to, which are panel specific.

While here, add CLCD capability information to each panel definition, which has no effect until we add the board-level capabilities.

---
 arch/arm/Kconfig                            |    1 +
 arch/arm/plat-versatile/Kconfig             |    6 +
 arch/arm/plat-versatile/Makefile            |    1 +
 arch/arm/plat-versatile/clcd.c              |  182 +++++++++++++++++++++++++++
 arch/arm/plat-versatile/include/plat/clcd.h |    9 ++
 5 files changed, 199 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/plat-versatile/Kconfig
 create mode 100644 arch/arm/plat-versatile/clcd.c
 create mode 100644 arch/arm/plat-versatile/include/plat/clcd.h
arch/arm/Kconfig +1 -0
index 70a0170..3087985 100644
@@ -1007,6 +1007,7 @@ source "arch/arm/mach-ux500/Kconfig"
 source "arch/arm/mach-versatile/Kconfig"
 
 source "arch/arm/mach-vexpress/Kconfig"
+source "arch/arm/plat-versatile/Kconfig"
 
 source "arch/arm/mach-w90x900/Kconfig"
 
arch/arm/plat-versatile/Kconfig new file +6 -0
new file mode 100644
index 0000000..22540f5
@@ -0,0 +1,6 @@
+if PLAT_VERSATILE
+
+config PLAT_VERSATILE_CLCD
+	bool
+
+endif
arch/arm/plat-versatile/Makefile +1 -0
index 16dde08..8b3341c 100644
@@ -6,3 +6,4 @@ ifeq ($(CONFIG_LEDS_CLASS),y)
 obj-$(CONFIG_ARCH_REALVIEW) += leds.o
 obj-$(CONFIG_ARCH_VERSATILE) += leds.o
 endif
+obj-$(CONFIG_PLAT_VERSATILE_CLCD) += clcd.o
arch/arm/plat-versatile/clcd.c new file +182 -0

182 lines not on this page · raw message

arch/arm/plat-versatile/include/plat/clcd.h new file +9 -0
new file mode 100644
index 0000000..6bb6a1d
@@ -0,0 +1,9 @@
+#ifndef PLAT_CLCD_H
+#define PLAT_CLCD_H
+
+struct clcd_panel *versatile_clcd_get_panel(const char *);
+int versatile_clcd_setup_dma(struct clcd_fb *, unsigned long);
+int versatile_clcd_mmap_dma(struct clcd_fb *, struct vm_area_struct *);
+void versatile_clcd_remove_dma(struct clcd_fb *);
+
+#endif
Signature · 1 line
1.6.2.5
#7 lore raw

PATCH 7/10 ARM: integrator: switch Integrator platforms to use consolidated CLCD

In reply to Russell King - ARM Linux

This switches integrator platforms to use the consolidated CLCD panel support, including the display capabilities. These capabilities prevent the unsupported BGR565 mode being selected, while still allowing RGB5551, BGR5551 and RGB565 modes.

---
 arch/arm/mach-integrator/Kconfig         |    1 +
 arch/arm/mach-integrator/impd1.c         |    5 ++
 arch/arm/mach-integrator/integrator_cp.c |   65 ++++-------------------------
 3 files changed, 15 insertions(+), 56 deletions(-)
arch/arm/mach-integrator/Kconfig +1 -0
index 769b0f1..d701d32 100644
@@ -13,6 +13,7 @@ config ARCH_INTEGRATOR_CP
 	bool "Support Integrator/CP platform"
 	select ARCH_CINTEGRATOR
 	select ARM_TIMER_SP804
+	select PLAT_VERSATILE_CLCD
 	help
 	  Include support for the ARM(R) Integrator CP platform.
 
arch/arm/mach-integrator/impd1.c +5 -0
index 5db574f..8cbb75a 100644
@@ -121,6 +121,7 @@ static struct clcd_panel vga = {
 	.height		= -1,
 	.tim2		= TIM2_BCD | TIM2_IPC,
 	.cntl		= CNTL_LCDTFT | CNTL_LCDVCOMP(1),
+	.caps		= CLCD_CAP_5551,
 	.connector	= IMPD1_CTRL_DISP_VGA,
 	.bpp		= 16,
 	.grayscale	= 0,
@@ -149,6 +150,7 @@ static struct clcd_panel svga = {
 	.tim2		= TIM2_BCD,
 	.cntl		= CNTL_LCDTFT | CNTL_LCDVCOMP(1),
 	.connector	= IMPD1_CTRL_DISP_VGA,
+	.caps		= CLCD_CAP_5551,
 	.bpp		= 16,
 	.grayscale	= 0,
 };
@@ -175,6 +177,7 @@ static struct clcd_panel prospector = {
 	.height		= -1,
 	.tim2		= TIM2_BCD,
 	.cntl		= CNTL_LCDTFT | CNTL_LCDVCOMP(1),
+	.caps		= CLCD_CAP_5551,
 	.fixedtimings	= 1,
 	.connector	= IMPD1_CTRL_DISP_LCD,
 	.bpp		= 16,
@@ -206,6 +209,7 @@ static struct clcd_panel ltm10c209 = {
 	.height		= -1,
 	.tim2		= TIM2_BCD,
 	.cntl		= CNTL_LCDTFT | CNTL_LCDVCOMP(1),
+	.caps		= CLCD_CAP_5551,
 	.fixedtimings	= 1,
 	.connector	= IMPD1_CTRL_DISP_LCD,
 	.bpp		= 16,
@@ -279,6 +283,7 @@ static void impd1fb_clcd_remove(struct clcd_fb *fb)
 
 static struct clcd_board impd1_clcd_data = {
 	.name		= "IM-PD/1",
+	.caps		= CLCD_CAP_5551 | CLCD_CAP_888,
 	.check		= clcdfb_check,
 	.decode		= clcdfb_decode,
 	.disable	= impd1fb_clcd_disable,
arch/arm/mach-integrator/integrator_cp.c +9 -56

94 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#8 lore raw

PATCH 8/10 ARM: versatile: switch Versatile to use consolidated CLCD

In reply to Russell King - ARM Linux

This switches Versatile platforms to use the consolidated CLCD panel support, including the display capabilities. Versatile can support RGB5551, BGR5551, RGB565 and BGR565 modes.

---
 arch/arm/Kconfig               |    1 +
 arch/arm/mach-versatile/core.c |  186 ++++++++--------------------------------
 2 files changed, 36 insertions(+), 151 deletions(-)
arch/arm/Kconfig +1 -0
index 3087985..b0d55b9 100644
@@ -256,6 +256,7 @@ config ARCH_VERSATILE
 	select GENERIC_CLOCKEVENTS
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select PLAT_VERSATILE
+	select PLAT_VERSATILE_CLCD
 	select ARM_TIMER_SP804
 	help
 	  This enables support for ARM Ltd Versatile board.
arch/arm/mach-versatile/core.c +35 -151

234 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#9 lore raw

PATCH 9/10 ARM: realview: switch Realview to use consolidated CLCD

In reply to Russell King - ARM Linux

This switches Realview platforms to use the consolidated CLCD panel support, including the display capabilities. As Realview uses a PL111, it can support the full range of pixel formats - 444, 5551, 565 in both RGB and BGR mode.

---
 arch/arm/Kconfig              |    1 +
 arch/arm/mach-realview/core.c |  214 +++++++----------------------------------
 2 files changed, 35 insertions(+), 180 deletions(-)
arch/arm/Kconfig +1 -0
index b0d55b9..7ee15c2 100644
@@ -241,6 +241,7 @@ config ARCH_REALVIEW
 	select GENERIC_CLOCKEVENTS
 	select ARCH_WANT_OPTIONAL_GPIOLIB
 	select PLAT_VERSATILE
+	select PLAT_VERSATILE_CLCD
 	select ARM_TIMER_SP804
 	select GPIO_PL061 if GPIOLIB
 	help
arch/arm/mach-realview/core.c +34 -180

253 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#10 lore raw

PATCH 10/10 ARM: vexpress: switch Versatile Express to use consolidated CLCD

In reply to Russell King - ARM Linux

This switches Versatile Express to use the conslidated CLCD panel support, including the display capabilities. As Versatile Express uses a PL111, it can support the full range of pixel formats - 444, 5551, 565 in both RGB and BGR mode.

---
 arch/arm/Kconfig                  |    1 +
 arch/arm/mach-vexpress/ct-ca9x4.c |   58 ++++++-------------------------------
 2 files changed, 10 insertions(+), 49 deletions(-)
arch/arm/Kconfig +1 -0
index 7ee15c2..4f0e83e 100644
@@ -274,6 +274,7 @@ config ARCH_VEXPRESS
 	select HAVE_PATA_PLATFORM
 	select ICST
 	select PLAT_VERSATILE
+	select PLAT_VERSATILE_CLCD
 	help
 	  This enables support for the ARM Ltd Versatile Express boards.
 
arch/arm/mach-vexpress/ct-ca9x4.c +9 -49

86 lines not on this page · raw message

Signature · 1 line
1.6.2.5
#11 lore raw

cover Fix CLCD framebuffer formats and consolidate ARM platform CLCD support

In reply to Russell King - ARM Linux

Any comments on this patch set?

Quoted 55 lines · Russell King - ARM Linux

This patch series fixes the framebuffer formatting for the various CLCD colour modes - including those which the CLCD doesn't actually support.

PL110 in TFT mode only supports 888 and 5551 connectivity. Some ARM platforms have additional muxing on their outputs which rewire this to allow the 5551 output to be used in 565 mode:

FBMEM bit (RGB) 5551 565
0 R0 R0
1 R1 R1
2 R2 R2
3 R3 R3
4 R4 R4
5 G0 G0
6 G1 G1
7 G2 G2
8 G3 G3
9 G4 G4
10 B0 G5
11 B1 B0
12 B2 B1
13 B3 B2
14 B4 B3
15 I B4

This means that when BGR mode is selected, it in green mapping to bits 0, 9, 8, 7, 6, 5 in the framebuffer, which is not sane. There appears to be no external MUX selection for this format.

PL111 on the other hand supports 888, 5551, 565 and 444 natively, so it can support RGB and BGR pixel formats directly.

Introduce a set of capabilities one bit for each format (RGB888, BGR888, RGB5551, BGR5551 etc) describing what formats the panel itself can support, and also what the board can support. These are combined, and from that we select the appropriate 16bpp pixel format which the panel and board can support. Where a panel and board combination supports multiple 16bpp formats, pick the closest format to the requested format.

Implementations which do not supply the capabilities fall back to the old way of doing things, which is based on the cntl register to indicate whether we should be using RGB or BGR mode.

This then allows us to unify the CLCD support across Integrator, Versatile, Realview and Versatile Express. This has been successfully tested on:

Integrator/CP - RGB565, RGB5551, BGR5551.
Versatile PB926 - RGB565, BGR565, RGB5551, BGR5551.
Realview EB ARM11MPcore - RGB565, BGR565, RGB5551, BGR5551, RGB444, BGR444.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#12 lore raw

cover Fix CLCD framebuffer formats and consolidate ARM platform CLCD support

In reply to Russell King - ARM Linux
Quoted 3 lines · Russell King - ARM Linux

This patch series fixes the framebuffer formatting for the various CLCD colour modes - including those which the CLCD doesn't actually support.

I reviewed the patches and they look fine (ack if you want).

What I can't tell for sure is whether the capabilities supported by the displays are correct (platforms people here in ARM should know better but I don't think we have all those available to try).

Signature · 1 line
Catalin