summaryrefslogtreecommitdiff
path: root/common/lcd.c
diff options
context:
space:
mode:
authorPeng Fan <Peng.Fan@freescale.com>2015-03-14 18:17:06 +0800
committerMax Krummenacher <max.krummenacher@toradex.com>2016-03-09 14:42:13 +0100
commitebfa284369e202200954b3502d705b02d61da83e (patch)
tree028f48cba33d9cf5ed24f22398026126f6b71c55 /common/lcd.c
parentd6c37f9dd8eb74f8a79e39e03eb1bdcfd81f2663 (diff)
MLK-10774-31 lcd: add LCD_MONOCHROME
LCD_MONOCHROME is removed in commit f4469f50b0367820121ef2d313517d422ed70e1d. Add related code back to support epdc. In this patch, also include crm_regs.h in mx6slevk.c to make epdc code be compiled ok. COLOR_MASK is also added from commit a7de2953f51e70754190d3516167d58d27d17219 Signed-off-by: Peng Fan <Peng.Fan@freescale.com>
Diffstat (limited to 'common/lcd.c')
-rw-r--r--common/lcd.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/common/lcd.c b/common/lcd.c
index f33942c617c..408937d09a3 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -38,11 +38,6 @@
#define CONFIG_LCD_ALIGNMENT PAGE_SIZE
#endif
-#if (LCD_BPP != LCD_COLOR8) && (LCD_BPP != LCD_COLOR16) && \
- (LCD_BPP != LCD_COLOR32)
-#error Unsupported LCD BPP.
-#endif
-
DECLARE_GLOBAL_DATA_PTR;
static int lcd_init(void *lcdbase);
@@ -172,7 +167,11 @@ void lcd_clear(void)
char *s;
ulong addr;
static int do_splash = 1;
-#if LCD_BPP == LCD_COLOR8
+#if LCD_BPP == LCD_MONOCHROME
+ /* Setting the palette */
+ lcd_initcolregs();
+
+#elif LCD_BPP == LCD_COLOR8
/* Setting the palette */
lcd_setcolreg(CONSOLE_COLOR_BLACK, 0, 0, 0);
lcd_setcolreg(CONSOLE_COLOR_RED, 0xFF, 0, 0);
@@ -200,14 +199,15 @@ void lcd_clear(void)
#else
/* set framebuffer to background color */
#if (LCD_BPP != LCD_COLOR32)
- memset((char *)lcd_base, bg_color, lcd_line_length * panel_info.vl_row);
+ memset((char *)lcd_base, COLOR_MASK(lcd_getbgcolor()),
+ lcd_line_length * panel_info.vl_row);
#else
u32 *ppix = lcd_base;
u32 i;
for (i = 0;
i < (lcd_line_length * panel_info.vl_row)/NBYTES(panel_info.vl_bpix);
i++) {
- *ppix++ = bg_color;
+ *ppix++ = COLOR_MASK(lcd_getbgcolor());
}
#endif
#endif