diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 12:00:30 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-10-17 12:00:30 -0400 |
commit | 5c8e191e8437616a498a8e1cc0af3dd0d32bbff2 (patch) | |
tree | 78ed04467e3bd034eaa9696cdf8d668ba7e16381 /drivers/video | |
parent | cbfee34520666862f8ff539e580c48958fbb7706 (diff) | |
parent | 3ea335100014785fd2518461705654b200e58d00 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup:
Remove magic macros for screen_info structure members
[x86] remove uses of magic macros for boot_params access
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/console/dummycon.c | 4 | ||||
-rw-r--r-- | drivers/video/console/vgacon.c | 51 | ||||
-rw-r--r-- | drivers/video/intelfb/intelfbdrv.c | 5 | ||||
-rw-r--r-- | drivers/video/vga16fb.c | 2 |
4 files changed, 32 insertions, 30 deletions
diff --git a/drivers/video/console/dummycon.c b/drivers/video/console/dummycon.c index d9315d99445f..b63860f7beab 100644 --- a/drivers/video/console/dummycon.c +++ b/drivers/video/console/dummycon.c | |||
@@ -18,8 +18,8 @@ | |||
18 | */ | 18 | */ |
19 | 19 | ||
20 | #if defined(__arm__) | 20 | #if defined(__arm__) |
21 | #define DUMMY_COLUMNS ORIG_VIDEO_COLS | 21 | #define DUMMY_COLUMNS screen_info.orig_video_cols |
22 | #define DUMMY_ROWS ORIG_VIDEO_LINES | 22 | #define DUMMY_ROWS screen_info.orig_video_lines |
23 | #elif defined(__hppa__) | 23 | #elif defined(__hppa__) |
24 | /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */ | 24 | /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */ |
25 | #define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS | 25 | #define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS |
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index e9afb7ebd566..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; |
@@ -372,29 +372,30 @@ static const char *vgacon_startup(void) | |||
372 | #endif | 372 | #endif |
373 | } | 373 | } |
374 | 374 | ||
375 | /* 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, |
diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 0428f211f192..e8e38edb9b5b 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c | |||
@@ -804,7 +804,8 @@ static int __devinit intelfb_pci_register(struct pci_dev *pdev, | |||
804 | if (bailearly == 1) | 804 | if (bailearly == 1) |
805 | bailout(dinfo); | 805 | bailout(dinfo); |
806 | 806 | ||
807 | if (FIXED_MODE(dinfo) && ORIG_VIDEO_ISVGA != VIDEO_TYPE_VLFB) { | 807 | if (FIXED_MODE(dinfo) && |
808 | screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB) { | ||
808 | ERR_MSG("Video mode must be programmed at boot time.\n"); | 809 | ERR_MSG("Video mode must be programmed at boot time.\n"); |
809 | cleanup(dinfo); | 810 | cleanup(dinfo); |
810 | return -ENODEV; | 811 | return -ENODEV; |
@@ -815,7 +816,7 @@ static int __devinit intelfb_pci_register(struct pci_dev *pdev, | |||
815 | 816 | ||
816 | /* Initialise dinfo and related data. */ | 817 | /* Initialise dinfo and related data. */ |
817 | /* If an initial mode was programmed at boot time, get its details. */ | 818 | /* If an initial mode was programmed at boot time, get its details. */ |
818 | if (ORIG_VIDEO_ISVGA == VIDEO_TYPE_VLFB) | 819 | if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB) |
819 | get_initial_mode(dinfo); | 820 | get_initial_mode(dinfo); |
820 | 821 | ||
821 | if (bailearly == 3) | 822 | if (bailearly == 3) |
diff --git a/drivers/video/vga16fb.c b/drivers/video/vga16fb.c index 2a14d28c4163..9b3c5923365e 100644 --- a/drivers/video/vga16fb.c +++ b/drivers/video/vga16fb.c | |||
@@ -1364,7 +1364,7 @@ static int __init vga16fb_probe(struct platform_device *dev) | |||
1364 | par = info->par; | 1364 | par = info->par; |
1365 | 1365 | ||
1366 | mutex_init(&par->open_lock); | 1366 | mutex_init(&par->open_lock); |
1367 | par->isVGA = ORIG_VIDEO_ISVGA; | 1367 | par->isVGA = screen_info.orig_video_isVGA; |
1368 | par->palette_blanked = 0; | 1368 | par->palette_blanked = 0; |
1369 | par->vesa_blanked = 0; | 1369 | par->vesa_blanked = 0; |
1370 | 1370 | ||