diff options
Diffstat (limited to 'drivers/video/console')
-rw-r--r-- | drivers/video/console/Kconfig | 2 | ||||
-rw-r--r-- | drivers/video/console/bitblit.c | 14 | ||||
-rw-r--r-- | drivers/video/console/fbcon.c | 83 | ||||
-rw-r--r-- | drivers/video/console/fbcon.h | 11 | ||||
-rw-r--r-- | drivers/video/console/fbcon_ccw.c | 17 | ||||
-rw-r--r-- | drivers/video/console/fbcon_cw.c | 17 | ||||
-rw-r--r-- | drivers/video/console/fbcon_rotate.c | 9 | ||||
-rw-r--r-- | drivers/video/console/fbcon_rotate.h | 2 | ||||
-rw-r--r-- | drivers/video/console/fbcon_ud.c | 19 | ||||
-rw-r--r-- | drivers/video/console/softcursor.c | 2 | ||||
-rw-r--r-- | drivers/video/console/tileblit.c | 17 | ||||
-rw-r--r-- | drivers/video/console/vgacon.c | 36 |
12 files changed, 118 insertions, 111 deletions
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig index a5d09e159cd..6ee449858a5 100644 --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig @@ -6,7 +6,7 @@ menu "Console display driver support" config VGA_CONSOLE bool "VGA text console" if EMBEDDED || !X86 - depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC && !M68K && !PARISC && !ARCH_VERSATILE + depends on !ARCH_ACORN && !ARCH_EBSA110 && !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !ARCH_VERSATILE default y help Saying Y here will allow you to use Linux in text mode through a diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c index e65fc3ef763..eea422eb1ab 100644 --- a/drivers/video/console/bitblit.c +++ b/drivers/video/console/bitblit.c @@ -234,14 +234,14 @@ static void bit_clear_margins(struct vc_data *vc, struct fb_info *info, } } -static void bit_cursor(struct vc_data *vc, struct fb_info *info, - struct display *p, int mode, int softback_lines, int fg, int bg) +static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode, + int softback_lines, int fg, int bg) { struct fb_cursor cursor; - struct fbcon_ops *ops = (struct fbcon_ops *) info->fbcon_par; + struct fbcon_ops *ops = info->fbcon_par; unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; int w = (vc->vc_font.width + 7) >> 3, c; - int y = real_y(p, vc->vc_y); + int y = real_y(ops->p, vc->vc_y); int attribute, use_sw = (vc->vc_cursor_type & 0x10); int err = 1; char *src; @@ -310,7 +310,7 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, } if (cursor.set & FB_CUR_SETSIZE || - vc->vc_cursor_type != p->cursor_shape || + vc->vc_cursor_type != ops->p->cursor_shape || ops->cursor_state.mask == NULL || ops->cursor_reset) { char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC); @@ -323,10 +323,10 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, kfree(ops->cursor_state.mask); ops->cursor_state.mask = mask; - p->cursor_shape = vc->vc_cursor_type; + ops->p->cursor_shape = vc->vc_cursor_type; cursor.set |= FB_CUR_SETSHAPE; - switch (p->cursor_shape & CUR_HWMASK) { + switch (ops->p->cursor_shape & CUR_HWMASK) { case CUR_NONE: cur_height = 0; break; diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index 3660e51b261..041d0698786 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c @@ -209,13 +209,13 @@ static irqreturn_t fb_vbl_detect(int irq, void *dummy, struct pt_regs *fp) #endif #ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION -static inline void fbcon_set_rotation(struct fb_info *info, struct display *p) +static inline void fbcon_set_rotation(struct fb_info *info) { struct fbcon_ops *ops = info->fbcon_par; if (!(info->flags & FBINFO_MISC_TILEBLITTING) && - p->con_rotate < 4) - ops->rotate = p->con_rotate; + ops->p->con_rotate < 4) + ops->rotate = ops->p->con_rotate; else ops->rotate = 0; } @@ -265,7 +265,7 @@ static void fbcon_rotate_all(struct fb_info *info, u32 rotate) fbcon_set_all_vcs(info); } #else -static inline void fbcon_set_rotation(struct fb_info *info, struct display *p) +static inline void fbcon_set_rotation(struct fb_info *info) { struct fbcon_ops *ops = info->fbcon_par; @@ -402,7 +402,7 @@ static void fb_flashcursor(void *private) c = scr_readw((u16 *) vc->vc_pos); mode = (!ops->cursor_flash || ops->cursor_state.enable) ? CM_ERASE : CM_DRAW; - ops->cursor(vc, info, p, mode, softback_lines, get_color(vc, info, c, 1), + ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1), get_color(vc, info, c, 0)); release_console_sem(); } @@ -647,29 +647,27 @@ static void fbcon_prepare_logo(struct vc_data *vc, struct fb_info *info, } #ifdef CONFIG_FB_TILEBLITTING -static void set_blitting_type(struct vc_data *vc, struct fb_info *info, - struct display *p) +static void set_blitting_type(struct vc_data *vc, struct fb_info *info) { struct fbcon_ops *ops = info->fbcon_par; - ops->p = (p) ? p : &fb_display[vc->vc_num]; + ops->p = &fb_display[vc->vc_num]; if ((info->flags & FBINFO_MISC_TILEBLITTING)) - fbcon_set_tileops(vc, info, p, ops); + fbcon_set_tileops(vc, info); else { - fbcon_set_rotation(info, ops->p); + fbcon_set_rotation(info); fbcon_set_bitops(ops); } } #else -static void set_blitting_type(struct vc_data *vc, struct fb_info *info, - struct display *p) +static void set_blitting_type(struct vc_data *vc, struct fb_info *info) { struct fbcon_ops *ops = info->fbcon_par; info->flags &= ~FBINFO_MISC_TILEBLITTING; - ops->p = (p) ? p : &fb_display[vc->vc_num]; - fbcon_set_rotation(info, ops->p); + ops->p = &fb_display[vc->vc_num]; + fbcon_set_rotation(info); fbcon_set_bitops(ops); } #endif /* CONFIG_MISC_TILEBLITTING */ @@ -689,15 +687,14 @@ static int con2fb_acquire_newinfo(struct vc_data *vc, struct fb_info *info, err = -ENODEV; if (!err) { - ops = kmalloc(sizeof(struct fbcon_ops), GFP_KERNEL); + ops = kzalloc(sizeof(struct fbcon_ops), GFP_KERNEL); if (!ops) err = -ENOMEM; } if (!err) { - memset(ops, 0, sizeof(struct fbcon_ops)); info->fbcon_par = ops; - set_blitting_type(vc, info, NULL); + set_blitting_type(vc, info); } if (err) { @@ -921,19 +918,18 @@ static const char *fbcon_startup(void) return NULL; } - ops = kmalloc(sizeof(struct fbcon_ops), GFP_KERNEL); + ops = kzalloc(sizeof(struct fbcon_ops), GFP_KERNEL); if (!ops) { module_put(owner); return NULL; } - memset(ops, 0, sizeof(struct fbcon_ops)); ops->currcon = -1; ops->graphics = 1; ops->cur_rotate = -1; info->fbcon_par = ops; p->con_rotate = rotate; - set_blitting_type(vc, info, NULL); + set_blitting_type(vc, info); if (info->fix.type != FB_TYPE_TEXT) { if (fbcon_softback_size) { @@ -1093,7 +1089,7 @@ static void fbcon_init(struct vc_data *vc, int init) ops = info->fbcon_par; p->con_rotate = rotate; - set_blitting_type(vc, info, NULL); + set_blitting_type(vc, info); cols = vc->vc_cols; rows = vc->vc_rows; @@ -1110,7 +1106,7 @@ static void fbcon_init(struct vc_data *vc, int init) * * We need to do it in fbcon_init() to prevent screen corruption. */ - if (CON_IS_VISIBLE(vc)) { + if (CON_IS_VISIBLE(vc) && vc->vc_mode == KD_TEXT) { if (info->fbops->fb_set_par && !(ops->flags & FBCON_FLAGS_INIT)) info->fbops->fb_set_par(info); @@ -1141,9 +1137,9 @@ static void fbcon_init(struct vc_data *vc, int init) if (vc == svc && softback_buf) fbcon_update_softback(vc); - if (ops->rotate_font && ops->rotate_font(info, vc, p)) { + if (ops->rotate_font && ops->rotate_font(info, vc)) { ops->rotate = FB_ROTATE_UR; - set_blitting_type(vc, info, p); + set_blitting_type(vc, info); } } @@ -1243,7 +1239,6 @@ static void fbcon_cursor(struct vc_data *vc, int mode) { struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; - struct display *p = &fb_display[vc->vc_num]; int y; int c = scr_readw((u16 *) vc->vc_pos); @@ -1260,7 +1255,7 @@ static void fbcon_cursor(struct vc_data *vc, int mode) y = 0; } - ops->cursor(vc, info, p, mode, y, get_color(vc, info, c, 1), + ops->cursor(vc, info, mode, y, get_color(vc, info, c, 1), get_color(vc, info, c, 0)); vbl_cursor_cnt = CURSOR_DRAW_DELAY; } @@ -1411,16 +1406,13 @@ static __inline__ void ypan_up_redraw(struct vc_data *vc, int t, int count) struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; struct display *p = &fb_display[vc->vc_num]; - int redraw = 0; p->yscroll += count; + if (p->yscroll > p->vrows - vc->vc_rows) { p->yscroll -= p->vrows - vc->vc_rows; - redraw = 1; - } - - if (redraw) fbcon_redraw_move(vc, p, t + count, vc->vc_rows - count, t); + } ops->var.xoffset = 0; ops->var.yoffset = p->yscroll * vc->vc_font.height; @@ -1462,16 +1454,13 @@ static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int count) struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; struct fbcon_ops *ops = info->fbcon_par; struct display *p = &fb_display[vc->vc_num]; - int redraw = 0; p->yscroll -= count; + if (p->yscroll < 0) { p->yscroll += p->vrows - vc->vc_rows; - redraw = 1; - } - - if (redraw) fbcon_redraw_move(vc, p, t, vc->vc_rows - count, t + count); + } ops->var.xoffset = 0; ops->var.yoffset = p->yscroll * vc->vc_font.height; @@ -1968,7 +1957,8 @@ static __inline__ void updatescrollmode(struct display *p, divides(ypan, vc->vc_font.height) && vyres > yres; int good_wrap = (cap & FBINFO_HWACCEL_YWRAP) && divides(ywrap, vc->vc_font.height) && - divides(vc->vc_font.height, vyres); + divides(vc->vc_font.height, vyres) && + divides(vc->vc_font.height, yres); int reading_fast = cap & FBINFO_READS_FAST; int fast_copyarea = (cap & FBINFO_HWACCEL_COPYAREA) && !(cap & FBINFO_HWACCEL_DISABLED); @@ -2107,16 +2097,19 @@ static int fbcon_switch(struct vc_data *vc) info->flags & FBINFO_MISC_ALWAYS_SETPAR)) { if (info->fbops->fb_set_par) info->fbops->fb_set_par(info); - fbcon_del_cursor_timer(old_info); - fbcon_add_cursor_timer(info); + + if (old_info != info) { + fbcon_del_cursor_timer(old_info); + fbcon_add_cursor_timer(info); + } } - set_blitting_type(vc, info, p); + set_blitting_type(vc, info); ops->cursor_reset = 1; - if (ops->rotate_font && ops->rotate_font(info, vc, p)) { + if (ops->rotate_font && ops->rotate_font(info, vc)) { ops->rotate = FB_ROTATE_UR; - set_blitting_type(vc, info, p); + set_blitting_type(vc, info); } vc->vc_can_do_color = (fb_get_color_depth(&info->var, &info->fix)!=1); @@ -2739,7 +2732,7 @@ static void fbcon_modechanged(struct fb_info *info) return; p = &fb_display[vc->vc_num]; - set_blitting_type(vc, info, p); + set_blitting_type(vc, info); if (CON_IS_VISIBLE(vc)) { var_to_display(p, &info->var, info); @@ -2781,7 +2774,7 @@ static void fbcon_set_all_vcs(struct fb_info *info) continue; p = &fb_display[vc->vc_num]; - set_blitting_type(vc, info, p); + set_blitting_type(vc, info); var_to_display(p, &info->var, info); cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); @@ -2806,6 +2799,8 @@ static void fbcon_set_all_vcs(struct fb_info *info) fbcon_update_softback(vc); } } + + ops->p = &fb_display[ops->currcon]; } static int fbcon_mode_deleted(struct fb_info *info, diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h index 6892e7ff34d..c38c3d8e7a7 100644 --- a/drivers/video/console/fbcon.h +++ b/drivers/video/console/fbcon.h @@ -62,12 +62,10 @@ struct fbcon_ops { int fg, int bg); void (*clear_margins)(struct vc_data *vc, struct fb_info *info, int bottom_only); - void (*cursor)(struct vc_data *vc, struct fb_info *info, - struct display *p, int mode, int softback_lines, - int fg, int bg); + void (*cursor)(struct vc_data *vc, struct fb_info *info, int mode, + int softback_lines, int fg, int bg); int (*update_start)(struct fb_info *info); - int (*rotate_font)(struct fb_info *info, struct vc_data *vc, - struct display *p); + int (*rotate_font)(struct fb_info *info, struct vc_data *vc); struct fb_var_screeninfo var; /* copy of the current fb_var_screeninfo */ struct timer_list cursor_timer; /* Cursor timer */ struct fb_cursor cursor_state; @@ -173,8 +171,7 @@ struct fbcon_ops { #define SCROLL_PAN_REDRAW 0x005 #ifdef CONFIG_FB_TILEBLITTING -extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info, - struct display *p, struct fbcon_ops *ops); +extern void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info); #endif extern void fbcon_set_bitops(struct fbcon_ops *ops); extern int soft_cursor(struct fb_info *info, struct fb_cursor *cursor); diff --git a/drivers/video/console/fbcon_ccw.c b/drivers/video/console/fbcon_ccw.c index 4952b66ae20..990289a69b7 100644 --- a/drivers/video/console/fbcon_ccw.c +++ b/drivers/video/console/fbcon_ccw.c @@ -219,19 +219,18 @@ static void ccw_clear_margins(struct vc_data *vc, struct fb_info *info, } } -static void ccw_cursor(struct vc_data *vc, struct fb_info *info, - struct display *p, int mode, int softback_lines, - int fg, int bg) +static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode, + int softback_lines, int fg, int bg) { struct fb_cursor cursor; - struct fbcon_ops *ops = (struct fbcon_ops *) info->fbcon_par; + struct fbcon_ops *ops = info->fbcon_par; unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; int w = (vc->vc_font.height + 7) >> 3, c; - int y = real_y(p, vc->vc_y); + int y = real_y(ops->p, vc->vc_y); int attribute, use_sw = (vc->vc_cursor_type & 0x10); int err = 1, dx, dy; char *src; - u32 vyres = GETVYRES(p->scrollmode, info); + u32 vyres = GETVYRES(ops->p->scrollmode, info); if (!ops->fontbuffer) return; @@ -303,7 +302,7 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, } if (cursor.set & FB_CUR_SETSIZE || - vc->vc_cursor_type != p->cursor_shape || + vc->vc_cursor_type != ops->p->cursor_shape || ops->cursor_state.mask == NULL || ops->cursor_reset) { char *tmp, *mask = kmalloc(w*vc->vc_font.width, GFP_ATOMIC); @@ -323,10 +322,10 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, kfree(ops->cursor_state.mask); ops->cursor_state.mask = mask; - p->cursor_shape = vc->vc_cursor_type; + ops->p->cursor_shape = vc->vc_cursor_type; cursor.set |= FB_CUR_SETSHAPE; - switch (p->cursor_shape & CUR_HWMASK) { + switch (ops->p->cursor_shape & CUR_HWMASK) { case CUR_NONE: cur_height = 0; break; diff --git a/drivers/video/console/fbcon_cw.c b/drivers/video/console/fbcon_cw.c index 6d92b845620..d44c5fa515f 100644 --- a/drivers/video/console/fbcon_cw.c +++ b/drivers/video/console/fbcon_cw.c @@ -203,19 +203,18 @@ static void cw_clear_margins(struct vc_data *vc, struct fb_info *info, } } -static void cw_cursor(struct vc_data *vc, struct fb_info *info, - struct display *p, int mode, int softback_lines, - int fg, int bg) +static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode, + int softback_lines, int fg, int bg) { struct fb_cursor cursor; - struct fbcon_ops *ops = (struct fbcon_ops *) info->fbcon_par; + struct fbcon_ops *ops = info->fbcon_par; unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; int w = (vc->vc_font.height + 7) >> 3, c; - int y = real_y(p, vc->vc_y); + int y = real_y(ops->p, vc->vc_y); int attribute, use_sw = (vc->vc_cursor_type & 0x10); int err = 1, dx, dy; char *src; - u32 vxres = GETVXRES(p->scrollmode, info); + u32 vxres = GETVXRES(ops->p->scrollmode, info); if (!ops->fontbuffer) return; @@ -287,7 +286,7 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, } if (cursor.set & FB_CUR_SETSIZE || - vc->vc_cursor_type != p->cursor_shape || + vc->vc_cursor_type != ops->p->cursor_shape || ops->cursor_state.mask == NULL || ops->cursor_reset) { char *tmp, *mask = kmalloc(w*vc->vc_font.width, GFP_ATOMIC); @@ -307,10 +306,10 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, kfree(ops->cursor_state.mask); ops->cursor_state.mask = mask; - p->cursor_shape = vc->vc_cursor_type; + ops->p->cursor_shape = vc->vc_cursor_type; cursor.set |= FB_CUR_SETSHAPE; - switch (p->cursor_shape & CUR_HWMASK) { + switch (ops->p->cursor_shape & CUR_HWMASK) { case CUR_NONE: cur_height = 0; break; diff --git a/drivers/video/console/fbcon_rotate.c b/drivers/video/console/fbcon_rotate.c index ec0dd8fe241..2dc091fbd5c 100644 --- a/drivers/video/console/fbcon_rotate.c +++ b/drivers/video/console/fbcon_rotate.c @@ -18,8 +18,7 @@ #include "fbcon.h" #include "fbcon_rotate.h" -static int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc, - struct display *p) +static int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc) { struct fbcon_ops *ops = info->fbcon_par; int len, err = 0; @@ -28,12 +27,12 @@ static int fbcon_rotate_font(struct fb_info *info, struct vc_data *vc, u8 *dst; if (vc->vc_font.data == ops->fontdata && - p->con_rotate == ops->cur_rotate) + ops->p->con_rotate == ops->cur_rotate) goto finished; src = ops->fontdata = vc->vc_font.data; - ops->cur_rotate = p->con_rotate; - len = (!p->userfont) ? 256 : FNTCHARCNT(src); + ops->cur_rotate = ops->p->con_rotate; + len = (!ops->p->userfont) ? 256 : FNTCHARCNT(src); s_cellsize = ((vc->vc_font.width + 7)/8) * vc->vc_font.height; d_cellsize = s_cellsize; diff --git a/drivers/video/console/fbcon_rotate.h b/drivers/video/console/fbcon_rotate.h index 1b8f92fdc6a..75be5ce53dc 100644 --- a/drivers/video/console/fbcon_rotate.h +++ b/drivers/video/console/fbcon_rotate.h @@ -11,8 +11,6 @@ #ifndef _FBCON_ROTATE_H #define _FBCON_ROTATE_H -#define FNTCHARCNT(fd) (((int *)(fd))[-3]) - #define GETVYRES(s,i) ({ \ (s == SCROLL_REDRAW || s == SCROLL_MOVE) ? \ (i)->var.yres : (i)->var.yres_virtual; }) diff --git a/drivers/video/console/fbcon_ud.c b/drivers/video/console/fbcon_ud.c index 9dd059e8b64..f56ed068a5b 100644 --- a/drivers/video/console/fbcon_ud.c +++ b/drivers/video/console/fbcon_ud.c @@ -249,20 +249,19 @@ static void ud_clear_margins(struct vc_data *vc, struct fb_info *info, } } -static void ud_cursor(struct vc_data *vc, struct fb_info *info, - struct display *p, int mode, int softback_lines, - int fg, int bg) +static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode, + int softback_lines, int fg, int bg) { struct fb_cursor cursor; - struct fbcon_ops *ops = (struct fbcon_ops *) info->fbcon_par; + struct fbcon_ops *ops = info->fbcon_par; unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; int w = (vc->vc_font.width + 7) >> 3, c; - int y = real_y(p, vc->vc_y); + int y = real_y(ops->p, vc->vc_y); int attribute, use_sw = (vc->vc_cursor_type & 0x10); int err = 1, dx, dy; char *src; - u32 vyres = GETVYRES(p->scrollmode, info); - u32 vxres = GETVXRES(p->scrollmode, info); + u32 vyres = GETVYRES(ops->p->scrollmode, info); + u32 vxres = GETVXRES(ops->p->scrollmode, info); if (!ops->fontbuffer) return; @@ -334,7 +333,7 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, } if (cursor.set & FB_CUR_SETSIZE || - vc->vc_cursor_type != p->cursor_shape || + vc->vc_cursor_type != ops->p->cursor_shape || ops->cursor_state.mask == NULL || ops->cursor_reset) { char *mask = kmalloc(w*vc->vc_font.height, GFP_ATOMIC); @@ -347,10 +346,10 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, kfree(ops->cursor_state.mask); ops->cursor_state.mask = mask; - p->cursor_shape = vc->vc_cursor_type; + ops->p->cursor_shape = vc->vc_cursor_type; cursor.set |= FB_CUR_SETSHAPE; - switch (p->cursor_shape & CUR_HWMASK) { + switch (ops->p->cursor_shape & CUR_HWMASK) { case CUR_NONE: cur_height = 0; break; diff --git a/drivers/video/console/softcursor.c b/drivers/video/console/softcursor.c index 8529bf08db2..3957fc7523e 100644 --- a/drivers/video/console/softcursor.c +++ b/drivers/video/console/softcursor.c @@ -17,6 +17,8 @@ #include <asm/uaccess.h> #include <asm/io.h> +#include "fbcon.h" + int soft_cursor(struct fb_info *info, struct fb_cursor *cursor) { unsigned int scan_align = info->pixmap.scan_align - 1; diff --git a/drivers/video/console/tileblit.c b/drivers/video/console/tileblit.c index cb25324a563..153352ca946 100644 --- a/drivers/video/console/tileblit.c +++ b/drivers/video/console/tileblit.c @@ -80,9 +80,8 @@ static void tile_clear_margins(struct vc_data *vc, struct fb_info *info, return; } -static void tile_cursor(struct vc_data *vc, struct fb_info *info, - struct display *p, int mode, int softback_lines, - int fg, int bg) +static void tile_cursor(struct vc_data *vc, struct fb_info *info, int mode, + int softback_lines, int fg, int bg) { struct fb_tilecursor cursor; int use_sw = (vc->vc_cursor_type & 0x01); @@ -130,10 +129,10 @@ static int tile_update_start(struct fb_info *info) return err; } -void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info, - struct display *p, struct fbcon_ops *ops) +void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info) { struct fb_tilemap map; + struct fbcon_ops *ops = info->fbcon_par; ops->bmove = tile_bmove; ops->clear = tile_clear; @@ -142,13 +141,13 @@ void fbcon_set_tileops(struct vc_data *vc, struct fb_info *info, ops->cursor = tile_cursor; ops->update_start = tile_update_start; - if (p) { + if (ops->p) { map.width = vc->vc_font.width; map.height = vc->vc_font.height; map.depth = 1; - map.length = (p->userfont) ? - FNTCHARCNT(p->fontdata) : 256; - map.data = p->fontdata; + map.length = (ops->p->userfont) ? + FNTCHARCNT(ops->p->fontdata) : 256; + map.data = ops->p->fontdata; info->tileops->fb_settile(info, &map); } } diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 167de397e4b..12d9329d140 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c @@ -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 @@ -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 */ @@ -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; } @@ -503,10 +509,18 @@ static int vgacon_doresize(struct vc_data *c, { unsigned long flags; unsigned int scanlines = height * c->vc_font.height; - u8 scanlines_lo, r7, vsync_end, mode; + u8 scanlines_lo, r7, vsync_end, mode, max_scan; spin_lock_irqsave(&vga_lock, flags); + outb_p(VGA_CRTC_MAX_SCAN, vga_video_port_reg); + max_scan = inb_p(vga_video_port_val); + + 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); @@ -551,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 @@ -566,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); } @@ -993,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); @@ -1010,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) |