diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-01-30 07:33:02 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:33:02 -0500 |
commit | 1cac5004e953506166e980da5776d5cc1c176d79 (patch) | |
tree | da90c8870839b0445b45b39b473c8715afc31424 /arch/x86/boot/video.c | |
parent | 02a7b425e82cd0052e5eaedbae81a522c6aae6c4 (diff) |
x86 setup: display VESA graphics modes in vga=ask menu
Display VESA graphics modes, with their mode IDs, in the vga=ask
menu. Most VESA mode numbers are platform-dependent, so it helps to
have an easy way to display them.
Based in part on a patch by Petr Vandrovec <petr@vandrovec.name>.
Cc: Petr Vandrovec <petr@vandrovec.name>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/boot/video.c')
-rw-r--r-- | arch/x86/boot/video.c | 33 |
1 files changed, 30 insertions, 3 deletions
diff --git a/arch/x86/boot/video.c b/arch/x86/boot/video.c index ad9712f01739..696d08f3843c 100644 --- a/arch/x86/boot/video.c +++ b/arch/x86/boot/video.c | |||
@@ -293,13 +293,28 @@ static void display_menu(void) | |||
293 | struct mode_info *mi; | 293 | struct mode_info *mi; |
294 | char ch; | 294 | char ch; |
295 | int i; | 295 | int i; |
296 | int nmodes; | ||
297 | int modes_per_line; | ||
298 | int col; | ||
296 | 299 | ||
297 | puts("Mode: COLSxROWS:\n"); | 300 | nmodes = 0; |
301 | for (card = video_cards; card < video_cards_end; card++) | ||
302 | nmodes += card->nmodes; | ||
298 | 303 | ||
304 | modes_per_line = 1; | ||
305 | if (nmodes >= 20) | ||
306 | modes_per_line = 3; | ||
307 | |||
308 | for (col = 0; col < modes_per_line; col++) | ||
309 | puts("Mode: Resolution: Type: "); | ||
310 | putchar('\n'); | ||
311 | |||
312 | col = 0; | ||
299 | ch = '0'; | 313 | ch = '0'; |
300 | for (card = video_cards; card < video_cards_end; card++) { | 314 | for (card = video_cards; card < video_cards_end; card++) { |
301 | mi = card->modes; | 315 | mi = card->modes; |
302 | for (i = 0; i < card->nmodes; i++, mi++) { | 316 | for (i = 0; i < card->nmodes; i++, mi++) { |
317 | char resbuf[32]; | ||
303 | int visible = mi->x && mi->y; | 318 | int visible = mi->x && mi->y; |
304 | u16 mode_id = mi->mode ? mi->mode : | 319 | u16 mode_id = mi->mode ? mi->mode : |
305 | (mi->y << 8)+mi->x; | 320 | (mi->y << 8)+mi->x; |
@@ -307,8 +322,18 @@ static void display_menu(void) | |||
307 | if (!visible) | 322 | if (!visible) |
308 | continue; /* Hidden mode */ | 323 | continue; /* Hidden mode */ |
309 | 324 | ||
310 | printf("%c %04X %3dx%-3d %s\n", | 325 | if (mi->depth) |
311 | ch, mode_id, mi->x, mi->y, card->card_name); | 326 | sprintf(resbuf, "%dx%d", mi->y, mi->depth); |
327 | else | ||
328 | sprintf(resbuf, "%d", mi->y); | ||
329 | |||
330 | printf("%c %03X %4dx%-7s %-6s", | ||
331 | ch, mode_id, mi->x, resbuf, card->card_name); | ||
332 | col++; | ||
333 | if (col >= modes_per_line) { | ||
334 | putchar('\n'); | ||
335 | col = 0; | ||
336 | } | ||
312 | 337 | ||
313 | if (ch == '9') | 338 | if (ch == '9') |
314 | ch = 'a'; | 339 | ch = 'a'; |
@@ -318,6 +343,8 @@ static void display_menu(void) | |||
318 | ch++; | 343 | ch++; |
319 | } | 344 | } |
320 | } | 345 | } |
346 | if (col) | ||
347 | putchar('\n'); | ||
321 | } | 348 | } |
322 | 349 | ||
323 | #define H(x) ((x)-'a'+10) | 350 | #define H(x) ((x)-'a'+10) |