Newer
Older
#ifdef CONFIG_LCD_BMP_RLE8
if (le32_to_cpu(bmp->header.compression) == BMP_BI_RLE8) {
if (bpix != 16) {
/* TODO implement render code for bpix != 16 */
printf("Error: only support 16 bpix");
return 1;
}
lcd_display_rle8_bitmap(bmp, cmap_base, fb, x, y);
break;
}
#endif
if (bpix != 16)
byte_width = width;
else
byte_width = width * 2;
for (i = 0; i < height; ++i) {
WATCHDOG_RESET();
for (j = 0; j < width; j++) {
if (bpix != 16) {
} else {
*(uint16_t *)fb = cmap_base[*(bmap++)];
fb += sizeof(uint16_t) / sizeof(*fb);
}
}
bmap += (padded_width - width);
fb -= byte_width + lcd_line_length;
}
break;
#if defined(CONFIG_BMP_16BPP)
case 16:
for (i = 0; i < height; ++i) {
WATCHDOG_RESET();
for (j = 0; j < width; j++)
fb_put_word(&fb, &bmap);
bmap += (padded_width - width) * 2;
fb -= width * 2 + lcd_line_length;
}
break;
#endif /* CONFIG_BMP_16BPP */
#if defined(CONFIG_BMP_32BPP)
case 32:
for (i = 0; i < height; ++i) {
for (j = 0; j < width; j++) {
*(fb++) = *(bmap++);
*(fb++) = *(bmap++);
*(fb++) = *(bmap++);
*(fb++) = *(bmap++);
}
fb -= lcd_line_length + width * (bpix / 8);
}
break;
#endif /* CONFIG_BMP_32BPP */
lcd_sync();
#ifdef CONFIG_SPLASH_SCREEN_PREPARE
static inline int splash_screen_prepare(void)
{
return board_splash_screen_prepare();
}
#else
static inline int splash_screen_prepare(void)
{
return 0;
}
#endif
{
#ifdef CONFIG_SPLASH_SCREEN
char *s;
ulong addr;
static int do_splash = 1;
if (do_splash && (s = getenv("splashimage")) != NULL) {
do_splash = 0;
if (splash_screen_prepare())
return (void *)gd->fb_base;
addr = simple_strtoul (s, NULL, 16);
#ifdef CONFIG_SPLASH_SCREEN_ALIGN
s = getenv("splashpos");
if (s != NULL) {
if (s[0] == 'm')
x = BMP_ALIGN_CENTER;
else
x = simple_strtol(s, NULL, 0);
s = strchr(s + 1, ',');
if (s != NULL) {
if (s[1] == 'm')
y = BMP_ALIGN_CENTER;
else
y = simple_strtol (s + 1, NULL, 0);
}
}
#endif /* CONFIG_SPLASH_SCREEN_ALIGN */
}
#endif /* CONFIG_SPLASH_SCREEN */
#ifdef CONFIG_LCD_INFO
console_col = LCD_INFO_X / VIDEO_FONT_WIDTH;
console_row = LCD_INFO_Y / VIDEO_FONT_HEIGHT;
lcd_show_board_info();
#endif /* CONFIG_LCD_INFO */
#if defined(CONFIG_LCD_LOGO) && !defined(CONFIG_LCD_INFO_BELOW_LOGO)
return (void *)((ulong)lcd_base + BMP_LOGO_HEIGHT * lcd_line_length);
#endif /* CONFIG_LCD_LOGO && !defined(CONFIG_LCD_INFO_BELOW_LOGO) */
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
#ifdef CONFIG_SPLASHIMAGE_GUARD
static int on_splashimage(const char *name, const char *value, enum env_op op,
int flags)
{
ulong addr;
int aligned;
if (op == env_op_delete)
return 0;
addr = simple_strtoul(value, NULL, 16);
/* See README.displaying-bmps */
aligned = (addr % 4 == 2);
if (!aligned) {
printf("Invalid splashimage value. Value must be 16 bit aligned, but not 32 bit aligned\n");
return -1;
}
return 0;
}
U_BOOT_ENV_CALLBACK(splashimage, on_splashimage);
#endif
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
void lcd_position_cursor(unsigned col, unsigned row)
{
console_col = min(col, CONSOLE_COLS - 1);
console_row = min(row, CONSOLE_ROWS - 1);
}
int lcd_get_pixel_width(void)
{
return panel_info.vl_col;
}
int lcd_get_pixel_height(void)
{
return panel_info.vl_row;
}
int lcd_get_screen_rows(void)
{
return CONSOLE_ROWS;
}
int lcd_get_screen_columns(void)
{
return CONSOLE_COLS;
}