Not long ago, because the work needs to replace the LCD screen, the resolution from the original 800*480 replaced by the 800*600.
Of course, change the LCD driver first, modify the corresponding parameters. The boot logo has also been replaced, the resolution modified to 800*600.
But when the boot, the logo can not be displayed, prompted the following error.
Fbcon_init:disable Boot-logo (Boot-logo bigger than screen).
That's ridiculous. Look at the source code, the hint under DRVERS/VIDEO/CONSOLE/FBCON.C, here intercept this code.
static void Fbcon_prepare_logo (struct vc_data *vc, struct fb_info *info, int cols, int rows, int new_cols, int n
Ew_rows) {/* Need to make room for the logo * * * struct fbcon_ops *ops = info->fbcon_par;
int cnt, erase = Vc->vc_video_erase_char, step;
unsigned short *save = NULL, *r, *q;
int logo_height;
if (Info->flags & fbinfo_module) {logo_shown = Fbcon_logo_dontshow;
Return
}/* Remove underline attribute from erase character * if black and white framebuffer.
*/if (fb_get_color_depth (&info->var, &info->fix) = = 1) erase &= ~0x400;
Logo_height = Fb_prepare_logo (info, ops->rotate);
Logo_lines in this assignment logo_lines = div_round_up (Logo_height, vc->vc_font.height);
Q = (unsigned short *) (Vc->vc_origin + vc->vc_size_row * rows);
Step = Logo_lines * COLS;
for (r = q-logo_lines * Cols r < Q; r++) if (SCR_READW (r)!= Vc->vc_video_erase_char) break; if (r!= q && new_rows >=Rows + logo_lines) {save = Kmalloc (Logo_lines * new_cols * 2, Gfp_kernel);
if (save) {int i = cols < new_cols? cols:new_cols;
SCR_MEMSETW (save, Erase, Logo_lines * new_cols * 2);
R = Q-step;
for (cnt = 0; cnt < logo_lines; cnt++, r = i) Scr_memcpyw (save + CNT * New_cols, R, 2 * i);
R = q;
} if (r = = q) {/* We can scroll screen down/r = Q-step-cols;
for (cnt = Rows-logo_lines cnt > 0; cnt--) {scr_memcpyw (R + step, R, Vc->vc_size_row);
R-= cols;
} if (!save) {int lines;
if (vc->vc_y + logo_lines >= rows) lines = rows-vc->vc_y-1;
else lines = Logo_lines;
Vc->vc_y + = lines;
Vc->vc_pos + + lines * vc->vc_size_row;
} scr_memsetw (unsigned short *) Vc->vc_origin, Erase, Vc->vc_size_row * logo_lines);
if (con_is_visible (vc) && Vc->vc_mode = = Kd_text) {fbcon_clear_margins (VC, 0);
Update_screen (VC); } if (save) {q = (unsigned sHort *) (Vc->vc_origin + vc->vc_size_row * rows);
SCR_MEMCPYW (q, Save, Logo_lines * New_cols * 2);
Vc->vc_y + = Logo_lines;
Vc->vc_pos + + Logo_lines * vc->vc_size_row;
Kfree (save);
///error prompted in this if (Logo_lines > Vc->vc_bottom) {logo_shown = Fbcon_logo_canshow;
PRINTK (kern_info "fbcon_init:disable Boot-logo (Boot-logo bigger than screen). \ n");
else if (Logo_shown!= fbcon_logo_dontshow) {logo_shown = Fbcon_logo_draw;
Vc->vc_top = Logo_lines;
}
}
Can be found due to Logo_lines > Vc->vc_bottom.
of which logo_lines = Div_round_up (Logo_height, vc->vc_font.height); (Div_round_up is to take up the whole meaning)
and the Vc->vc_bottom code reads down to Vc->vc_bottom = info->var.yres/vc->vc_font.height;
The key is Vc->vc_font.height, Linux under Vc->vc_font.height defaults to 16, so when the LCD screen and the resolution of the logo are 800*600, 600/16 is not divisible, so take the whole logo_ lines = 38; Vc->vc_bottom = 37; The hint error cannot be displayed.
As long as the logo to change the small, to 592, then logo_lines = 592/16=37; vc->vc_bottom = 600/16=37, you can display the normal.
~end