Newer
Older
bmap += (padded_width - width);
fb -= byte_width + lcd_line_length;
#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;
#if defined(CONFIG_BMP_24BMP)
case 24:
for (i = 0; i < height; ++i) {
for (j = 0; j < width; j++) {
*(fb++) = *(bmap++);
*(fb++) = *(bmap++);
*(fb++) = *(bmap++);
*(fb++) = 0;
}
fb -= lcd_line_length + width * (bpix / 8);
}
break;
#endif /* CONFIG_BMP_24BMP */
#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
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 *)lcd_base;
addr = simple_strtoul (s, NULL, 16);
splash_get_pos(&x, &y);
}
#endif /* CONFIG_SPLASH_SCREEN */
#ifdef CONFIG_LCD_INFO
lcd_set_col(LCD_INFO_X / VIDEO_FONT_WIDTH);
lcd_set_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) */
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
#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
void lcd_position_cursor(unsigned col, unsigned row)
{
console_curr_col = min_t(short, col, console_cols - 1);
console_curr_row = min_t(short, 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)
{
}
int lcd_get_screen_columns(void)
{
#if defined(CONFIG_LCD_DT_SIMPLEFB)
static int lcd_dt_simplefb_configure_node(void *blob, int off)
{
#if LCD_BPP == LCD_COLOR16
return fdt_setup_simplefb_node(blob, off, gd->fb_base,
panel_info.vl_col, panel_info.vl_row,
panel_info.vl_col * 2, "r5g6b5");
return -1;
#endif
}
int lcd_dt_simplefb_add_node(void *blob)
{
static const char compat[] = "simple-framebuffer";
static const char disabled[] = "disabled";
1159
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
1185
1186
int off, ret;
off = fdt_add_subnode(blob, 0, "framebuffer");
if (off < 0)
return -1;
ret = fdt_setprop(blob, off, "status", disabled, sizeof(disabled));
if (ret < 0)
return -1;
ret = fdt_setprop(blob, off, "compatible", compat, sizeof(compat));
if (ret < 0)
return -1;
return lcd_dt_simplefb_configure_node(blob, off);
}
int lcd_dt_simplefb_enable_existing_node(void *blob)
{
int off;
off = fdt_node_offset_by_compatible(blob, -1, "simple-framebuffer");
if (off < 0)
return -1;
return lcd_dt_simplefb_configure_node(blob, off);
}
#endif