summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/char/vt.c2
-rw-r--r--drivers/char/vt_ioctl.c13
-rw-r--r--drivers/video/console/vgacon.c83
-rw-r--r--include/linux/console_struct.h24
-rw-r--r--include/linux/vt_kern.h5
5 files changed, 61 insertions, 66 deletions
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index d636ca26162c..d3ca088b4d0b 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -3040,8 +3040,6 @@ EXPORT_SYMBOL(color_table);
EXPORT_SYMBOL(default_red);
EXPORT_SYMBOL(default_grn);
EXPORT_SYMBOL(default_blu);
-EXPORT_SYMBOL(video_font_height);
-EXPORT_SYMBOL(video_scan_lines);
EXPORT_SYMBOL(vc_cons_allocated);
EXPORT_SYMBOL(update_region);
EXPORT_SYMBOL(redraw_screen);
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index cda2f20d8308..1da25f082d05 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -63,10 +63,6 @@ unsigned char keyboard_type = KB_101;
asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int on);
#endif
-unsigned int video_font_height;
-unsigned int default_font_height;
-unsigned int video_scan_lines;
-
/*
* these are the valid i/o ports we're allowed to change. they map all the
* video ports
@@ -355,7 +351,8 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
unsigned char ucval;
struct kbd_struct * kbd;
struct vt_struct *vt = (struct vt_struct *)tty->driver_data;
-
+ struct vc_data *vc = vc_cons[vt->vc_num].d;
+
console = vt->vc_num;
if (!vc_cons_allocated(console)) /* impossible? */
@@ -830,7 +827,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
__get_user(clin, &vtconsize->v_clin);
__get_user(vcol, &vtconsize->v_vcol);
__get_user(ccol, &vtconsize->v_ccol);
- vlin = vlin ? vlin : video_scan_lines;
+ vlin = vlin ? vlin : vc->vc_scan_lines;
if (clin) {
if (ll) {
if (ll != vlin/clin)
@@ -850,9 +847,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
return -EINVAL;
if (vlin)
- video_scan_lines = vlin;
+ vc->vc_scan_lines = vlin;
if (clin)
- video_font_height = clin;
+ vc->vc_font.height = clin;
for (i = 0; i < MAX_NR_CONSOLES; i++)
vc_resize(i, cc, ll);
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c
index 34d3080a615b..2e0097307b0e 100644
--- a/drivers/video/console/vgacon.c
+++ b/drivers/video/console/vgacon.c
@@ -91,24 +91,25 @@ static unsigned long vgacon_uni_pagedir[2];
/* Description of the hardware situation */
-static unsigned long vga_vram_base; /* Base of video memory */
-static unsigned long vga_vram_end; /* End of video memory */
-static u16 vga_video_port_reg; /* Video register select port */
-static u16 vga_video_port_val; /* Video register value port */
-static unsigned int vga_video_num_columns; /* Number of text columns */
-static unsigned int vga_video_num_lines; /* Number of text lines */
-static int vga_can_do_color = 0; /* Do we support colors? */
-static unsigned int vga_default_font_height; /* Height of default screen font */
-static unsigned char vga_video_type; /* Card type */
-static unsigned char vga_hardscroll_enabled;
-static unsigned char vga_hardscroll_user_enable = 1;
-static unsigned char vga_font_is_default = 1;
-static int vga_vesa_blanked;
-static int vga_palette_blanked;
-static int vga_is_gfx;
-static int vga_512_chars;
-static int vga_video_font_height;
-static unsigned int vga_rolled_over = 0;
+static unsigned long vga_vram_base; /* Base of video memory */
+static unsigned long vga_vram_end; /* End of video memory */
+static u16 vga_video_port_reg; /* Video register select port */
+static u16 vga_video_port_val; /* Video register value port */
+static unsigned int vga_video_num_columns; /* Number of text columns */
+static unsigned int vga_video_num_lines; /* Number of text lines */
+static int vga_can_do_color = 0; /* Do we support colors? */
+static unsigned int vga_default_font_height;/* Height of default screen font */
+static unsigned char vga_video_type; /* Card type */
+static unsigned char vga_hardscroll_enabled;
+static unsigned char vga_hardscroll_user_enable = 1;
+static unsigned char vga_font_is_default = 1;
+static int vga_vesa_blanked;
+static int vga_palette_blanked;
+static int vga_is_gfx;
+static int vga_512_chars;
+static int vga_video_font_height;
+static int vga_scan_lines;
+static unsigned int vga_rolled_over = 0;
static int __init no_scroll(char *str)
{
@@ -317,11 +318,9 @@ static const char __init *vgacon_startup(void)
vga_default_font_height = ORIG_VIDEO_POINTS;
vga_video_font_height = ORIG_VIDEO_POINTS;
/* This may be suboptimal but is a safe bet - go with it */
- video_scan_lines =
+ vga_scan_lines =
vga_video_font_height * vga_video_num_lines;
}
- video_font_height = vga_video_font_height;
-
return display_desc;
}
@@ -333,6 +332,8 @@ static void vgacon_init(struct vc_data *c, int init)
c->vc_can_do_color = vga_can_do_color;
c->vc_cols = vga_video_num_columns;
c->vc_rows = vga_video_num_lines;
+ c->vc_scan_lines = vga_scan_lines;
+ c->vc_font.height = vga_video_font_height;
c->vc_complement_mask = 0x7700;
p = *c->vc_uni_pagedir_loc;
if (c->vc_uni_pagedir_loc == &c->vc_uni_pagedir ||
@@ -451,32 +452,32 @@ static void vgacon_cursor(struct vc_data *c, int mode)
switch (c->vc_cursor_type & 0x0f) {
case CUR_UNDERLINE:
vgacon_set_cursor_size(c->vc_x,
- video_font_height -
- (video_font_height <
+ c->vc_font.height -
+ (c->vc_font.height <
10 ? 2 : 3),
- video_font_height -
- (video_font_height <
+ c->vc_font.height -
+ (c->vc_font.height <
10 ? 1 : 2));
break;
case CUR_TWO_THIRDS:
vgacon_set_cursor_size(c->vc_x,
- video_font_height / 3,
- video_font_height -
- (video_font_height <
+ c->vc_font.height / 3,
+ c->vc_font.height -
+ (c->vc_font.height <
10 ? 1 : 2));
break;
case CUR_LOWER_THIRD:
vgacon_set_cursor_size(c->vc_x,
- (video_font_height * 2) / 3,
- video_font_height -
- (video_font_height <
+ (c->vc_font.height * 2) / 3,
+ c->vc_font.height -
+ (c->vc_font.height <
10 ? 1 : 2));
break;
case CUR_LOWER_HALF:
vgacon_set_cursor_size(c->vc_x,
- video_font_height / 2,
- video_font_height -
- (video_font_height <
+ c->vc_font.height / 2,
+ c->vc_font.height -
+ (c->vc_font.height <
10 ? 1 : 2));
break;
case CUR_NONE:
@@ -484,7 +485,7 @@ static void vgacon_cursor(struct vc_data *c, int mode)
break;
default:
vgacon_set_cursor_size(c->vc_x, 1,
- video_font_height);
+ c->vc_font.height);
break;
}
break;
@@ -856,17 +857,17 @@ static int vgacon_do_font_op(struct vgastate *state,char *arg,int set,int ch512)
/*
* Adjust the screen to fit a font of a certain height
*/
-static int vgacon_adjust_height(unsigned fontheight)
+static int vgacon_adjust_height(struct vc_data *vc, unsigned fontheight)
{
unsigned char ovr, vde, fsr;
int rows, maxscan, i;
- if (fontheight == vga_video_font_height)
+ if (fontheight == vc->vc_font.height)
return 0;
- vga_video_font_height = video_font_height = fontheight;
+ vc->vc_font.height = fontheight;
- rows = video_scan_lines / fontheight; /* Number of video rows we end up with */
+ rows = vc->vc_scan_lines / fontheight; /* Number of video rows we end up with */
maxscan = rows * fontheight - 1; /* Scan lines to actually display-1 */
/* Reprogram the CRTC for the new font size
@@ -922,10 +923,10 @@ static int vgacon_font_op(struct vc_data *c, struct console_font_op *op)
return -EINVAL;
rc = vgacon_do_font_op(&state, op->data, 1, op->charcount == 512);
if (!rc && !(op->flags & KD_FONT_FLAG_DONT_RECALC))
- rc = vgacon_adjust_height(op->height);
+ rc = vgacon_adjust_height(c, op->height);
} else if (op->op == KD_FONT_OP_GET) {
op->width = 8;
- op->height = vga_video_font_height;
+ op->height = c->vc_font.height;
op->charcount = vga_512_chars ? 512 : 256;
if (!op->data)
return 0;
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
index 153f71db1f38..c18bd026a270 100644
--- a/include/linux/console_struct.h
+++ b/include/linux/console_struct.h
@@ -16,31 +16,36 @@ struct vc_data {
unsigned int vc_cols; /* [#] Console size */
unsigned int vc_rows;
unsigned int vc_size_row; /* Bytes per row */
+ unsigned int vc_scan_lines; /* # of scan lines */
+ unsigned long vc_origin; /* [!] Start of real screen */
+ unsigned long vc_scr_end; /* [!] End of real screen */
+ unsigned long vc_visible_origin; /* [!] Top of visible window */
+ unsigned int vc_top, vc_bottom; /* Scrolling region */
const struct consw *vc_sw;
unsigned short *vc_screenbuf; /* In-memory character/attribute buffer */
unsigned int vc_screenbuf_size;
+ /* attributes for all characters on screen */
unsigned char vc_attr; /* Current attributes */
unsigned char vc_def_color; /* Default colors */
unsigned char vc_color; /* Foreground & background */
unsigned char vc_s_color; /* Saved foreground & background */
unsigned char vc_ulcolor; /* Color for underline mode */
unsigned char vc_halfcolor; /* Color for half intensity mode */
+ /* cursor */
+ unsigned int vc_cursor_type;
unsigned short vc_complement_mask; /* [#] Xor mask for mouse pointer */
+ unsigned short vc_s_complement_mask; /* Saved mouse pointer mask */
+ unsigned int vc_x, vc_y; /* Cursor position */
+ unsigned int vc_saved_x, vc_saved_y;
+ unsigned int vc_pos; /* Cursor address */
+ /* fonts */
unsigned short vc_hi_font_mask; /* [#] Attribute set for upper 256 chars of font or 0 if not supported */
struct console_font_op vc_font; /* Current VC font set */
unsigned short vc_video_erase_char; /* Background erase character */
- unsigned short vc_s_complement_mask; /* Saved mouse pointer mask */
- unsigned int vc_x, vc_y; /* Cursor position */
- unsigned int vc_top, vc_bottom; /* Scrolling region */
+ /* VT terminal data */
unsigned int vc_state; /* Escape sequence parser state */
unsigned int vc_npar,vc_par[NPAR]; /* Parameters of current escape sequence */
struct tty_struct *vc_tty; /* TTY we are attached to */
- unsigned long vc_origin; /* [!] Start of real screen */
- unsigned long vc_scr_end; /* [!] End of real screen */
- unsigned long vc_visible_origin; /* [!] Top of visible window */
- unsigned long vc_pos; /* Cursor address */
- unsigned int vc_saved_x;
- unsigned int vc_saved_y;
/* mode flags */
unsigned int vc_charset : 1; /* Character set G0 / G1 */
unsigned int vc_s_charset : 1; /* Saved character set */
@@ -79,7 +84,6 @@ struct vc_data {
unsigned char vc_saved_G1;
unsigned int vc_bell_pitch; /* Console bell pitch */
unsigned int vc_bell_duration; /* Console bell duration */
- unsigned int vc_cursor_type;
struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
unsigned long vc_uni_pagedir;
unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index d611200c749d..f5605e04656f 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -78,11 +78,6 @@ void con_protect_unimap(int currcons, int rdonly);
int con_copy_unimap(int dstcons, int srccons);
/* vt.c */
-
-extern unsigned int video_font_height;
-extern unsigned int default_font_height;
-extern unsigned int video_scan_lines;
-
void complete_change_console(unsigned int new_console);
int vt_waitactive(int vt);
void change_console(unsigned int);