diff options
Diffstat (limited to 'drivers/video/console/vgacon.c')
-rw-r--r-- | drivers/video/console/vgacon.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index a5698714d43d..f65bcd314d54 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c | |||
@@ -362,7 +362,7 @@ static const char *vgacon_startup(void) | |||
362 | u16 saved1, saved2; | 362 | u16 saved1, saved2; |
363 | volatile u16 *p; | 363 | volatile u16 *p; |
364 | 364 | ||
365 | if (ORIG_VIDEO_ISVGA == VIDEO_TYPE_VLFB) { | 365 | if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB) { |
366 | no_vga: | 366 | no_vga: |
367 | #ifdef CONFIG_DUMMY_CONSOLE | 367 | #ifdef CONFIG_DUMMY_CONSOLE |
368 | conswitchp = &dummy_con; | 368 | conswitchp = &dummy_con; |
@@ -373,28 +373,29 @@ static const char *vgacon_startup(void) | |||
373 | } | 373 | } |
374 | 374 | ||
375 | /* boot_params.screen_info initialized? */ | 375 | /* boot_params.screen_info initialized? */ |
376 | if ((ORIG_VIDEO_MODE == 0) && | 376 | if ((screen_info.orig_video_mode == 0) && |
377 | (ORIG_VIDEO_LINES == 0) && | 377 | (screen_info.orig_video_lines == 0) && |
378 | (ORIG_VIDEO_COLS == 0)) | 378 | (screen_info.orig_video_cols == 0)) |
379 | goto no_vga; | 379 | goto no_vga; |
380 | 380 | ||
381 | /* VGA16 modes are not handled by VGACON */ | 381 | /* VGA16 modes are not handled by VGACON */ |
382 | if ((ORIG_VIDEO_MODE == 0x0D) || /* 320x200/4 */ | 382 | if ((screen_info.orig_video_mode == 0x0D) || /* 320x200/4 */ |
383 | (ORIG_VIDEO_MODE == 0x0E) || /* 640x200/4 */ | 383 | (screen_info.orig_video_mode == 0x0E) || /* 640x200/4 */ |
384 | (ORIG_VIDEO_MODE == 0x10) || /* 640x350/4 */ | 384 | (screen_info.orig_video_mode == 0x10) || /* 640x350/4 */ |
385 | (ORIG_VIDEO_MODE == 0x12) || /* 640x480/4 */ | 385 | (screen_info.orig_video_mode == 0x12) || /* 640x480/4 */ |
386 | (ORIG_VIDEO_MODE == 0x6A)) /* 800x600/4, 0x6A is very common */ | 386 | (screen_info.orig_video_mode == 0x6A)) /* 800x600/4 (VESA) */ |
387 | goto no_vga; | 387 | goto no_vga; |
388 | 388 | ||
389 | vga_video_num_lines = ORIG_VIDEO_LINES; | 389 | vga_video_num_lines = screen_info.orig_video_lines; |
390 | vga_video_num_columns = ORIG_VIDEO_COLS; | 390 | vga_video_num_columns = screen_info.orig_video_cols; |
391 | state.vgabase = NULL; | 391 | state.vgabase = NULL; |
392 | 392 | ||
393 | if (ORIG_VIDEO_MODE == 7) { /* Is this a monochrome display? */ | 393 | if (screen_info.orig_video_mode == 7) { |
394 | /* Monochrome display */ | ||
394 | vga_vram_base = 0xb0000; | 395 | vga_vram_base = 0xb0000; |
395 | vga_video_port_reg = VGA_CRT_IM; | 396 | vga_video_port_reg = VGA_CRT_IM; |
396 | vga_video_port_val = VGA_CRT_DM; | 397 | vga_video_port_val = VGA_CRT_DM; |
397 | if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) { | 398 | if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) { |
398 | static struct resource ega_console_resource = | 399 | static struct resource ega_console_resource = |
399 | { .name = "ega", .start = 0x3B0, .end = 0x3BF }; | 400 | { .name = "ega", .start = 0x3B0, .end = 0x3BF }; |
400 | vga_video_type = VIDEO_TYPE_EGAM; | 401 | vga_video_type = VIDEO_TYPE_EGAM; |
@@ -422,12 +423,12 @@ static const char *vgacon_startup(void) | |||
422 | vga_vram_base = 0xb8000; | 423 | vga_vram_base = 0xb8000; |
423 | vga_video_port_reg = VGA_CRT_IC; | 424 | vga_video_port_reg = VGA_CRT_IC; |
424 | vga_video_port_val = VGA_CRT_DC; | 425 | vga_video_port_val = VGA_CRT_DC; |
425 | if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) { | 426 | if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) { |
426 | int i; | 427 | int i; |
427 | 428 | ||
428 | vga_vram_size = 0x8000; | 429 | vga_vram_size = 0x8000; |
429 | 430 | ||
430 | if (!ORIG_VIDEO_ISVGA) { | 431 | if (!screen_info.orig_video_isVGA) { |
431 | static struct resource ega_console_resource | 432 | static struct resource ega_console_resource |
432 | = { .name = "ega", .start = 0x3C0, .end = 0x3DF }; | 433 | = { .name = "ega", .start = 0x3C0, .end = 0x3DF }; |
433 | vga_video_type = VIDEO_TYPE_EGAC; | 434 | vga_video_type = VIDEO_TYPE_EGAC; |
@@ -521,14 +522,14 @@ static const char *vgacon_startup(void) | |||
521 | || vga_video_type == VIDEO_TYPE_VGAC | 522 | || vga_video_type == VIDEO_TYPE_VGAC |
522 | || vga_video_type == VIDEO_TYPE_EGAM) { | 523 | || vga_video_type == VIDEO_TYPE_EGAM) { |
523 | vga_hardscroll_enabled = vga_hardscroll_user_enable; | 524 | vga_hardscroll_enabled = vga_hardscroll_user_enable; |
524 | vga_default_font_height = ORIG_VIDEO_POINTS; | 525 | vga_default_font_height = screen_info.orig_video_points; |
525 | vga_video_font_height = ORIG_VIDEO_POINTS; | 526 | vga_video_font_height = screen_info.orig_video_points; |
526 | /* This may be suboptimal but is a safe bet - go with it */ | 527 | /* This may be suboptimal but is a safe bet - go with it */ |
527 | vga_scan_lines = | 528 | vga_scan_lines = |
528 | vga_video_font_height * vga_video_num_lines; | 529 | vga_video_font_height * vga_video_num_lines; |
529 | } | 530 | } |
530 | 531 | ||
531 | vgacon_xres = ORIG_VIDEO_COLS * VGA_FONTWIDTH; | 532 | vgacon_xres = screen_info.orig_video_cols * VGA_FONTWIDTH; |
532 | vgacon_yres = vga_scan_lines; | 533 | vgacon_yres = vga_scan_lines; |
533 | 534 | ||
534 | if (!vga_init_done) { | 535 | if (!vga_init_done) { |
@@ -798,7 +799,7 @@ static int vgacon_switch(struct vc_data *c) | |||
798 | { | 799 | { |
799 | int x = c->vc_cols * VGA_FONTWIDTH; | 800 | int x = c->vc_cols * VGA_FONTWIDTH; |
800 | int y = c->vc_rows * c->vc_font.height; | 801 | int y = c->vc_rows * c->vc_font.height; |
801 | int rows = ORIG_VIDEO_LINES * vga_default_font_height/ | 802 | int rows = screen_info.orig_video_lines * vga_default_font_height/ |
802 | c->vc_font.height; | 803 | c->vc_font.height; |
803 | /* | 804 | /* |
804 | * We need to save screen size here as it's the only way | 805 | * We need to save screen size here as it's the only way |
@@ -818,7 +819,7 @@ static int vgacon_switch(struct vc_data *c) | |||
818 | 819 | ||
819 | if ((vgacon_xres != x || vgacon_yres != y) && | 820 | if ((vgacon_xres != x || vgacon_yres != y) && |
820 | (!(vga_video_num_columns % 2) && | 821 | (!(vga_video_num_columns % 2) && |
821 | vga_video_num_columns <= ORIG_VIDEO_COLS && | 822 | vga_video_num_columns <= screen_info.orig_video_cols && |
822 | vga_video_num_lines <= rows)) | 823 | vga_video_num_lines <= rows)) |
823 | vgacon_doresize(c, c->vc_cols, c->vc_rows); | 824 | vgacon_doresize(c, c->vc_cols, c->vc_rows); |
824 | } | 825 | } |
@@ -1280,8 +1281,8 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font) | |||
1280 | static int vgacon_resize(struct vc_data *c, unsigned int width, | 1281 | static int vgacon_resize(struct vc_data *c, unsigned int width, |
1281 | unsigned int height, unsigned int user) | 1282 | unsigned int height, unsigned int user) |
1282 | { | 1283 | { |
1283 | if (width % 2 || width > ORIG_VIDEO_COLS || | 1284 | if (width % 2 || width > screen_info.orig_video_cols || |
1284 | height > (ORIG_VIDEO_LINES * vga_default_font_height)/ | 1285 | height > (screen_info.orig_video_lines * vga_default_font_height)/ |
1285 | c->vc_font.height) | 1286 | c->vc_font.height) |
1286 | /* let svgatextmode tinker with video timings and | 1287 | /* let svgatextmode tinker with video timings and |
1287 | return success */ | 1288 | return success */ |
@@ -1313,8 +1314,8 @@ static void vgacon_save_screen(struct vc_data *c) | |||
1313 | * console initialization routines. | 1314 | * console initialization routines. |
1314 | */ | 1315 | */ |
1315 | vga_bootup_console = 1; | 1316 | vga_bootup_console = 1; |
1316 | c->vc_x = ORIG_X; | 1317 | c->vc_x = screen_info.orig_x; |
1317 | c->vc_y = ORIG_Y; | 1318 | c->vc_y = screen_info.orig_y; |
1318 | } | 1319 | } |
1319 | 1320 | ||
1320 | /* We can't copy in more then the size of the video buffer, | 1321 | /* We can't copy in more then the size of the video buffer, |