Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/libefi/efi_console.c
Show First 20 Lines • Show All 946 Lines • ▼ Show 20 Lines | if ((mode & (RB_SERIAL | RB_MULTIPLE)) == 0) { | ||||
} else { | } else { | ||||
uint32_t fb_height, fb_width; | uint32_t fb_height, fb_width; | ||||
fb_height = gfx_state.tg_fb.fb_height; | fb_height = gfx_state.tg_fb.fb_height; | ||||
fb_width = gfx_state.tg_fb.fb_width; | fb_width = gfx_state.tg_fb.fb_width; | ||||
/* | /* | ||||
* setup_font() can adjust terminal size. | * setup_font() can adjust terminal size. | ||||
* Note, we do use UEFI terminal dimensions first, | * We can see two kind of bad happening. | ||||
* this is because the font selection will attempt | * We either can get too small console font - requested | ||||
* to achieve at least this terminal dimension and | * terminal size is large, display resolution is | ||||
* we do not end up with too small font. | * large, and we get very small font. | ||||
* Or, we can get too large font - requested | |||||
* terminal size is small and this will cause large | |||||
* font to be selected. | |||||
* Now, the setup_font() is updated to consider | |||||
* display density and this should give us mostly | |||||
* acceptable font. However, the catch is, not all | |||||
* display devices will give us display density. | |||||
* Still, we do hope, external monitors do - this is | |||||
* where the display size will matter the most. | |||||
* And for laptop screens, we should still get good | |||||
* results by requesting 80x25 terminal. | |||||
*/ | */ | ||||
gfx_state.tg_tp.tp_row = rows; | gfx_state.tg_tp.tp_row = 25; | ||||
gfx_state.tg_tp.tp_col = cols; | gfx_state.tg_tp.tp_col = 80; | ||||
setup_font(&gfx_state, fb_height, fb_width); | setup_font(&gfx_state, fb_height, fb_width); | ||||
rows = gfx_state.tg_tp.tp_row; | rows = gfx_state.tg_tp.tp_row; | ||||
cols = gfx_state.tg_tp.tp_col; | cols = gfx_state.tg_tp.tp_col; | ||||
/* Point of origin in pixels. */ | /* Point of origin in pixels. */ | ||||
gfx_state.tg_origin.tp_row = (fb_height - | gfx_state.tg_origin.tp_row = (fb_height - | ||||
(rows * gfx_state.tg_font.vf_height)) / 2; | (rows * gfx_state.tg_font.vf_height)) / 2; | ||||
gfx_state.tg_origin.tp_col = (fb_width - | gfx_state.tg_origin.tp_col = (fb_width - | ||||
(cols * gfx_state.tg_font.vf_width)) / 2; | (cols * gfx_state.tg_font.vf_width)) / 2; | ||||
▲ Show 20 Lines • Show All 415 Lines • Show Last 20 Lines |