summaryrefslogtreecommitdiff
path: root/common/lcd_console.c
diff options
context:
space:
mode:
authorPeng Fan <peng.fan@nxp.com>2016-02-23 10:14:34 +0800
committerYe Li <ye.li@nxp.com>2017-04-05 14:04:28 +0800
commit79a86adf2279336617ad7d4f0813f040b17318d4 (patch)
tree0e1a0a8af665bb83a40552091f6464bb0d93fc82 /common/lcd_console.c
parent27e20dc28570d710ecaa0db9db508c8ee750d1ae (diff)
downloadu-boot-imx-79a86adf2279336617ad7d4f0813f040b17318d4.zip
u-boot-imx-79a86adf2279336617ad7d4f0813f040b17318d4.tar.gz
u-boot-imx-79a86adf2279336617ad7d4f0813f040b17318d4.tar.bz2
MLK-12425-2: video: epdc: introduce epdc support
Support EPDC. E-Ink feature is supported by i.MX6DL/SL and i.MX7D. For now this driver only supports i.MX6DL/SL, because the i.MX7D EPDC driver needs pxp support which is not included in U-Boot. Support user defined logo file, if there is no logo file, it will draw a black border around a white screen. If need to enable EPDC, a waveform file is required to let all work. Since we need LCD_MONOCHROME mode for EPDC, we introduce LCD_MONOCHROME support. Please refer to Linux Reference Manual for how to flash WAVEFORM file. Signed-off-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Robby Cai <R63905@freescale.com> Signed-off-by: Nitin Garg <nitin.garg@freescale.com> Signed-off-by: Ye.Li <B37916@freescale.com> (cherry picked from commit a7244f279cc3c3994bcd103f5e9a183b1075ae71)
Diffstat (limited to 'common/lcd_console.c')
-rw-r--r--common/lcd_console.c21
1 files changed, 19 insertions, 2 deletions
diff --git a/common/lcd_console.c b/common/lcd_console.c
index bb0d7c5..4c91def 100644
--- a/common/lcd_console.c
+++ b/common/lcd_console.c
@@ -46,17 +46,34 @@ static void lcd_putc_xy0(struct console_t *pcons, ushort x, ushort y, char c)
{
int fg_color = lcd_getfgcolor();
int bg_color = lcd_getbgcolor();
- int i, row;
+ int row;
+#if LCD_BPP == LCD_MONOCHROME
+ ushort off = x * (1 << LCD_BPP) % 8;
+#else
+ int i;
+#endif
+
fbptr_t *dst = (fbptr_t *)pcons->fbbase +
y * pcons->lcdsizex +
x;
for (row = 0; row < VIDEO_FONT_HEIGHT; row++) {
uchar bits = video_fontdata[c * VIDEO_FONT_HEIGHT + row];
+#if LCD_BPP == LCD_MONOCHROME
+ uchar rest = *dst & -(1 << (8 - off));
+ uchar sym;
+
+ sym = (COLOR_MASK(fg_color) & bits) |
+ (COLOR_MASK(bg_color) & ~bits);
+ *dst++ = rest | (sym >> off);
+ rest = sym << (8 - off);
+ *dst = rest | (*dst & ((1 << (8 - off)) - 1));
+#else /* LCD_BPP == LCD_COLOR8 or LCD_COLOR16 or LCD_COLOR32 */
for (i = 0; i < VIDEO_FONT_WIDTH; ++i) {
*dst++ = (bits & 0x80) ? fg_color : bg_color;
bits <<= 1;
}
+#endif
dst += (pcons->lcdsizex - VIDEO_FONT_WIDTH);
}
}
@@ -114,7 +131,7 @@ static inline void console_newline(void)
for (i = 0; i < cons.rows-rows; i++)
cons.fp_console_moverow(&cons, i, i+rows);
for (i = 0; i < rows; i++)
- cons.fp_console_setrow(&cons, cons.rows-i-1, bg_color);
+ cons.fp_console_setrow(&cons, cons.rows-i-1, COLOR_MASK(bg_color));
cons.curr_row -= rows;
}
lcd_sync();