aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-17 01:36:04 -0400
committerH. Peter Anvin <hpa@zytor.com>2007-10-17 01:57:17 -0400
commit3ea335100014785fd2518461705654b200e58d00 (patch)
treee8f25757f05c9cb0d97638fc8dc18e5e2ad05dbf
parent30c826451d3e5bbc6e11bba0e7fee5d2f49d9b75 (diff)
Remove magic macros for screen_info structure members
Stop using magic macros for screen_info structure members. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--arch/arm/mach-footbridge/cats-hw.c6
-rw-r--r--drivers/video/console/dummycon.c4
-rw-r--r--drivers/video/console/vgacon.c49
-rw-r--r--drivers/video/intelfb/intelfbdrv.c5
-rw-r--r--drivers/video/vga16fb.c2
-rw-r--r--include/linux/screen_info.h9
6 files changed, 34 insertions, 41 deletions
diff --git a/arch/arm/mach-footbridge/cats-hw.c b/arch/arm/mach-footbridge/cats-hw.c
index ef6ccc8993e9..c261472208cb 100644
--- a/arch/arm/mach-footbridge/cats-hw.c
+++ b/arch/arm/mach-footbridge/cats-hw.c
@@ -78,9 +78,9 @@ static void __init
78fixup_cats(struct machine_desc *desc, struct tag *tags, 78fixup_cats(struct machine_desc *desc, struct tag *tags,
79 char **cmdline, struct meminfo *mi) 79 char **cmdline, struct meminfo *mi)
80{ 80{
81 ORIG_VIDEO_LINES = 25; 81 screen_info.orig_video_lines = 25;
82 ORIG_VIDEO_POINTS = 16; 82 screen_info.orig_video_points = 16;
83 ORIG_Y = 24; 83 screen_info.orig_y = 24;
84} 84}
85 85
86MACHINE_START(CATS, "Chalice-CATS") 86MACHINE_START(CATS, "Chalice-CATS")
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 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)
1280static int vgacon_resize(struct vc_data *c, unsigned int width, 1281static 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
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
index 3ee412bc00ec..ba81ffe9958a 100644
--- a/include/linux/screen_info.h
+++ b/include/linux/screen_info.h
@@ -47,15 +47,6 @@ struct screen_info {
47 47
48extern struct screen_info screen_info; 48extern struct screen_info screen_info;
49 49
50#define ORIG_X (screen_info.orig_x)
51#define ORIG_Y (screen_info.orig_y)
52#define ORIG_VIDEO_MODE (screen_info.orig_video_mode)
53#define ORIG_VIDEO_COLS (screen_info.orig_video_cols)
54#define ORIG_VIDEO_EGA_BX (screen_info.orig_video_ega_bx)
55#define ORIG_VIDEO_LINES (screen_info.orig_video_lines)
56#define ORIG_VIDEO_ISVGA (screen_info.orig_video_isVGA)
57#define ORIG_VIDEO_POINTS (screen_info.orig_video_points)
58
59#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */ 50#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */
60#define VIDEO_TYPE_CGA 0x11 /* CGA Display */ 51#define VIDEO_TYPE_CGA 0x11 /* CGA Display */
61#define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */ 52#define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */