diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-01-22 06:02:10 -0500 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-02-19 06:08:41 -0500 |
commit | e6b9c1f8a623bfaa545067df73213db1c9c8e7af (patch) | |
tree | 735d23cf96b81103c7771156fc760c17f186c6a8 /arch/arm/mach-integrator | |
parent | 9728c1b6a724daefc413b44e10253cdbb5e06d08 (diff) |
ARM: integrator: support CLCD RGB5551 layout for 16bpp
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.
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mach-integrator')
-rw-r--r-- | arch/arm/mach-integrator/include/mach/cm.h | 4 | ||||
-rw-r--r-- | arch/arm/mach-integrator/integrator_cp.c | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/arch/arm/mach-integrator/include/mach/cm.h b/arch/arm/mach-integrator/include/mach/cm.h index 1ab353e23595..445d57adb043 100644 --- a/arch/arm/mach-integrator/include/mach/cm.h +++ b/arch/arm/mach-integrator/include/mach/cm.h | |||
@@ -24,9 +24,9 @@ void cm_control(u32, u32); | |||
24 | #define CM_CTRL_LCDBIASDN (1 << 10) | 24 | #define CM_CTRL_LCDBIASDN (1 << 10) |
25 | #define CM_CTRL_LCDMUXSEL_MASK (7 << 11) | 25 | #define CM_CTRL_LCDMUXSEL_MASK (7 << 11) |
26 | #define CM_CTRL_LCDMUXSEL_GENLCD (1 << 11) | 26 | #define CM_CTRL_LCDMUXSEL_GENLCD (1 << 11) |
27 | #define CM_CTRL_LCDMUXSEL_VGA_16BPP (2 << 11) | 27 | #define CM_CTRL_LCDMUXSEL_VGA565_TFT555 (2 << 11) |
28 | #define CM_CTRL_LCDMUXSEL_SHARPLCD (3 << 11) | 28 | #define CM_CTRL_LCDMUXSEL_SHARPLCD (3 << 11) |
29 | #define CM_CTRL_LCDMUXSEL_VGA_8421BPP (4 << 11) | 29 | #define CM_CTRL_LCDMUXSEL_VGA555_TFT555 (4 << 11) |
30 | #define CM_CTRL_LCDEN0 (1 << 14) | 30 | #define CM_CTRL_LCDEN0 (1 << 14) |
31 | #define CM_CTRL_LCDEN1 (1 << 15) | 31 | #define CM_CTRL_LCDEN1 (1 << 15) |
32 | #define CM_CTRL_STATIC1 (1 << 16) | 32 | #define CM_CTRL_STATIC1 (1 << 16) |
diff --git a/arch/arm/mach-integrator/integrator_cp.c b/arch/arm/mach-integrator/integrator_cp.c index e9327da1382e..860090247b3b 100644 --- a/arch/arm/mach-integrator/integrator_cp.c +++ b/arch/arm/mach-integrator/integrator_cp.c | |||
@@ -478,14 +478,16 @@ static struct clcd_panel vga = { | |||
478 | */ | 478 | */ |
479 | static void cp_clcd_enable(struct clcd_fb *fb) | 479 | static void cp_clcd_enable(struct clcd_fb *fb) |
480 | { | 480 | { |
481 | u32 val; | 481 | struct fb_var_screeninfo *var = &fb->fb.var; |
482 | u32 val = CM_CTRL_STATIC1 | CM_CTRL_STATIC2; | ||
482 | 483 | ||
483 | if (fb->fb.var.bits_per_pixel <= 8) | 484 | if (var->bits_per_pixel <= 8 || |
484 | val = CM_CTRL_LCDMUXSEL_VGA_8421BPP; | 485 | (var->bits_per_pixel == 16 && var->green.length == 5)) |
486 | /* Pseudocolor, RGB555, BGR555 */ | ||
487 | val |= CM_CTRL_LCDMUXSEL_VGA555_TFT555; | ||
485 | else if (fb->fb.var.bits_per_pixel <= 16) | 488 | else if (fb->fb.var.bits_per_pixel <= 16) |
486 | val = CM_CTRL_LCDMUXSEL_VGA_16BPP | 489 | /* truecolor RGB565 */ |
487 | | CM_CTRL_LCDEN0 | CM_CTRL_LCDEN1 | 490 | val |= CM_CTRL_LCDMUXSEL_VGA565_TFT555; |
488 | | CM_CTRL_STATIC1 | CM_CTRL_STATIC2; | ||
489 | else | 491 | else |
490 | val = 0; /* no idea for this, don't trust the docs */ | 492 | val = 0; /* no idea for this, don't trust the docs */ |
491 | 493 | ||