diff options
Diffstat (limited to 'drivers/video/console')
-rw-r--r-- | drivers/video/console/Kconfig | 16 | ||||
-rw-r--r-- | drivers/video/console/fbcon.c | 53 | ||||
-rw-r--r-- | drivers/video/console/fbcon.h | 2 | ||||
-rw-r--r-- | drivers/video/console/mdacon.c | 2 | ||||
-rw-r--r-- | drivers/video/console/sticon.c | 4 | ||||
-rw-r--r-- | drivers/video/console/vgacon.c | 43 |
6 files changed, 44 insertions, 76 deletions
diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig index 06f87b04f207..2f50a80b413e 100644 --- a/drivers/video/console/Kconfig +++ b/drivers/video/console/Kconfig | |||
@@ -43,22 +43,6 @@ config VGACON_SOFT_SCROLLBACK_SIZE | |||
43 | buffer. Each 64KB will give you approximately 16 80x25 | 43 | buffer. Each 64KB will give you approximately 16 80x25 |
44 | screenfuls of scrollback buffer | 44 | screenfuls of scrollback buffer |
45 | 45 | ||
46 | config VIDEO_SELECT | ||
47 | bool "Video mode selection support" | ||
48 | depends on X86 && VGA_CONSOLE | ||
49 | ---help--- | ||
50 | This enables support for text mode selection on kernel startup. If | ||
51 | you want to take advantage of some high-resolution text mode your | ||
52 | card's BIOS offers, but the traditional Linux utilities like | ||
53 | SVGATextMode don't, you can say Y here and set the mode using the | ||
54 | "vga=" option from your boot loader (lilo or loadlin) or set | ||
55 | "vga=ask" which brings up a video mode menu on kernel startup. (Try | ||
56 | "man bootparam" or see the documentation of your boot loader about | ||
57 | how to pass options to the kernel.) | ||
58 | |||
59 | Read the file <file:Documentation/svga.txt> for more information | ||
60 | about the Video mode selection support. If unsure, say N. | ||
61 | |||
62 | config MDA_CONSOLE | 46 | config MDA_CONSOLE |
63 | depends on !M68K && !PARISC && ISA | 47 | depends on !M68K && !PARISC && ISA |
64 | tristate "MDA text console (dual-headed) (EXPERIMENTAL)" | 48 | tristate "MDA text console (dual-headed) (EXPERIMENTAL)" |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c index c6299e8a041d..64b3d30027b8 100644 --- a/drivers/video/console/fbcon.c +++ b/drivers/video/console/fbcon.c | |||
@@ -1855,8 +1855,6 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, | |||
1855 | struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; | 1855 | struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1856 | struct display *p = &fb_display[vc->vc_num]; | 1856 | struct display *p = &fb_display[vc->vc_num]; |
1857 | int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK; | 1857 | int scroll_partial = info->flags & FBINFO_PARTIAL_PAN_OK; |
1858 | unsigned short saved_ec; | ||
1859 | int ret; | ||
1860 | 1858 | ||
1861 | if (fbcon_is_inactive(vc, info)) | 1859 | if (fbcon_is_inactive(vc, info)) |
1862 | return -EINVAL; | 1860 | return -EINVAL; |
@@ -1869,11 +1867,6 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, | |||
1869 | * whole screen (prevents flicker). | 1867 | * whole screen (prevents flicker). |
1870 | */ | 1868 | */ |
1871 | 1869 | ||
1872 | saved_ec = vc->vc_video_erase_char; | ||
1873 | vc->vc_video_erase_char = vc->vc_scrl_erase_char; | ||
1874 | |||
1875 | ret = 0; | ||
1876 | |||
1877 | switch (dir) { | 1870 | switch (dir) { |
1878 | case SM_UP: | 1871 | case SM_UP: |
1879 | if (count > vc->vc_rows) /* Maximum realistic size */ | 1872 | if (count > vc->vc_rows) /* Maximum realistic size */ |
@@ -1890,9 +1883,9 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, | |||
1890 | scr_memsetw((unsigned short *) (vc->vc_origin + | 1883 | scr_memsetw((unsigned short *) (vc->vc_origin + |
1891 | vc->vc_size_row * | 1884 | vc->vc_size_row * |
1892 | (b - count)), | 1885 | (b - count)), |
1893 | vc->vc_scrl_erase_char, | 1886 | vc->vc_video_erase_char, |
1894 | vc->vc_size_row * count); | 1887 | vc->vc_size_row * count); |
1895 | ret = 1; | 1888 | return 1; |
1896 | break; | 1889 | break; |
1897 | 1890 | ||
1898 | case SCROLL_WRAP_MOVE: | 1891 | case SCROLL_WRAP_MOVE: |
@@ -1962,10 +1955,9 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, | |||
1962 | scr_memsetw((unsigned short *) (vc->vc_origin + | 1955 | scr_memsetw((unsigned short *) (vc->vc_origin + |
1963 | vc->vc_size_row * | 1956 | vc->vc_size_row * |
1964 | (b - count)), | 1957 | (b - count)), |
1965 | vc->vc_scrl_erase_char, | 1958 | vc->vc_video_erase_char, |
1966 | vc->vc_size_row * count); | 1959 | vc->vc_size_row * count); |
1967 | ret = 1; | 1960 | return 1; |
1968 | break; | ||
1969 | } | 1961 | } |
1970 | break; | 1962 | break; |
1971 | 1963 | ||
@@ -1982,9 +1974,9 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, | |||
1982 | scr_memsetw((unsigned short *) (vc->vc_origin + | 1974 | scr_memsetw((unsigned short *) (vc->vc_origin + |
1983 | vc->vc_size_row * | 1975 | vc->vc_size_row * |
1984 | t), | 1976 | t), |
1985 | vc->vc_scrl_erase_char, | 1977 | vc->vc_video_erase_char, |
1986 | vc->vc_size_row * count); | 1978 | vc->vc_size_row * count); |
1987 | ret = 1; | 1979 | return 1; |
1988 | break; | 1980 | break; |
1989 | 1981 | ||
1990 | case SCROLL_WRAP_MOVE: | 1982 | case SCROLL_WRAP_MOVE: |
@@ -2052,15 +2044,12 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, | |||
2052 | scr_memsetw((unsigned short *) (vc->vc_origin + | 2044 | scr_memsetw((unsigned short *) (vc->vc_origin + |
2053 | vc->vc_size_row * | 2045 | vc->vc_size_row * |
2054 | t), | 2046 | t), |
2055 | vc->vc_scrl_erase_char, | 2047 | vc->vc_video_erase_char, |
2056 | vc->vc_size_row * count); | 2048 | vc->vc_size_row * count); |
2057 | ret = 1; | 2049 | return 1; |
2058 | break; | ||
2059 | } | 2050 | } |
2060 | break; | ||
2061 | } | 2051 | } |
2062 | vc->vc_video_erase_char = saved_ec; | 2052 | return 0; |
2063 | return ret; | ||
2064 | } | 2053 | } |
2065 | 2054 | ||
2066 | 2055 | ||
@@ -2400,11 +2389,15 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) | |||
2400 | 2389 | ||
2401 | if (!fbcon_is_inactive(vc, info)) { | 2390 | if (!fbcon_is_inactive(vc, info)) { |
2402 | if (ops->blank_state != blank) { | 2391 | if (ops->blank_state != blank) { |
2392 | int ret = 1; | ||
2393 | |||
2403 | ops->blank_state = blank; | 2394 | ops->blank_state = blank; |
2404 | fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); | 2395 | fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); |
2405 | ops->cursor_flash = (!blank); | 2396 | ops->cursor_flash = (!blank); |
2406 | 2397 | ||
2407 | if (fb_blank(info, blank)) | 2398 | if (info->fbops->fb_blank) |
2399 | ret = info->fbops->fb_blank(blank, info); | ||
2400 | if (ret) | ||
2408 | fbcon_generic_blank(vc, info, blank); | 2401 | fbcon_generic_blank(vc, info, blank); |
2409 | } | 2402 | } |
2410 | 2403 | ||
@@ -2518,9 +2511,6 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, | |||
2518 | c = vc->vc_video_erase_char; | 2511 | c = vc->vc_video_erase_char; |
2519 | vc->vc_video_erase_char = | 2512 | vc->vc_video_erase_char = |
2520 | ((c & 0xfe00) >> 1) | (c & 0xff); | 2513 | ((c & 0xfe00) >> 1) | (c & 0xff); |
2521 | c = vc->vc_scrl_erase_char; | ||
2522 | vc->vc_scrl_erase_char = | ||
2523 | ((c & 0xFE00) >> 1) | (c & 0xFF); | ||
2524 | vc->vc_attr >>= 1; | 2514 | vc->vc_attr >>= 1; |
2525 | } | 2515 | } |
2526 | } else if (!vc->vc_hi_font_mask && cnt == 512) { | 2516 | } else if (!vc->vc_hi_font_mask && cnt == 512) { |
@@ -2551,14 +2541,9 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, | |||
2551 | if (vc->vc_can_do_color) { | 2541 | if (vc->vc_can_do_color) { |
2552 | vc->vc_video_erase_char = | 2542 | vc->vc_video_erase_char = |
2553 | ((c & 0xff00) << 1) | (c & 0xff); | 2543 | ((c & 0xff00) << 1) | (c & 0xff); |
2554 | c = vc->vc_scrl_erase_char; | ||
2555 | vc->vc_scrl_erase_char = | ||
2556 | ((c & 0xFF00) << 1) | (c & 0xFF); | ||
2557 | vc->vc_attr <<= 1; | 2544 | vc->vc_attr <<= 1; |
2558 | } else { | 2545 | } else |
2559 | vc->vc_video_erase_char = c & ~0x100; | 2546 | vc->vc_video_erase_char = c & ~0x100; |
2560 | vc->vc_scrl_erase_char = c & ~0x100; | ||
2561 | } | ||
2562 | } | 2547 | } |
2563 | 2548 | ||
2564 | } | 2549 | } |
@@ -2992,8 +2977,8 @@ static void fbcon_set_all_vcs(struct fb_info *info) | |||
2992 | p = &fb_display[vc->vc_num]; | 2977 | p = &fb_display[vc->vc_num]; |
2993 | set_blitting_type(vc, info); | 2978 | set_blitting_type(vc, info); |
2994 | var_to_display(p, &info->var, info); | 2979 | var_to_display(p, &info->var, info); |
2995 | cols = FBCON_SWAP(p->rotate, info->var.xres, info->var.yres); | 2980 | cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); |
2996 | rows = FBCON_SWAP(p->rotate, info->var.yres, info->var.xres); | 2981 | rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
2997 | cols /= vc->vc_font.width; | 2982 | cols /= vc->vc_font.width; |
2998 | rows /= vc->vc_font.height; | 2983 | rows /= vc->vc_font.height; |
2999 | vc_resize(vc, cols, rows); | 2984 | vc_resize(vc, cols, rows); |
@@ -3588,8 +3573,8 @@ static int __init fb_console_init(void) | |||
3588 | 3573 | ||
3589 | acquire_console_sem(); | 3574 | acquire_console_sem(); |
3590 | fb_register_client(&fbcon_event_notifier); | 3575 | fb_register_client(&fbcon_event_notifier); |
3591 | fbcon_device = device_create_drvdata(fb_class, NULL, MKDEV(0, 0), | 3576 | fbcon_device = device_create(fb_class, NULL, MKDEV(0, 0), NULL, |
3592 | NULL, "fbcon"); | 3577 | "fbcon"); |
3593 | 3578 | ||
3594 | if (IS_ERR(fbcon_device)) { | 3579 | if (IS_ERR(fbcon_device)) { |
3595 | printk(KERN_WARNING "Unable to create device " | 3580 | printk(KERN_WARNING "Unable to create device " |
diff --git a/drivers/video/console/fbcon.h b/drivers/video/console/fbcon.h index a6e38e9ea73f..89a346880ec0 100644 --- a/drivers/video/console/fbcon.h +++ b/drivers/video/console/fbcon.h | |||
@@ -110,7 +110,7 @@ static inline int mono_col(const struct fb_info *info) | |||
110 | __u32 max_len; | 110 | __u32 max_len; |
111 | max_len = max(info->var.green.length, info->var.red.length); | 111 | max_len = max(info->var.green.length, info->var.red.length); |
112 | max_len = max(info->var.blue.length, max_len); | 112 | max_len = max(info->var.blue.length, max_len); |
113 | return ~(0xfff << (max_len & 0xff)); | 113 | return (~(0xfff << max_len)) & 0xff; |
114 | } | 114 | } |
115 | 115 | ||
116 | static inline int attr_col_ec(int shift, struct vc_data *vc, | 116 | static inline int attr_col_ec(int shift, struct vc_data *vc, |
diff --git a/drivers/video/console/mdacon.c b/drivers/video/console/mdacon.c index 9901064199bd..dd3eaaad4441 100644 --- a/drivers/video/console/mdacon.c +++ b/drivers/video/console/mdacon.c | |||
@@ -533,7 +533,7 @@ static void mdacon_cursor(struct vc_data *c, int mode) | |||
533 | 533 | ||
534 | static int mdacon_scroll(struct vc_data *c, int t, int b, int dir, int lines) | 534 | static int mdacon_scroll(struct vc_data *c, int t, int b, int dir, int lines) |
535 | { | 535 | { |
536 | u16 eattr = mda_convert_attr(c->vc_scrl_erase_char); | 536 | u16 eattr = mda_convert_attr(c->vc_video_erase_char); |
537 | 537 | ||
538 | if (!lines) | 538 | if (!lines) |
539 | return 0; | 539 | return 0; |
diff --git a/drivers/video/console/sticon.c b/drivers/video/console/sticon.c index 4055dbdd1b42..491c1c1baf4c 100644 --- a/drivers/video/console/sticon.c +++ b/drivers/video/console/sticon.c | |||
@@ -170,12 +170,12 @@ static int sticon_scroll(struct vc_data *conp, int t, int b, int dir, int count) | |||
170 | switch (dir) { | 170 | switch (dir) { |
171 | case SM_UP: | 171 | case SM_UP: |
172 | sti_bmove(sti, t + count, 0, t, 0, b - t - count, conp->vc_cols); | 172 | sti_bmove(sti, t + count, 0, t, 0, b - t - count, conp->vc_cols); |
173 | sti_clear(sti, b - count, 0, count, conp->vc_cols, conp->vc_scrl_erase_char); | 173 | sti_clear(sti, b - count, 0, count, conp->vc_cols, conp->vc_video_erase_char); |
174 | break; | 174 | break; |
175 | 175 | ||
176 | case SM_DOWN: | 176 | case SM_DOWN: |
177 | sti_bmove(sti, t, 0, t + count, 0, b - t - count, conp->vc_cols); | 177 | sti_bmove(sti, t, 0, t + count, 0, b - t - count, conp->vc_cols); |
178 | sti_clear(sti, t, 0, count, conp->vc_cols, conp->vc_scrl_erase_char); | 178 | sti_clear(sti, t, 0, count, conp->vc_cols, conp->vc_video_erase_char); |
179 | break; | 179 | break; |
180 | } | 180 | } |
181 | 181 | ||
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index bd1f57b259d9..448d209a0bf2 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c | |||
@@ -239,8 +239,7 @@ static void vgacon_restore_screen(struct vc_data *c) | |||
239 | 239 | ||
240 | static int vgacon_scrolldelta(struct vc_data *c, int lines) | 240 | static int vgacon_scrolldelta(struct vc_data *c, int lines) |
241 | { | 241 | { |
242 | int start, end, count, soff, diff; | 242 | int start, end, count, soff; |
243 | void *d, *s; | ||
244 | 243 | ||
245 | if (!lines) { | 244 | if (!lines) { |
246 | c->vc_visible_origin = c->vc_origin; | 245 | c->vc_visible_origin = c->vc_origin; |
@@ -287,29 +286,29 @@ static int vgacon_scrolldelta(struct vc_data *c, int lines) | |||
287 | if (count > c->vc_rows) | 286 | if (count > c->vc_rows) |
288 | count = c->vc_rows; | 287 | count = c->vc_rows; |
289 | 288 | ||
290 | diff = c->vc_rows - count; | 289 | if (count) { |
290 | int copysize; | ||
291 | 291 | ||
292 | d = (void *) c->vc_origin; | 292 | int diff = c->vc_rows - count; |
293 | s = (void *) c->vc_screenbuf; | 293 | void *d = (void *) c->vc_origin; |
294 | void *s = (void *) c->vc_screenbuf; | ||
294 | 295 | ||
295 | while (count--) { | 296 | count *= c->vc_size_row; |
296 | scr_memcpyw(d, vgacon_scrollback + soff, c->vc_size_row); | 297 | /* how much memory to end of buffer left? */ |
297 | d += c->vc_size_row; | 298 | copysize = min(count, vgacon_scrollback_size - soff); |
298 | soff += c->vc_size_row; | 299 | scr_memcpyw(d, vgacon_scrollback + soff, copysize); |
300 | d += copysize; | ||
301 | count -= copysize; | ||
299 | 302 | ||
300 | if (soff >= vgacon_scrollback_size) | 303 | if (count) { |
301 | soff = 0; | 304 | scr_memcpyw(d, vgacon_scrollback, count); |
302 | } | 305 | d += count; |
306 | } | ||
303 | 307 | ||
304 | if (diff == c->vc_rows) { | 308 | if (diff) |
309 | scr_memcpyw(d, s, diff * c->vc_size_row); | ||
310 | } else | ||
305 | vgacon_cursor(c, CM_MOVE); | 311 | vgacon_cursor(c, CM_MOVE); |
306 | } else { | ||
307 | while (diff--) { | ||
308 | scr_memcpyw(d, s, c->vc_size_row); | ||
309 | d += c->vc_size_row; | ||
310 | s += c->vc_size_row; | ||
311 | } | ||
312 | } | ||
313 | 312 | ||
314 | return 1; | 313 | return 1; |
315 | } | 314 | } |
@@ -1350,7 +1349,7 @@ static int vgacon_scroll(struct vc_data *c, int t, int b, int dir, | |||
1350 | } else | 1349 | } else |
1351 | c->vc_origin += delta; | 1350 | c->vc_origin += delta; |
1352 | scr_memsetw((u16 *) (c->vc_origin + c->vc_screenbuf_size - | 1351 | scr_memsetw((u16 *) (c->vc_origin + c->vc_screenbuf_size - |
1353 | delta), c->vc_scrl_erase_char, | 1352 | delta), c->vc_video_erase_char, |
1354 | delta); | 1353 | delta); |
1355 | } else { | 1354 | } else { |
1356 | if (oldo - delta < vga_vram_base) { | 1355 | if (oldo - delta < vga_vram_base) { |
@@ -1363,7 +1362,7 @@ static int vgacon_scroll(struct vc_data *c, int t, int b, int dir, | |||
1363 | } else | 1362 | } else |
1364 | c->vc_origin -= delta; | 1363 | c->vc_origin -= delta; |
1365 | c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size; | 1364 | c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size; |
1366 | scr_memsetw((u16 *) (c->vc_origin), c->vc_scrl_erase_char, | 1365 | scr_memsetw((u16 *) (c->vc_origin), c->vc_video_erase_char, |
1367 | delta); | 1366 | delta); |
1368 | } | 1367 | } |
1369 | c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size; | 1368 | c->vc_scr_end = c->vc_origin + c->vc_screenbuf_size; |