Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16949
b: refs/heads/master
c: 53dbb26
h: refs/heads/master
i:
  16947: b07f034
v: v3
  • Loading branch information
Antonino A. Daplas authored and Linus Torvalds committed Jan 9, 2006
1 parent f189fe9 commit 5ed7b04
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 954de9141e75cf2f1ce69ccdbedc83ec827a01ec
refs/heads/master: 53dbb26dbcf0d844967677633d7587c1d34740d5
28 changes: 21 additions & 7 deletions trunk/drivers/video/console/vgacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@
static DEFINE_SPINLOCK(vga_lock);
static int cursor_size_lastfrom;
static int cursor_size_lastto;
static u32 vgacon_xres;
static u32 vgacon_yres;
static struct vgastate state;

#define BLANK 0x0020
Expand All @@ -69,7 +71,7 @@ static struct vgastate state;
* appear.
*/
#undef TRIDENT_GLITCH

#define VGA_FONTWIDTH 8 /* VGA does not support fontwidths != 8 */
/*
* Interface used by the world
*/
Expand Down Expand Up @@ -325,6 +327,10 @@ static const char __init *vgacon_startup(void)
vga_scan_lines =
vga_video_font_height * vga_video_num_lines;
}

vgacon_xres = ORIG_VIDEO_COLS * VGA_FONTWIDTH;
vgacon_yres = vga_scan_lines;

return display_desc;
}

Expand Down Expand Up @@ -513,6 +519,8 @@ static int vgacon_doresize(struct vc_data *c,
if (max_scan & 0x80)
scanlines <<= 1;

vgacon_xres = width * VGA_FONTWIDTH;
vgacon_yres = height * c->vc_font.height;
outb_p(VGA_CRTC_MODE, vga_video_port_reg);
mode = inb_p(vga_video_port_val);

Expand Down Expand Up @@ -557,6 +565,10 @@ static int vgacon_doresize(struct vc_data *c,

static int vgacon_switch(struct vc_data *c)
{
int x = c->vc_cols * VGA_FONTWIDTH;
int y = c->vc_rows * c->vc_font.height;
int rows = ORIG_VIDEO_LINES * vga_default_font_height/
c->vc_font.height;
/*
* We need to save screen size here as it's the only way
* we can spot the screen has been resized and we need to
Expand All @@ -572,10 +584,11 @@ static int vgacon_switch(struct vc_data *c)
scr_memcpyw((u16 *) c->vc_origin, (u16 *) c->vc_screenbuf,
c->vc_screenbuf_size > vga_vram_size ?
vga_vram_size : c->vc_screenbuf_size);
if (!(vga_video_num_columns % 2) &&
vga_video_num_columns <= ORIG_VIDEO_COLS &&
vga_video_num_lines <= (ORIG_VIDEO_LINES *
vga_default_font_height) / c->vc_font.height)

if ((vgacon_xres != x || vgacon_yres != y) &&
(!(vga_video_num_columns % 2) &&
vga_video_num_columns <= ORIG_VIDEO_COLS &&
vga_video_num_lines <= rows))
vgacon_doresize(c, c->vc_cols, c->vc_rows);
}

Expand Down Expand Up @@ -999,7 +1012,8 @@ static int vgacon_font_set(struct vc_data *c, struct console_font *font, unsigne
if (vga_video_type < VIDEO_TYPE_EGAM)
return -EINVAL;

if (font->width != 8 || (charcount != 256 && charcount != 512))
if (font->width != VGA_FONTWIDTH ||
(charcount != 256 && charcount != 512))
return -EINVAL;

rc = vgacon_do_font_op(&state, font->data, 1, charcount == 512);
Expand All @@ -1016,7 +1030,7 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font)
if (vga_video_type < VIDEO_TYPE_EGAM)
return -EINVAL;

font->width = 8;
font->width = VGA_FONTWIDTH;
font->height = c->vc_font.height;
font->charcount = vga_512_chars ? 512 : 256;
if (!font->data)
Expand Down

0 comments on commit 5ed7b04

Please sign in to comment.