|
Lines 26-32
Link Here
|
| 26 |
* |
26 |
* |
| 27 |
* Hardware cursor support added by Emmanuel Marty (core@ggi-project.org) |
27 |
* Hardware cursor support added by Emmanuel Marty (core@ggi-project.org) |
| 28 |
* Smart redraw scrolling, arbitrary font width support, 512char font support |
28 |
* Smart redraw scrolling, arbitrary font width support, 512char font support |
| 29 |
* and software scrollback added by |
29 |
* and software scrollback added by |
| 30 |
* Jakub Jelinek (jj@ultra.linux.cz) |
30 |
* Jakub Jelinek (jj@ultra.linux.cz) |
| 31 |
* |
31 |
* |
| 32 |
* Random hacking by Martin Mares <mj@ucw.cz> |
32 |
* Random hacking by Martin Mares <mj@ucw.cz> |
|
Lines 79-84
Link Here
|
| 79 |
#include <asm/irq.h> |
79 |
#include <asm/irq.h> |
| 80 |
|
80 |
|
| 81 |
#include "fbcon.h" |
81 |
#include "fbcon.h" |
|
|
82 |
#include "fbcondecor.h" |
| 82 |
|
83 |
|
| 83 |
#ifdef FBCONDEBUG |
84 |
#ifdef FBCONDEBUG |
| 84 |
# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args) |
85 |
# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args) |
|
Lines 94-100
enum {
Link Here
|
| 94 |
|
95 |
|
| 95 |
static struct display fb_display[MAX_NR_CONSOLES]; |
96 |
static struct display fb_display[MAX_NR_CONSOLES]; |
| 96 |
|
97 |
|
| 97 |
static signed char con2fb_map[MAX_NR_CONSOLES]; |
98 |
signed char con2fb_map[MAX_NR_CONSOLES]; |
| 98 |
static signed char con2fb_map_boot[MAX_NR_CONSOLES]; |
99 |
static signed char con2fb_map_boot[MAX_NR_CONSOLES]; |
| 99 |
|
100 |
|
| 100 |
static int logo_lines; |
101 |
static int logo_lines; |
|
Lines 110-116
static int softback_lines;
Link Here
|
| 110 |
/* console mappings */ |
111 |
/* console mappings */ |
| 111 |
static int first_fb_vc; |
112 |
static int first_fb_vc; |
| 112 |
static int last_fb_vc = MAX_NR_CONSOLES - 1; |
113 |
static int last_fb_vc = MAX_NR_CONSOLES - 1; |
| 113 |
static int fbcon_is_default = 1; |
114 |
static int fbcon_is_default = 1; |
| 114 |
static int fbcon_has_exited; |
115 |
static int fbcon_has_exited; |
| 115 |
static int primary_device = -1; |
116 |
static int primary_device = -1; |
| 116 |
static int fbcon_has_console_bind; |
117 |
static int fbcon_has_console_bind; |
|
Lines 286-292
static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info)
Link Here
|
| 286 |
!vt_force_oops_output(vc); |
287 |
!vt_force_oops_output(vc); |
| 287 |
} |
288 |
} |
| 288 |
|
289 |
|
| 289 |
static int get_color(struct vc_data *vc, struct fb_info *info, |
290 |
int get_color(struct vc_data *vc, struct fb_info *info, |
| 290 |
u16 c, int is_fg) |
291 |
u16 c, int is_fg) |
| 291 |
{ |
292 |
{ |
| 292 |
int depth = fb_get_color_depth(&info->var, &info->fix); |
293 |
int depth = fb_get_color_depth(&info->var, &info->fix); |
|
Lines 458-464
static int __init fb_console_setup(char *this_opt)
Link Here
|
| 458 |
} else |
459 |
} else |
| 459 |
return 1; |
460 |
return 1; |
| 460 |
} |
461 |
} |
| 461 |
|
462 |
|
| 462 |
if (!strncmp(options, "map:", 4)) { |
463 |
if (!strncmp(options, "map:", 4)) { |
| 463 |
options += 4; |
464 |
options += 4; |
| 464 |
if (*options) { |
465 |
if (*options) { |
|
Lines 483-490
static int __init fb_console_setup(char *this_opt)
Link Here
|
| 483 |
first_fb_vc = 0; |
484 |
first_fb_vc = 0; |
| 484 |
if (*options++ == '-') |
485 |
if (*options++ == '-') |
| 485 |
last_fb_vc = simple_strtoul(options, &options, 10) - 1; |
486 |
last_fb_vc = simple_strtoul(options, &options, 10) - 1; |
| 486 |
fbcon_is_default = 0; |
487 |
fbcon_is_default = 0; |
| 487 |
} |
488 |
} |
| 488 |
|
489 |
|
| 489 |
if (!strncmp(options, "rotate:", 7)) { |
490 |
if (!strncmp(options, "rotate:", 7)) { |
| 490 |
options += 7; |
491 |
options += 7; |
|
Lines 545-550
static int fbcon_takeover(int show_logo)
Link Here
|
| 545 |
info_idx = -1; |
546 |
info_idx = -1; |
| 546 |
} else { |
547 |
} else { |
| 547 |
fbcon_has_console_bind = 1; |
548 |
fbcon_has_console_bind = 1; |
|
|
549 |
#ifdef CONFIG_FB_CON_DECOR |
| 550 |
fbcon_decor_init(); |
| 551 |
#endif |
| 548 |
} |
552 |
} |
| 549 |
|
553 |
|
| 550 |
return err; |
554 |
return err; |
|
Lines 935-941
static const char *fbcon_startup(void)
Link Here
|
| 935 |
info = registered_fb[info_idx]; |
939 |
info = registered_fb[info_idx]; |
| 936 |
if (!info) |
940 |
if (!info) |
| 937 |
return NULL; |
941 |
return NULL; |
| 938 |
|
942 |
|
| 939 |
owner = info->fbops->owner; |
943 |
owner = info->fbops->owner; |
| 940 |
if (!try_module_get(owner)) |
944 |
if (!try_module_get(owner)) |
| 941 |
return NULL; |
945 |
return NULL; |
|
Lines 999-1004
static const char *fbcon_startup(void)
Link Here
|
| 999 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
1003 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
| 1000 |
cols /= vc->vc_font.width; |
1004 |
cols /= vc->vc_font.width; |
| 1001 |
rows /= vc->vc_font.height; |
1005 |
rows /= vc->vc_font.height; |
|
|
1006 |
|
| 1007 |
if (fbcon_decor_active(info, vc)) { |
| 1008 |
cols = vc->vc_decor.twidth / vc->vc_font.width; |
| 1009 |
rows = vc->vc_decor.theight / vc->vc_font.height; |
| 1010 |
} |
| 1011 |
|
| 1002 |
vc_resize(vc, cols, rows); |
1012 |
vc_resize(vc, cols, rows); |
| 1003 |
|
1013 |
|
| 1004 |
DPRINTK("mode: %s\n", info->fix.id); |
1014 |
DPRINTK("mode: %s\n", info->fix.id); |
|
Lines 1028-1034
static void fbcon_init(struct vc_data *vc, int init)
Link Here
|
| 1028 |
cap = info->flags; |
1038 |
cap = info->flags; |
| 1029 |
|
1039 |
|
| 1030 |
if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW || |
1040 |
if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW || |
| 1031 |
(info->fix.type == FB_TYPE_TEXT)) |
1041 |
(info->fix.type == FB_TYPE_TEXT) || fbcon_decor_active(info, vc)) |
| 1032 |
logo = 0; |
1042 |
logo = 0; |
| 1033 |
|
1043 |
|
| 1034 |
if (var_to_display(p, &info->var, info)) |
1044 |
if (var_to_display(p, &info->var, info)) |
|
Lines 1238-1243
static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height,
Link Here
|
| 1238 |
if (sy < vc->vc_top && vc->vc_top == logo_lines) |
1248 |
if (sy < vc->vc_top && vc->vc_top == logo_lines) |
| 1239 |
vc->vc_top = 0; |
1249 |
vc->vc_top = 0; |
| 1240 |
|
1250 |
|
|
|
1251 |
if (fbcon_decor_active(info, vc)) { |
| 1252 |
fbcon_decor_clear(vc, info, sy, sx, height, width); |
| 1253 |
return; |
| 1254 |
} |
| 1255 |
|
| 1241 |
/* Split blits that cross physical y_wrap boundary */ |
1256 |
/* Split blits that cross physical y_wrap boundary */ |
| 1242 |
|
1257 |
|
| 1243 |
y_break = p->vrows - p->yscroll; |
1258 |
y_break = p->vrows - p->yscroll; |
|
Lines 1257-1266
static void fbcon_putcs(struct vc_data *vc, const unsigned short *s,
Link Here
|
| 1257 |
struct display *p = &fb_display[vc->vc_num]; |
1272 |
struct display *p = &fb_display[vc->vc_num]; |
| 1258 |
struct fbcon_ops *ops = info->fbcon_par; |
1273 |
struct fbcon_ops *ops = info->fbcon_par; |
| 1259 |
|
1274 |
|
| 1260 |
if (!fbcon_is_inactive(vc, info)) |
1275 |
if (!fbcon_is_inactive(vc, info)) { |
| 1261 |
ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, |
1276 |
|
| 1262 |
get_color(vc, info, scr_readw(s), 1), |
1277 |
if (fbcon_decor_active(info, vc)) |
| 1263 |
get_color(vc, info, scr_readw(s), 0)); |
1278 |
fbcon_decor_putcs(vc, info, s, count, ypos, xpos); |
|
|
1279 |
else |
| 1280 |
ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, |
| 1281 |
get_color(vc, info, scr_readw(s), 1), |
| 1282 |
get_color(vc, info, scr_readw(s), 0)); |
| 1283 |
} |
| 1264 |
} |
1284 |
} |
| 1265 |
|
1285 |
|
| 1266 |
static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) |
1286 |
static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) |
|
Lines 1276-1283
static void fbcon_clear_margins(struct vc_data *vc, int bottom_only)
Link Here
|
| 1276 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1296 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
| 1277 |
struct fbcon_ops *ops = info->fbcon_par; |
1297 |
struct fbcon_ops *ops = info->fbcon_par; |
| 1278 |
|
1298 |
|
| 1279 |
if (!fbcon_is_inactive(vc, info)) |
1299 |
if (!fbcon_is_inactive(vc, info)) { |
| 1280 |
ops->clear_margins(vc, info, bottom_only); |
1300 |
if (fbcon_decor_active(info, vc)) { |
|
|
1301 |
fbcon_decor_clear_margins(vc, info, bottom_only); |
| 1302 |
} else { |
| 1303 |
ops->clear_margins(vc, info, bottom_only); |
| 1304 |
} |
| 1305 |
} |
| 1281 |
} |
1306 |
} |
| 1282 |
|
1307 |
|
| 1283 |
static void fbcon_cursor(struct vc_data *vc, int mode) |
1308 |
static void fbcon_cursor(struct vc_data *vc, int mode) |
|
Lines 1387-1393
static __inline__ void ywrap_up(struct vc_data *vc, int count)
Link Here
|
| 1387 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1412 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
| 1388 |
struct fbcon_ops *ops = info->fbcon_par; |
1413 |
struct fbcon_ops *ops = info->fbcon_par; |
| 1389 |
struct display *p = &fb_display[vc->vc_num]; |
1414 |
struct display *p = &fb_display[vc->vc_num]; |
| 1390 |
|
1415 |
|
| 1391 |
p->yscroll += count; |
1416 |
p->yscroll += count; |
| 1392 |
if (p->yscroll >= p->vrows) /* Deal with wrap */ |
1417 |
if (p->yscroll >= p->vrows) /* Deal with wrap */ |
| 1393 |
p->yscroll -= p->vrows; |
1418 |
p->yscroll -= p->vrows; |
|
Lines 1406-1412
static __inline__ void ywrap_down(struct vc_data *vc, int count)
Link Here
|
| 1406 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1431 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
| 1407 |
struct fbcon_ops *ops = info->fbcon_par; |
1432 |
struct fbcon_ops *ops = info->fbcon_par; |
| 1408 |
struct display *p = &fb_display[vc->vc_num]; |
1433 |
struct display *p = &fb_display[vc->vc_num]; |
| 1409 |
|
1434 |
|
| 1410 |
p->yscroll -= count; |
1435 |
p->yscroll -= count; |
| 1411 |
if (p->yscroll < 0) /* Deal with wrap */ |
1436 |
if (p->yscroll < 0) /* Deal with wrap */ |
| 1412 |
p->yscroll += p->vrows; |
1437 |
p->yscroll += p->vrows; |
|
Lines 1473-1479
static __inline__ void ypan_down(struct vc_data *vc, int count)
Link Here
|
| 1473 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1498 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
| 1474 |
struct display *p = &fb_display[vc->vc_num]; |
1499 |
struct display *p = &fb_display[vc->vc_num]; |
| 1475 |
struct fbcon_ops *ops = info->fbcon_par; |
1500 |
struct fbcon_ops *ops = info->fbcon_par; |
| 1476 |
|
1501 |
|
| 1477 |
p->yscroll -= count; |
1502 |
p->yscroll -= count; |
| 1478 |
if (p->yscroll < 0) { |
1503 |
if (p->yscroll < 0) { |
| 1479 |
ops->bmove(vc, info, 0, 0, p->vrows - vc->vc_rows, |
1504 |
ops->bmove(vc, info, 0, 0, p->vrows - vc->vc_rows, |
|
Lines 1797-1803
static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
Link Here
|
| 1797 |
count = vc->vc_rows; |
1822 |
count = vc->vc_rows; |
| 1798 |
if (softback_top) |
1823 |
if (softback_top) |
| 1799 |
fbcon_softback_note(vc, t, count); |
1824 |
fbcon_softback_note(vc, t, count); |
| 1800 |
if (logo_shown >= 0) |
1825 |
if (logo_shown >= 0 || fbcon_decor_active(info, vc)) |
| 1801 |
goto redraw_up; |
1826 |
goto redraw_up; |
| 1802 |
switch (p->scrollmode) { |
1827 |
switch (p->scrollmode) { |
| 1803 |
case SCROLL_MOVE: |
1828 |
case SCROLL_MOVE: |
|
Lines 1890-1895
static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
Link Here
|
| 1890 |
count = vc->vc_rows; |
1915 |
count = vc->vc_rows; |
| 1891 |
if (logo_shown >= 0) |
1916 |
if (logo_shown >= 0) |
| 1892 |
goto redraw_down; |
1917 |
goto redraw_down; |
|
|
1918 |
if (fbcon_decor_active(info, vc)) |
| 1919 |
goto redraw_down; |
| 1893 |
switch (p->scrollmode) { |
1920 |
switch (p->scrollmode) { |
| 1894 |
case SCROLL_MOVE: |
1921 |
case SCROLL_MOVE: |
| 1895 |
fbcon_redraw_blit(vc, info, p, b - 1, b - t - count, |
1922 |
fbcon_redraw_blit(vc, info, p, b - 1, b - t - count, |
|
Lines 1982-1988
static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
Link Here
|
| 1982 |
{ |
2009 |
{ |
| 1983 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
2010 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
| 1984 |
struct display *p = &fb_display[vc->vc_num]; |
2011 |
struct display *p = &fb_display[vc->vc_num]; |
| 1985 |
|
2012 |
|
| 1986 |
if (fbcon_is_inactive(vc, info)) |
2013 |
if (fbcon_is_inactive(vc, info)) |
| 1987 |
return; |
2014 |
return; |
| 1988 |
|
2015 |
|
|
Lines 2000-2006
static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
Link Here
|
| 2000 |
p->vrows - p->yscroll); |
2027 |
p->vrows - p->yscroll); |
| 2001 |
} |
2028 |
} |
| 2002 |
|
2029 |
|
| 2003 |
static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, |
2030 |
static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, |
| 2004 |
int dy, int dx, int height, int width, u_int y_break) |
2031 |
int dy, int dx, int height, int width, u_int y_break) |
| 2005 |
{ |
2032 |
{ |
| 2006 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
2033 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
|
Lines 2038-2043
static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s
Link Here
|
| 2038 |
} |
2065 |
} |
| 2039 |
return; |
2066 |
return; |
| 2040 |
} |
2067 |
} |
|
|
2068 |
|
| 2069 |
if (fbcon_decor_active(info, vc) && sy == dy && height == 1) { |
| 2070 |
/* must use slower redraw bmove to keep background pic intact */ |
| 2071 |
fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width); |
| 2072 |
return; |
| 2073 |
} |
| 2074 |
|
| 2041 |
ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, |
2075 |
ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, |
| 2042 |
height, width); |
2076 |
height, width); |
| 2043 |
} |
2077 |
} |
|
Lines 2089-2095
static void updatescrollmode(struct display *p,
Link Here
|
| 2089 |
} |
2123 |
} |
| 2090 |
} |
2124 |
} |
| 2091 |
|
2125 |
|
| 2092 |
static int fbcon_resize(struct vc_data *vc, unsigned int width, |
2126 |
static int fbcon_resize(struct vc_data *vc, unsigned int width, |
| 2093 |
unsigned int height, unsigned int user) |
2127 |
unsigned int height, unsigned int user) |
| 2094 |
{ |
2128 |
{ |
| 2095 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
2129 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
|
Lines 2108-2115
static int fbcon_resize(struct vc_data *vc, unsigned int width,
Link Here
|
| 2108 |
var.yres = virt_h * virt_fh; |
2142 |
var.yres = virt_h * virt_fh; |
| 2109 |
x_diff = info->var.xres - var.xres; |
2143 |
x_diff = info->var.xres - var.xres; |
| 2110 |
y_diff = info->var.yres - var.yres; |
2144 |
y_diff = info->var.yres - var.yres; |
| 2111 |
if (x_diff < 0 || x_diff > virt_fw || |
2145 |
if ((x_diff < 0 || x_diff > virt_fw || |
| 2112 |
y_diff < 0 || y_diff > virt_fh) { |
2146 |
y_diff < 0 || y_diff > virt_fh) && !vc->vc_decor.state) { |
| 2113 |
const struct fb_videomode *mode; |
2147 |
const struct fb_videomode *mode; |
| 2114 |
|
2148 |
|
| 2115 |
DPRINTK("attempting resize %ix%i\n", var.xres, var.yres); |
2149 |
DPRINTK("attempting resize %ix%i\n", var.xres, var.yres); |
|
Lines 2145-2150
static int fbcon_switch(struct vc_data *vc)
Link Here
|
| 2145 |
|
2179 |
|
| 2146 |
info = registered_fb[con2fb_map[vc->vc_num]]; |
2180 |
info = registered_fb[con2fb_map[vc->vc_num]]; |
| 2147 |
ops = info->fbcon_par; |
2181 |
ops = info->fbcon_par; |
|
|
2182 |
prev_console = ops->currcon; |
| 2183 |
if (prev_console != -1) |
| 2184 |
old_info = registered_fb[con2fb_map[prev_console]]; |
| 2185 |
|
| 2186 |
#ifdef CONFIG_FB_CON_DECOR |
| 2187 |
if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
| 2188 |
struct vc_data *vc_curr = vc_cons[prev_console].d; |
| 2189 |
if (vc_curr && fbcon_decor_active_vc(vc_curr)) { |
| 2190 |
/* Clear the screen to avoid displaying funky colors during |
| 2191 |
* palette updates. */ |
| 2192 |
memset((u8*)info->screen_base + info->fix.line_length * info->var.yoffset, |
| 2193 |
0, info->var.yres * info->fix.line_length); |
| 2194 |
} |
| 2195 |
} |
| 2196 |
#endif |
| 2148 |
|
2197 |
|
| 2149 |
if (softback_top) { |
2198 |
if (softback_top) { |
| 2150 |
if (softback_lines) |
2199 |
if (softback_lines) |
|
Lines 2163-2171
static int fbcon_switch(struct vc_data *vc)
Link Here
|
| 2163 |
logo_shown = FBCON_LOGO_CANSHOW; |
2212 |
logo_shown = FBCON_LOGO_CANSHOW; |
| 2164 |
} |
2213 |
} |
| 2165 |
|
2214 |
|
| 2166 |
prev_console = ops->currcon; |
|
|
| 2167 |
if (prev_console != -1) |
| 2168 |
old_info = registered_fb[con2fb_map[prev_console]]; |
| 2169 |
/* |
2215 |
/* |
| 2170 |
* FIXME: If we have multiple fbdev's loaded, we need to |
2216 |
* FIXME: If we have multiple fbdev's loaded, we need to |
| 2171 |
* update all info->currcon. Perhaps, we can place this |
2217 |
* update all info->currcon. Perhaps, we can place this |
|
Lines 2209-2214
static int fbcon_switch(struct vc_data *vc)
Link Here
|
| 2209 |
fbcon_del_cursor_timer(old_info); |
2255 |
fbcon_del_cursor_timer(old_info); |
| 2210 |
} |
2256 |
} |
| 2211 |
|
2257 |
|
|
|
2258 |
if (fbcon_decor_active_vc(vc)) { |
| 2259 |
struct vc_data *vc_curr = vc_cons[prev_console].d; |
| 2260 |
|
| 2261 |
if (!vc_curr->vc_decor.theme || |
| 2262 |
strcmp(vc->vc_decor.theme, vc_curr->vc_decor.theme) || |
| 2263 |
(fbcon_decor_active_nores(info, vc_curr) && |
| 2264 |
!fbcon_decor_active(info, vc_curr))) { |
| 2265 |
fbcon_decor_disable(vc, 0); |
| 2266 |
fbcon_decor_call_helper("modechange", vc->vc_num); |
| 2267 |
} |
| 2268 |
} |
| 2269 |
|
| 2212 |
if (fbcon_is_inactive(vc, info) || |
2270 |
if (fbcon_is_inactive(vc, info) || |
| 2213 |
ops->blank_state != FB_BLANK_UNBLANK) |
2271 |
ops->blank_state != FB_BLANK_UNBLANK) |
| 2214 |
fbcon_del_cursor_timer(info); |
2272 |
fbcon_del_cursor_timer(info); |
|
Lines 2257-2267
static int fbcon_switch(struct vc_data *vc)
Link Here
|
| 2257 |
ops->update_start(info); |
2315 |
ops->update_start(info); |
| 2258 |
} |
2316 |
} |
| 2259 |
|
2317 |
|
| 2260 |
fbcon_set_palette(vc, color_table); |
2318 |
fbcon_set_palette(vc, color_table); |
| 2261 |
fbcon_clear_margins(vc, 0); |
2319 |
fbcon_clear_margins(vc, 0); |
| 2262 |
|
2320 |
|
| 2263 |
if (logo_shown == FBCON_LOGO_DRAW) { |
2321 |
if (logo_shown == FBCON_LOGO_DRAW) { |
| 2264 |
|
|
|
| 2265 |
logo_shown = fg_console; |
2322 |
logo_shown = fg_console; |
| 2266 |
/* This is protected above by initmem_freed */ |
2323 |
/* This is protected above by initmem_freed */ |
| 2267 |
fb_show_logo(info, ops->rotate); |
2324 |
fb_show_logo(info, ops->rotate); |
|
Lines 2317-2331
static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
Link Here
|
| 2317 |
} |
2374 |
} |
| 2318 |
} |
2375 |
} |
| 2319 |
|
2376 |
|
| 2320 |
if (!fbcon_is_inactive(vc, info)) { |
2377 |
if (!fbcon_is_inactive(vc, info)) { |
| 2321 |
if (ops->blank_state != blank) { |
2378 |
if (ops->blank_state != blank) { |
| 2322 |
ops->blank_state = blank; |
2379 |
ops->blank_state = blank; |
| 2323 |
fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); |
2380 |
fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); |
| 2324 |
ops->cursor_flash = (!blank); |
2381 |
ops->cursor_flash = (!blank); |
| 2325 |
|
2382 |
|
| 2326 |
if (!(info->flags & FBINFO_MISC_USEREVENT)) |
2383 |
if (!(info->flags & FBINFO_MISC_USEREVENT)) { |
| 2327 |
if (fb_blank(info, blank)) |
2384 |
if (fb_blank(info, blank)) { |
| 2328 |
fbcon_generic_blank(vc, info, blank); |
2385 |
if (fbcon_decor_active(info, vc)) |
|
|
2386 |
fbcon_decor_blank(vc, info, blank); |
| 2387 |
else |
| 2388 |
fbcon_generic_blank(vc, info, blank); |
| 2389 |
} |
| 2390 |
} |
| 2329 |
} |
2391 |
} |
| 2330 |
|
2392 |
|
| 2331 |
if (!blank) |
2393 |
if (!blank) |
|
Lines 2447-2453
static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
Link Here
|
| 2447 |
vc->vc_complement_mask >>= 1; |
2509 |
vc->vc_complement_mask >>= 1; |
| 2448 |
vc->vc_s_complement_mask >>= 1; |
2510 |
vc->vc_s_complement_mask >>= 1; |
| 2449 |
} |
2511 |
} |
| 2450 |
|
2512 |
|
| 2451 |
/* ++Edmund: reorder the attribute bits */ |
2513 |
/* ++Edmund: reorder the attribute bits */ |
| 2452 |
if (vc->vc_can_do_color) { |
2514 |
if (vc->vc_can_do_color) { |
| 2453 |
unsigned short *cp = |
2515 |
unsigned short *cp = |
|
Lines 2470-2476
static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
Link Here
|
| 2470 |
vc->vc_complement_mask <<= 1; |
2532 |
vc->vc_complement_mask <<= 1; |
| 2471 |
vc->vc_s_complement_mask <<= 1; |
2533 |
vc->vc_s_complement_mask <<= 1; |
| 2472 |
} |
2534 |
} |
| 2473 |
|
2535 |
|
| 2474 |
/* ++Edmund: reorder the attribute bits */ |
2536 |
/* ++Edmund: reorder the attribute bits */ |
| 2475 |
{ |
2537 |
{ |
| 2476 |
unsigned short *cp = |
2538 |
unsigned short *cp = |
|
Lines 2500-2512
static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
Link Here
|
| 2500 |
} |
2562 |
} |
| 2501 |
|
2563 |
|
| 2502 |
if (resize) { |
2564 |
if (resize) { |
|
|
2565 |
/* reset wrap/pan */ |
| 2503 |
int cols, rows; |
2566 |
int cols, rows; |
| 2504 |
|
2567 |
|
| 2505 |
cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); |
2568 |
cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); |
| 2506 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
2569 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
|
|
2570 |
|
| 2571 |
if (fbcon_decor_active(info, vc)) { |
| 2572 |
info->var.xoffset = info->var.yoffset = p->yscroll = 0; |
| 2573 |
cols = vc->vc_decor.twidth; |
| 2574 |
rows = vc->vc_decor.theight; |
| 2575 |
} |
| 2507 |
cols /= w; |
2576 |
cols /= w; |
| 2508 |
rows /= h; |
2577 |
rows /= h; |
|
|
2578 |
|
| 2509 |
vc_resize(vc, cols, rows); |
2579 |
vc_resize(vc, cols, rows); |
|
|
2580 |
|
| 2510 |
if (CON_IS_VISIBLE(vc) && softback_buf) |
2581 |
if (CON_IS_VISIBLE(vc) && softback_buf) |
| 2511 |
fbcon_update_softback(vc); |
2582 |
fbcon_update_softback(vc); |
| 2512 |
} else if (CON_IS_VISIBLE(vc) |
2583 |
} else if (CON_IS_VISIBLE(vc) |
|
Lines 2590-2596
static int fbcon_set_font(struct vc_data *vc, struct console_font *font, unsigne
Link Here
|
| 2590 |
/* Check if the same font is on some other console already */ |
2661 |
/* Check if the same font is on some other console already */ |
| 2591 |
for (i = first_fb_vc; i <= last_fb_vc; i++) { |
2662 |
for (i = first_fb_vc; i <= last_fb_vc; i++) { |
| 2592 |
struct vc_data *tmp = vc_cons[i].d; |
2663 |
struct vc_data *tmp = vc_cons[i].d; |
| 2593 |
|
2664 |
|
| 2594 |
if (fb_display[i].userfont && |
2665 |
if (fb_display[i].userfont && |
| 2595 |
fb_display[i].fontdata && |
2666 |
fb_display[i].fontdata && |
| 2596 |
FNTSUM(fb_display[i].fontdata) == csum && |
2667 |
FNTSUM(fb_display[i].fontdata) == csum && |
|
Lines 2635-2641
static int fbcon_set_palette(struct vc_data *vc, unsigned char *table)
Link Here
|
| 2635 |
int i, j, k, depth; |
2706 |
int i, j, k, depth; |
| 2636 |
u8 val; |
2707 |
u8 val; |
| 2637 |
|
2708 |
|
| 2638 |
if (fbcon_is_inactive(vc, info)) |
2709 |
if (fbcon_is_inactive(vc, info) |
|
|
2710 |
#ifdef CONFIG_FB_CON_DECOR |
| 2711 |
|| vc->vc_num != fg_console |
| 2712 |
#endif |
| 2713 |
) |
| 2639 |
return -EINVAL; |
2714 |
return -EINVAL; |
| 2640 |
|
2715 |
|
| 2641 |
if (!CON_IS_VISIBLE(vc)) |
2716 |
if (!CON_IS_VISIBLE(vc)) |
|
Lines 2661-2674
static int fbcon_set_palette(struct vc_data *vc, unsigned char *table)
Link Here
|
| 2661 |
} else |
2736 |
} else |
| 2662 |
fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap); |
2737 |
fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap); |
| 2663 |
|
2738 |
|
| 2664 |
return fb_set_cmap(&palette_cmap, info); |
2739 |
if (fbcon_decor_active(info, vc_cons[fg_console].d) && |
|
|
2740 |
info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
| 2741 |
|
| 2742 |
u16 *red, *green, *blue; |
| 2743 |
int minlen = min(min(info->var.red.length, info->var.green.length), |
| 2744 |
info->var.blue.length); |
| 2745 |
int h; |
| 2746 |
|
| 2747 |
struct fb_cmap cmap = { |
| 2748 |
.start = 0, |
| 2749 |
.len = (1 << minlen), |
| 2750 |
.red = NULL, |
| 2751 |
.green = NULL, |
| 2752 |
.blue = NULL, |
| 2753 |
.transp = NULL |
| 2754 |
}; |
| 2755 |
|
| 2756 |
red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL); |
| 2757 |
|
| 2758 |
if (!red) |
| 2759 |
goto out; |
| 2760 |
|
| 2761 |
green = red + 256; |
| 2762 |
blue = green + 256; |
| 2763 |
cmap.red = red; |
| 2764 |
cmap.green = green; |
| 2765 |
cmap.blue = blue; |
| 2766 |
|
| 2767 |
for (i = 0; i < cmap.len; i++) { |
| 2768 |
red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1); |
| 2769 |
} |
| 2770 |
|
| 2771 |
h = fb_set_cmap(&cmap, info); |
| 2772 |
fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d); |
| 2773 |
kfree(red); |
| 2774 |
|
| 2775 |
return h; |
| 2776 |
|
| 2777 |
} else if (fbcon_decor_active(info, vc_cons[fg_console].d) && |
| 2778 |
info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL) |
| 2779 |
fb_set_cmap(&info->bgdecor.cmap, info); |
| 2780 |
|
| 2781 |
out: return fb_set_cmap(&palette_cmap, info); |
| 2665 |
} |
2782 |
} |
| 2666 |
|
2783 |
|
| 2667 |
static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) |
2784 |
static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) |
| 2668 |
{ |
2785 |
{ |
| 2669 |
unsigned long p; |
2786 |
unsigned long p; |
| 2670 |
int line; |
2787 |
int line; |
| 2671 |
|
2788 |
|
| 2672 |
if (vc->vc_num != fg_console || !softback_lines) |
2789 |
if (vc->vc_num != fg_console || !softback_lines) |
| 2673 |
return (u16 *) (vc->vc_origin + offset); |
2790 |
return (u16 *) (vc->vc_origin + offset); |
| 2674 |
line = offset / vc->vc_size_row; |
2791 |
line = offset / vc->vc_size_row; |
|
Lines 2887-2893
static void fbcon_modechanged(struct fb_info *info)
Link Here
|
| 2887 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
3004 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
| 2888 |
cols /= vc->vc_font.width; |
3005 |
cols /= vc->vc_font.width; |
| 2889 |
rows /= vc->vc_font.height; |
3006 |
rows /= vc->vc_font.height; |
| 2890 |
vc_resize(vc, cols, rows); |
3007 |
|
|
|
3008 |
if (!fbcon_decor_active_nores(info, vc)) { |
| 3009 |
vc_resize(vc, cols, rows); |
| 3010 |
} else { |
| 3011 |
fbcon_decor_disable(vc, 0); |
| 3012 |
fbcon_decor_call_helper("modechange", vc->vc_num); |
| 3013 |
} |
| 3014 |
|
| 2891 |
updatescrollmode(p, info, vc); |
3015 |
updatescrollmode(p, info, vc); |
| 2892 |
scrollback_max = 0; |
3016 |
scrollback_max = 0; |
| 2893 |
scrollback_current = 0; |
3017 |
scrollback_current = 0; |
|
Lines 2932-2938
static void fbcon_set_all_vcs(struct fb_info *info)
Link Here
|
| 2932 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
3056 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
| 2933 |
cols /= vc->vc_font.width; |
3057 |
cols /= vc->vc_font.width; |
| 2934 |
rows /= vc->vc_font.height; |
3058 |
rows /= vc->vc_font.height; |
| 2935 |
vc_resize(vc, cols, rows); |
3059 |
if (!fbcon_decor_active_nores(info, vc)) { |
|
|
3060 |
vc_resize(vc, cols, rows); |
| 3061 |
} |
| 2936 |
} |
3062 |
} |
| 2937 |
|
3063 |
|
| 2938 |
if (fg != -1) |
3064 |
if (fg != -1) |
|
Lines 3542-3547
static void fbcon_exit(void)
Link Here
|
| 3542 |
} |
3668 |
} |
| 3543 |
} |
3669 |
} |
| 3544 |
|
3670 |
|
|
|
3671 |
fbcon_decor_exit(); |
| 3545 |
fbcon_has_exited = 1; |
3672 |
fbcon_has_exited = 1; |
| 3546 |
} |
3673 |
} |
| 3547 |
|
3674 |
|
|
Lines 3595-3601
static void __exit fb_console_exit(void)
Link Here
|
| 3595 |
fbcon_exit(); |
3722 |
fbcon_exit(); |
| 3596 |
console_unlock(); |
3723 |
console_unlock(); |
| 3597 |
unregister_con_driver(&fb_con); |
3724 |
unregister_con_driver(&fb_con); |
| 3598 |
} |
3725 |
} |
| 3599 |
|
3726 |
|
| 3600 |
module_exit(fb_console_exit); |
3727 |
module_exit(fb_console_exit); |
| 3601 |
|
3728 |
|