summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2016-01-26 09:48:07 -0500
committerTom Rini <trini@konsulko.com>2016-01-26 09:48:07 -0500
commitb72ae192e39f933100b0eb034768cb4daeebf67a (patch)
tree34d7b00636a472040f81b3ee1ae7f1a0a09ec1b7 /common
parentd6ea6d88769e85f6873a94065a1ba167c9b592da (diff)
parent7588c312528eea9e24ef5c1b9a29a256ac5024d4 (diff)
downloadblackbird-obmc-uboot-b72ae192e39f933100b0eb034768cb4daeebf67a.tar.gz
blackbird-obmc-uboot-b72ae192e39f933100b0eb034768cb4daeebf67a.zip
Merge branch 'master' of git://git.denx.de/u-boot-video
Diffstat (limited to 'common')
-rw-r--r--common/lcd.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/common/lcd.c b/common/lcd.c
index 2f3594a417..51705adeaf 100644
--- a/common/lcd.c
+++ b/common/lcd.c
@@ -89,13 +89,24 @@ static void lcd_stub_puts(struct stdio_dev *dev, const char *s)
/* Small utility to check that you got the colours right */
#ifdef LCD_TEST_PATTERN
+#if LCD_BPP == LCD_COLOR8
#define N_BLK_VERT 2
#define N_BLK_HOR 3
static int test_colors[N_BLK_HOR * N_BLK_VERT] = {
CONSOLE_COLOR_RED, CONSOLE_COLOR_GREEN, CONSOLE_COLOR_YELLOW,
CONSOLE_COLOR_BLUE, CONSOLE_COLOR_MAGENTA, CONSOLE_COLOR_CYAN,
+}; /*LCD_BPP == LCD_COLOR8 */
+
+#elif LCD_BPP == LCD_COLOR16
+#define N_BLK_VERT 2
+#define N_BLK_HOR 4
+
+static int test_colors[N_BLK_HOR * N_BLK_VERT] = {
+ CONSOLE_COLOR_RED, CONSOLE_COLOR_GREEN, CONSOLE_COLOR_YELLOW, CONSOLE_COLOR_BLUE,
+ CONSOLE_COLOR_MAGENTA, CONSOLE_COLOR_CYAN, CONSOLE_COLOR_GREY, CONSOLE_COLOR_WHITE,
};
+#endif /*LCD_BPP == LCD_COLOR16 */
static void test_pattern(void)
{
@@ -104,12 +115,15 @@ static void test_pattern(void)
ushort v_step = (v_max + N_BLK_VERT - 1) / N_BLK_VERT;
ushort h_step = (h_max + N_BLK_HOR - 1) / N_BLK_HOR;
ushort v, h;
+#if LCD_BPP == LCD_COLOR8
uchar *pix = (uchar *)lcd_base;
+#elif LCD_BPP == LCD_COLOR16
+ ushort *pix = (ushort *)lcd_base;
+#endif
printf("[LCD] Test Pattern: %d x %d [%d x %d]\n",
h_max, v_max, h_step, v_step);
- /* WARNING: Code silently assumes 8bit/pixel */
for (v = 0; v < v_max; ++v) {
uchar iy = v / v_step;
for (h = 0; h < h_max; ++h) {
OpenPOWER on IntegriCloud