From: Aivils S. <ai...@us...> - 2004-08-24 05:32:36
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27075/ruby-2.6/drivers/video/console Modified Files: dummycon.c fbcon.c fbcon.h vgacon.c Log Message: sync to 2.6.8 Index: dummycon.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console/dummycon.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- dummycon.c 17 Jun 2004 10:44:53 -0000 1.6 +++ dummycon.c 24 Aug 2004 05:31:54 -0000 1.7 @@ -79,8 +79,10 @@ .con_bmove = DUMMY, .con_switch = DUMMY, .con_blank = DUMMY, - .con_font_op = DUMMY, - .con_set_palette = DUMMY, + .con_font_set = DUMMY, + .con_font_get = DUMMY, + .con_font_default = DUMMY, + .con_font_copy = DUMMY, .con_scroll = DUMMY, }; Index: fbcon.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console/fbcon.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- fbcon.c 17 Jun 2004 10:44:53 -0000 1.10 +++ fbcon.c 24 Aug 2004 05:31:54 -0000 1.11 @@ -105,7 +105,7 @@ char vt2fb[FB_MAX]; /* VC count per fb device*/ struct display fb_display[MAX_NR_CONSOLES]; -char con2fb_map[MAX_NR_CONSOLES]; +signed char con2fb_map[MAX_NR_CONSOLES]; static int logo_height; static int logo_lines; static int logo_shown = -1; @@ -163,9 +163,10 @@ int height, int width); static int fbcon_switch(struct vc_data *vc); [...1069 lines suppressed...] .con_switch = fbcon_switch, .con_blank = fbcon_blank, - .con_font_op = fbcon_font_op, + .con_font_set = fbcon_set_font, + .con_font_get = fbcon_get_font, + .con_font_default = fbcon_set_def_font, + .con_font_copy = fbcon_copy_font, .con_set_palette = fbcon_set_palette, .con_scroll = fbcon_scroll, .con_set_origin = fbcon_set_origin, @@ -2246,6 +2449,9 @@ case FB_EVENT_RESUME: fbcon_resumed(info); break; + case FB_EVENT_MODE_CHANGE: + fbcon_modechanged(info); + break; case FB_EVENT_ADD_CONSOLE: fbcon_add(info); break; Index: fbcon.h =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console/fbcon.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- fbcon.h 17 Jun 2004 10:44:53 -0000 1.4 +++ fbcon.h 24 Aug 2004 05:31:54 -0000 1.5 @@ -37,7 +37,7 @@ /* drivers/video/console/fbcon.c */ extern char vt2fb[FB_MAX]; -extern char con2fb_map[MAX_NR_CONSOLES]; +extern signed char con2fb_map[MAX_NR_CONSOLES]; extern int set_con2fb_map(int unit, int newidx); /* @@ -68,40 +68,57 @@ * Scroll Method */ -/* Internal flags */ -#define __SCROLL_YPAN 0x001 -#define __SCROLL_YWRAP 0x002 -#define __SCROLL_YMOVE 0x003 -#define __SCROLL_YREDRAW 0x004 -#define __SCROLL_YMASK 0x00f -#define __SCROLL_YFIXED 0x010 -#define __SCROLL_YNOMOVE 0x020 -#define __SCROLL_YPANREDRAW 0x040 -#define __SCROLL_YNOPARTIAL 0x080 - -/* Only these should be used by the drivers */ -/* Which one should you use? If you have a fast card and slow bus, - then probably just 0 to indicate fbcon should choose between - YWRAP/YPAN+MOVE/YMOVE. On the other side, if you have a fast bus - and even better if your card can do fonting (1->8/32bit painting), - you should consider either SCROLL_YREDRAW (if your card is - able to do neither YPAN/YWRAP), or SCROLL_YNOMOVE. - The best is to test it with some real life scrolling (usually, not - all lines on the screen are filled completely with non-space characters, - and REDRAW performs much better on such lines, so don't cat a file - with every line covering all screen columns, it would not be the right - benchmark). +/* There are several methods fbcon can use to move text around the screen: + * + * Operation Pan Wrap + *--------------------------------------------- + * SCROLL_MOVE copyarea No No + * SCROLL_PAN_MOVE copyarea Yes No + * SCROLL_WRAP_MOVE copyarea No Yes + * SCROLL_REDRAW imageblit No No + * SCROLL_PAN_REDRAW imageblit Yes No + * SCROLL_WRAP_REDRAW imageblit No Yes + * + * (SCROLL_WRAP_REDRAW is not implemented yet) + * + * In general, fbcon will choose the best scrolling + * method based on the rule below: + * + * Pan/Wrap > accel imageblit > accel copyarea > + * soft imageblit > (soft copyarea) + * + * Exception to the rule: Pan + accel copyarea is + * preferred over Pan + accel imageblit. + * + * The above is typical for PCI/AGP cards. Unless + * overridden, fbcon will never use soft copyarea. + * + * If you need to override the above rule, set the + * appropriate flags in fb_info->flags. For example, + * to prefer copyarea over imageblit, set + * FBINFO_READS_FAST. + * + * Other notes: + * + use the hardware engine to move the text + * (hw-accelerated copyarea() and fillrect()) + * + use hardware-supported panning on a large virtual screen + * + amifb can not only pan, but also wrap the display by N lines + * (i.e. visible line i = physical line (i+N) % yres). + * + read what's already rendered on the screen and + * write it in a different place (this is cfb_copyarea()) + * + re-render the text to the screen + * + * Whether to use wrapping or panning can only be figured out at + * runtime (when we know whether our font height is a multiple + * of the pan/wrap step) + * */ -#define SCROLL_YREDRAW (__SCROLL_YFIXED|__SCROLL_YREDRAW) -#define SCROLL_YNOMOVE (__SCROLL_YNOMOVE|__SCROLL_YPANREDRAW) -/* SCROLL_YNOPARTIAL, used in combination with the above, is for video - cards which can not handle using panning to scroll a portion of the - screen without excessive flicker. Panning will only be used for - whole screens. - */ -/* Namespace consistency */ -#define SCROLL_YNOPARTIAL __SCROLL_YNOPARTIAL +#define SCROLL_MOVE 0x001 +#define SCROLL_PAN_MOVE 0x002 +#define SCROLL_WRAP_MOVE 0x003 +#define SCROLL_REDRAW 0x004 +#define SCROLL_PAN_REDRAW 0x005 extern int fb_console_init(void); extern const struct consw fb_con; Index: vgacon.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/video/console/vgacon.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- vgacon.c 17 Jun 2004 10:44:53 -0000 1.6 +++ vgacon.c 24 Aug 2004 05:31:54 -0000 1.7 @@ -81,7 +81,6 @@ static void vgacon_cursor(struct vc_data *c, int mode); static int vgacon_switch(struct vc_data *c); static int vgacon_blank(struct vc_data *c, int blank, int mode_switch); -static int vgacon_font_op(struct vc_data *c, struct console_font_op *op); static int vgacon_set_palette(struct vc_data *vc, unsigned char *table); static int vgacon_scroll(struct vc_data *c, int lines); static int vgacon_set_origin(struct vc_data *c); @@ -907,39 +906,44 @@ return 0; } -static int vgacon_font_op(struct vc_data *c, struct console_font_op *op) +static int vgacon_font_set(struct vc_data *c, struct console_font *font, unsigned flags) { + unsigned charcount = font->charcount; int rc; if (vga_video_type < VIDEO_TYPE_EGAM) return -EINVAL; - if (op->op == KD_FONT_OP_SET) { - if (op->width != 8 - || (op->charcount != 256 && op->charcount != 512)) - 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(c, op->height); - } else if (op->op == KD_FONT_OP_GET) { - op->width = 8; - op->height = c->vc_font.height; - op->charcount = vga_512_chars ? 512 : 256; - if (!op->data) - return 0; - rc = vgacon_do_font_op(&state, op->data, 0, 0); - } else - rc = -ENOSYS; + if (font->width != 8 || (charcount != 256 && charcount != 512)) + return -EINVAL; + + rc = vgacon_do_font_op(&state, font->data, 1, charcount == 512); + if (rc) + return rc; + + if (!(flags & KD_FONT_FLAG_DONT_RECALC)) + rc = vgacon_adjust_height(c, font->height); return rc; } -#else - -static int vgacon_font_op(struct vc_data *c, struct console_font_op *op) +static int vgacon_font_get(struct vc_data *c, struct console_font *font) { - return -ENOSYS; + if (vga_video_type < VIDEO_TYPE_EGAM) + return -EINVAL; + + font->width = 8; + font->height = c->vc_font.height; + font->charcount = vga_512_chars ? 512 : 256; + if (!font->data) + return 0; + return vgacon_do_font_op(&state, font->data, 0, 0); } +#else + +#define vgacon_font_set NULL +#define vgacon_font_get NULL + #endif static int vgacon_scroll(struct vc_data *c, int lines) @@ -962,6 +966,8 @@ p = (c->vc_visible_origin - vga_vram_base - ul + we) % we + lines * c->vc_size_row; st = (c->vc_origin - vga_vram_base - ul + we) % we; + if (st < 2 * margin) + margin = 0; if (p < margin) p = 0; if (p > st - margin) @@ -1065,7 +1071,8 @@ .con_bmove = DUMMY, .con_switch = vgacon_switch, .con_blank = vgacon_blank, - .con_font_op = vgacon_font_op, + .con_font_set = vgacon_font_set, + .con_font_get = vgacon_font_get, .con_set_palette = vgacon_set_palette, .con_scroll = vgacon_scroll, .con_set_origin = vgacon_set_origin, |