summaryrefslogtreecommitdiffstats
path: root/arch/x86/boot/video.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-01-30 13:33:02 +0100
committerIngo Molnar <mingo@elte.hu>2008-01-30 13:33:02 +0100
commit1cac5004e953506166e980da5776d5cc1c176d79 (patch)
treeda90c8870839b0445b45b39b473c8715afc31424 /arch/x86/boot/video.c
parent02a7b425e82cd0052e5eaedbae81a522c6aae6c4 (diff)
downloadblackbird-op-linux-1cac5004e953506166e980da5776d5cc1c176d79.tar.gz
blackbird-op-linux-1cac5004e953506166e980da5776d5cc1c176d79.zip
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.c33
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)
struct mode_info *mi;
char ch;
int i;
+ int nmodes;
+ int modes_per_line;
+ int col;
- puts("Mode: COLSxROWS:\n");
+ nmodes = 0;
+ for (card = video_cards; card < video_cards_end; card++)
+ nmodes += card->nmodes;
+ modes_per_line = 1;
+ if (nmodes >= 20)
+ modes_per_line = 3;
+
+ for (col = 0; col < modes_per_line; col++)
+ puts("Mode: Resolution: Type: ");
+ putchar('\n');
+
+ col = 0;
ch = '0';
for (card = video_cards; card < video_cards_end; card++) {
mi = card->modes;
for (i = 0; i < card->nmodes; i++, mi++) {
+ char resbuf[32];
int visible = mi->x && mi->y;
u16 mode_id = mi->mode ? mi->mode :
(mi->y << 8)+mi->x;
@@ -307,8 +322,18 @@ static void display_menu(void)
if (!visible)
continue; /* Hidden mode */
- printf("%c %04X %3dx%-3d %s\n",
- ch, mode_id, mi->x, mi->y, card->card_name);
+ if (mi->depth)
+ sprintf(resbuf, "%dx%d", mi->y, mi->depth);
+ else
+ sprintf(resbuf, "%d", mi->y);
+
+ printf("%c %03X %4dx%-7s %-6s",
+ ch, mode_id, mi->x, resbuf, card->card_name);
+ col++;
+ if (col >= modes_per_line) {
+ putchar('\n');
+ col = 0;
+ }
if (ch == '9')
ch = 'a';
@@ -318,6 +343,8 @@ static void display_menu(void)
ch++;
}
}
+ if (col)
+ putchar('\n');
}
#define H(x) ((x)-'a'+10)
OpenPOWER on IntegriCloud