Commit 3ea33510 authored by H. Peter Anvin's avatar H. Peter Anvin

Remove magic macros for screen_info structure members

Stop using magic macros for screen_info structure members.
Signed-off-by: default avatarH. Peter Anvin <hpa@zytor.com>
parent 30c82645
...@@ -78,9 +78,9 @@ static void __init ...@@ -78,9 +78,9 @@ static void __init
fixup_cats(struct machine_desc *desc, struct tag *tags, fixup_cats(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi) char **cmdline, struct meminfo *mi)
{ {
ORIG_VIDEO_LINES = 25; screen_info.orig_video_lines = 25;
ORIG_VIDEO_POINTS = 16; screen_info.orig_video_points = 16;
ORIG_Y = 24; screen_info.orig_y = 24;
} }
MACHINE_START(CATS, "Chalice-CATS") MACHINE_START(CATS, "Chalice-CATS")
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
*/ */
#if defined(__arm__) #if defined(__arm__)
#define DUMMY_COLUMNS ORIG_VIDEO_COLS #define DUMMY_COLUMNS screen_info.orig_video_cols
#define DUMMY_ROWS ORIG_VIDEO_LINES #define DUMMY_ROWS screen_info.orig_video_lines
#elif defined(__hppa__) #elif defined(__hppa__)
/* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */ /* set by Kconfig. Use 80x25 for 640x480 and 160x64 for 1280x1024 */
#define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS #define DUMMY_COLUMNS CONFIG_DUMMY_CONSOLE_COLUMNS
......
...@@ -362,7 +362,7 @@ static const char *vgacon_startup(void) ...@@ -362,7 +362,7 @@ static const char *vgacon_startup(void)
u16 saved1, saved2; u16 saved1, saved2;
volatile u16 *p; volatile u16 *p;
if (ORIG_VIDEO_ISVGA == VIDEO_TYPE_VLFB) { if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB) {
no_vga: no_vga:
#ifdef CONFIG_DUMMY_CONSOLE #ifdef CONFIG_DUMMY_CONSOLE
conswitchp = &dummy_con; conswitchp = &dummy_con;
...@@ -373,28 +373,29 @@ static const char *vgacon_startup(void) ...@@ -373,28 +373,29 @@ static const char *vgacon_startup(void)
} }
/* boot_params.screen_info initialized? */ /* boot_params.screen_info initialized? */
if ((ORIG_VIDEO_MODE == 0) && if ((screen_info.orig_video_mode == 0) &&
(ORIG_VIDEO_LINES == 0) && (screen_info.orig_video_lines == 0) &&
(ORIG_VIDEO_COLS == 0)) (screen_info.orig_video_cols == 0))
goto no_vga; goto no_vga;
/* VGA16 modes are not handled by VGACON */ /* VGA16 modes are not handled by VGACON */
if ((ORIG_VIDEO_MODE == 0x0D) || /* 320x200/4 */ if ((screen_info.orig_video_mode == 0x0D) || /* 320x200/4 */
(ORIG_VIDEO_MODE == 0x0E) || /* 640x200/4 */ (screen_info.orig_video_mode == 0x0E) || /* 640x200/4 */
(ORIG_VIDEO_MODE == 0x10) || /* 640x350/4 */ (screen_info.orig_video_mode == 0x10) || /* 640x350/4 */
(ORIG_VIDEO_MODE == 0x12) || /* 640x480/4 */ (screen_info.orig_video_mode == 0x12) || /* 640x480/4 */
(ORIG_VIDEO_MODE == 0x6A)) /* 800x600/4, 0x6A is very common */ (screen_info.orig_video_mode == 0x6A)) /* 800x600/4 (VESA) */
goto no_vga; goto no_vga;
vga_video_num_lines = ORIG_VIDEO_LINES; vga_video_num_lines = screen_info.orig_video_lines;
vga_video_num_columns = ORIG_VIDEO_COLS; vga_video_num_columns = screen_info.orig_video_cols;
state.vgabase = NULL; state.vgabase = NULL;
if (ORIG_VIDEO_MODE == 7) { /* Is this a monochrome display? */ if (screen_info.orig_video_mode == 7) {
/* Monochrome display */
vga_vram_base = 0xb0000; vga_vram_base = 0xb0000;
vga_video_port_reg = VGA_CRT_IM; vga_video_port_reg = VGA_CRT_IM;
vga_video_port_val = VGA_CRT_DM; vga_video_port_val = VGA_CRT_DM;
if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) { if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) {
static struct resource ega_console_resource = static struct resource ega_console_resource =
{ .name = "ega", .start = 0x3B0, .end = 0x3BF }; { .name = "ega", .start = 0x3B0, .end = 0x3BF };
vga_video_type = VIDEO_TYPE_EGAM; vga_video_type = VIDEO_TYPE_EGAM;
...@@ -422,12 +423,12 @@ static const char *vgacon_startup(void) ...@@ -422,12 +423,12 @@ static const char *vgacon_startup(void)
vga_vram_base = 0xb8000; vga_vram_base = 0xb8000;
vga_video_port_reg = VGA_CRT_IC; vga_video_port_reg = VGA_CRT_IC;
vga_video_port_val = VGA_CRT_DC; vga_video_port_val = VGA_CRT_DC;
if ((ORIG_VIDEO_EGA_BX & 0xff) != 0x10) { if ((screen_info.orig_video_ega_bx & 0xff) != 0x10) {
int i; int i;
vga_vram_size = 0x8000; vga_vram_size = 0x8000;
if (!ORIG_VIDEO_ISVGA) { if (!screen_info.orig_video_isVGA) {
static struct resource ega_console_resource static struct resource ega_console_resource
= { .name = "ega", .start = 0x3C0, .end = 0x3DF }; = { .name = "ega", .start = 0x3C0, .end = 0x3DF };
vga_video_type = VIDEO_TYPE_EGAC; vga_video_type = VIDEO_TYPE_EGAC;
...@@ -521,14 +522,14 @@ static const char *vgacon_startup(void) ...@@ -521,14 +522,14 @@ static const char *vgacon_startup(void)
|| vga_video_type == VIDEO_TYPE_VGAC || vga_video_type == VIDEO_TYPE_VGAC
|| vga_video_type == VIDEO_TYPE_EGAM) { || vga_video_type == VIDEO_TYPE_EGAM) {
vga_hardscroll_enabled = vga_hardscroll_user_enable; vga_hardscroll_enabled = vga_hardscroll_user_enable;
vga_default_font_height = ORIG_VIDEO_POINTS; vga_default_font_height = screen_info.orig_video_points;
vga_video_font_height = ORIG_VIDEO_POINTS; vga_video_font_height = screen_info.orig_video_points;
/* This may be suboptimal but is a safe bet - go with it */ /* This may be suboptimal but is a safe bet - go with it */
vga_scan_lines = vga_scan_lines =
vga_video_font_height * vga_video_num_lines; vga_video_font_height * vga_video_num_lines;
} }
vgacon_xres = ORIG_VIDEO_COLS * VGA_FONTWIDTH; vgacon_xres = screen_info.orig_video_cols * VGA_FONTWIDTH;
vgacon_yres = vga_scan_lines; vgacon_yres = vga_scan_lines;
if (!vga_init_done) { if (!vga_init_done) {
...@@ -798,7 +799,7 @@ static int vgacon_switch(struct vc_data *c) ...@@ -798,7 +799,7 @@ static int vgacon_switch(struct vc_data *c)
{ {
int x = c->vc_cols * VGA_FONTWIDTH; int x = c->vc_cols * VGA_FONTWIDTH;
int y = c->vc_rows * c->vc_font.height; int y = c->vc_rows * c->vc_font.height;
int rows = ORIG_VIDEO_LINES * vga_default_font_height/ int rows = screen_info.orig_video_lines * vga_default_font_height/
c->vc_font.height; c->vc_font.height;
/* /*
* We need to save screen size here as it's the only way * 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,7 +819,7 @@ static int vgacon_switch(struct vc_data *c)
if ((vgacon_xres != x || vgacon_yres != y) && if ((vgacon_xres != x || vgacon_yres != y) &&
(!(vga_video_num_columns % 2) && (!(vga_video_num_columns % 2) &&
vga_video_num_columns <= ORIG_VIDEO_COLS && vga_video_num_columns <= screen_info.orig_video_cols &&
vga_video_num_lines <= rows)) vga_video_num_lines <= rows))
vgacon_doresize(c, c->vc_cols, c->vc_rows); vgacon_doresize(c, c->vc_cols, c->vc_rows);
} }
...@@ -1280,8 +1281,8 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font) ...@@ -1280,8 +1281,8 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font)
static int vgacon_resize(struct vc_data *c, unsigned int width, static int vgacon_resize(struct vc_data *c, unsigned int width,
unsigned int height, unsigned int user) unsigned int height, unsigned int user)
{ {
if (width % 2 || width > ORIG_VIDEO_COLS || if (width % 2 || width > screen_info.orig_video_cols ||
height > (ORIG_VIDEO_LINES * vga_default_font_height)/ height > (screen_info.orig_video_lines * vga_default_font_height)/
c->vc_font.height) c->vc_font.height)
/* let svgatextmode tinker with video timings and /* let svgatextmode tinker with video timings and
return success */ return success */
...@@ -1313,8 +1314,8 @@ static void vgacon_save_screen(struct vc_data *c) ...@@ -1313,8 +1314,8 @@ static void vgacon_save_screen(struct vc_data *c)
* console initialization routines. * console initialization routines.
*/ */
vga_bootup_console = 1; vga_bootup_console = 1;
c->vc_x = ORIG_X; c->vc_x = screen_info.orig_x;
c->vc_y = ORIG_Y; c->vc_y = screen_info.orig_y;
} }
/* We can't copy in more then the size of the video buffer, /* We can't copy in more then the size of the video buffer,
......
...@@ -804,7 +804,8 @@ static int __devinit intelfb_pci_register(struct pci_dev *pdev, ...@@ -804,7 +804,8 @@ static int __devinit intelfb_pci_register(struct pci_dev *pdev,
if (bailearly == 1) if (bailearly == 1)
bailout(dinfo); bailout(dinfo);
if (FIXED_MODE(dinfo) && ORIG_VIDEO_ISVGA != VIDEO_TYPE_VLFB) { if (FIXED_MODE(dinfo) &&
screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB) {
ERR_MSG("Video mode must be programmed at boot time.\n"); ERR_MSG("Video mode must be programmed at boot time.\n");
cleanup(dinfo); cleanup(dinfo);
return -ENODEV; return -ENODEV;
...@@ -815,7 +816,7 @@ static int __devinit intelfb_pci_register(struct pci_dev *pdev, ...@@ -815,7 +816,7 @@ static int __devinit intelfb_pci_register(struct pci_dev *pdev,
/* Initialise dinfo and related data. */ /* Initialise dinfo and related data. */
/* If an initial mode was programmed at boot time, get its details. */ /* If an initial mode was programmed at boot time, get its details. */
if (ORIG_VIDEO_ISVGA == VIDEO_TYPE_VLFB) if (screen_info.orig_video_isVGA == VIDEO_TYPE_VLFB)
get_initial_mode(dinfo); get_initial_mode(dinfo);
if (bailearly == 3) if (bailearly == 3)
......
...@@ -1364,7 +1364,7 @@ static int __init vga16fb_probe(struct platform_device *dev) ...@@ -1364,7 +1364,7 @@ static int __init vga16fb_probe(struct platform_device *dev)
par = info->par; par = info->par;
mutex_init(&par->open_lock); mutex_init(&par->open_lock);
par->isVGA = ORIG_VIDEO_ISVGA; par->isVGA = screen_info.orig_video_isVGA;
par->palette_blanked = 0; par->palette_blanked = 0;
par->vesa_blanked = 0; par->vesa_blanked = 0;
......
...@@ -47,15 +47,6 @@ struct screen_info { ...@@ -47,15 +47,6 @@ struct screen_info {
extern struct screen_info screen_info; extern struct screen_info screen_info;
#define ORIG_X (screen_info.orig_x)
#define ORIG_Y (screen_info.orig_y)
#define ORIG_VIDEO_MODE (screen_info.orig_video_mode)
#define ORIG_VIDEO_COLS (screen_info.orig_video_cols)
#define ORIG_VIDEO_EGA_BX (screen_info.orig_video_ega_bx)
#define ORIG_VIDEO_LINES (screen_info.orig_video_lines)
#define ORIG_VIDEO_ISVGA (screen_info.orig_video_isVGA)
#define ORIG_VIDEO_POINTS (screen_info.orig_video_points)
#define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */ #define VIDEO_TYPE_MDA 0x10 /* Monochrome Text Display */
#define VIDEO_TYPE_CGA 0x11 /* CGA Display */ #define VIDEO_TYPE_CGA 0x11 /* CGA Display */
#define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */ #define VIDEO_TYPE_EGAM 0x20 /* EGA/VGA in Monochrome Mode */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment