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 465-471
static int __init fb_console_setup(char *this_opt)
Link Here
|
465 |
} else |
466 |
} else |
466 |
return 1; |
467 |
return 1; |
467 |
} |
468 |
} |
468 |
|
469 |
|
469 |
if (!strncmp(options, "map:", 4)) { |
470 |
if (!strncmp(options, "map:", 4)) { |
470 |
options += 4; |
471 |
options += 4; |
471 |
if (*options) { |
472 |
if (*options) { |
Lines 490-497
static int __init fb_console_setup(char *this_opt)
Link Here
|
490 |
first_fb_vc = 0; |
491 |
first_fb_vc = 0; |
491 |
if (*options++ == '-') |
492 |
if (*options++ == '-') |
492 |
last_fb_vc = simple_strtoul(options, &options, 10) - 1; |
493 |
last_fb_vc = simple_strtoul(options, &options, 10) - 1; |
493 |
fbcon_is_default = 0; |
494 |
fbcon_is_default = 0; |
494 |
} |
495 |
} |
495 |
|
496 |
|
496 |
if (!strncmp(options, "rotate:", 7)) { |
497 |
if (!strncmp(options, "rotate:", 7)) { |
497 |
options += 7; |
498 |
options += 7; |
Lines 552-557
static int fbcon_takeover(int show_logo)
Link Here
|
552 |
info_idx = -1; |
553 |
info_idx = -1; |
553 |
} else { |
554 |
} else { |
554 |
fbcon_has_console_bind = 1; |
555 |
fbcon_has_console_bind = 1; |
|
|
556 |
#ifdef CONFIG_FB_CON_DECOR |
557 |
fbcon_decor_init(); |
558 |
#endif |
555 |
} |
559 |
} |
556 |
|
560 |
|
557 |
return err; |
561 |
return err; |
Lines 942-948
static const char *fbcon_startup(void)
Link Here
|
942 |
info = registered_fb[info_idx]; |
946 |
info = registered_fb[info_idx]; |
943 |
if (!info) |
947 |
if (!info) |
944 |
return NULL; |
948 |
return NULL; |
945 |
|
949 |
|
946 |
owner = info->fbops->owner; |
950 |
owner = info->fbops->owner; |
947 |
if (!try_module_get(owner)) |
951 |
if (!try_module_get(owner)) |
948 |
return NULL; |
952 |
return NULL; |
Lines 1006-1011
static const char *fbcon_startup(void)
Link Here
|
1006 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
1010 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
1007 |
cols /= vc->vc_font.width; |
1011 |
cols /= vc->vc_font.width; |
1008 |
rows /= vc->vc_font.height; |
1012 |
rows /= vc->vc_font.height; |
|
|
1013 |
|
1014 |
if (fbcon_decor_active(info, vc)) { |
1015 |
cols = vc->vc_decor.twidth / vc->vc_font.width; |
1016 |
rows = vc->vc_decor.theight / vc->vc_font.height; |
1017 |
} |
1018 |
|
1009 |
vc_resize(vc, cols, rows); |
1019 |
vc_resize(vc, cols, rows); |
1010 |
|
1020 |
|
1011 |
DPRINTK("mode: %s\n", info->fix.id); |
1021 |
DPRINTK("mode: %s\n", info->fix.id); |
Lines 1035-1041
static void fbcon_init(struct vc_data *vc, int init)
Link Here
|
1035 |
cap = info->flags; |
1045 |
cap = info->flags; |
1036 |
|
1046 |
|
1037 |
if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW || |
1047 |
if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW || |
1038 |
(info->fix.type == FB_TYPE_TEXT)) |
1048 |
(info->fix.type == FB_TYPE_TEXT) || fbcon_decor_active(info, vc)) |
1039 |
logo = 0; |
1049 |
logo = 0; |
1040 |
|
1050 |
|
1041 |
if (var_to_display(p, &info->var, info)) |
1051 |
if (var_to_display(p, &info->var, info)) |
Lines 1245-1250
static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height,
Link Here
|
1245 |
if (sy < vc->vc_top && vc->vc_top == logo_lines) |
1255 |
if (sy < vc->vc_top && vc->vc_top == logo_lines) |
1246 |
vc->vc_top = 0; |
1256 |
vc->vc_top = 0; |
1247 |
|
1257 |
|
|
|
1258 |
if (fbcon_decor_active(info, vc)) { |
1259 |
fbcon_decor_clear(vc, info, sy, sx, height, width); |
1260 |
return; |
1261 |
} |
1262 |
|
1248 |
/* Split blits that cross physical y_wrap boundary */ |
1263 |
/* Split blits that cross physical y_wrap boundary */ |
1249 |
|
1264 |
|
1250 |
y_break = p->vrows - p->yscroll; |
1265 |
y_break = p->vrows - p->yscroll; |
Lines 1264-1273
static void fbcon_putcs(struct vc_data *vc, const unsigned short *s,
Link Here
|
1264 |
struct display *p = &fb_display[vc->vc_num]; |
1279 |
struct display *p = &fb_display[vc->vc_num]; |
1265 |
struct fbcon_ops *ops = info->fbcon_par; |
1280 |
struct fbcon_ops *ops = info->fbcon_par; |
1266 |
|
1281 |
|
1267 |
if (!fbcon_is_inactive(vc, info)) |
1282 |
if (!fbcon_is_inactive(vc, info)) { |
1268 |
ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, |
1283 |
|
1269 |
get_color(vc, info, scr_readw(s), 1), |
1284 |
if (fbcon_decor_active(info, vc)) |
1270 |
get_color(vc, info, scr_readw(s), 0)); |
1285 |
fbcon_decor_putcs(vc, info, s, count, ypos, xpos); |
|
|
1286 |
else |
1287 |
ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, |
1288 |
get_color(vc, info, scr_readw(s), 1), |
1289 |
get_color(vc, info, scr_readw(s), 0)); |
1290 |
} |
1271 |
} |
1291 |
} |
1272 |
|
1292 |
|
1273 |
static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) |
1293 |
static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) |
Lines 1283-1290
static void fbcon_clear_margins(struct vc_data *vc, int bottom_only)
Link Here
|
1283 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1303 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1284 |
struct fbcon_ops *ops = info->fbcon_par; |
1304 |
struct fbcon_ops *ops = info->fbcon_par; |
1285 |
|
1305 |
|
1286 |
if (!fbcon_is_inactive(vc, info)) |
1306 |
if (!fbcon_is_inactive(vc, info)) { |
1287 |
ops->clear_margins(vc, info, bottom_only); |
1307 |
if (fbcon_decor_active(info, vc)) { |
|
|
1308 |
fbcon_decor_clear_margins(vc, info, bottom_only); |
1309 |
} else { |
1310 |
ops->clear_margins(vc, info, bottom_only); |
1311 |
} |
1312 |
} |
1288 |
} |
1313 |
} |
1289 |
|
1314 |
|
1290 |
static void fbcon_cursor(struct vc_data *vc, int mode) |
1315 |
static void fbcon_cursor(struct vc_data *vc, int mode) |
Lines 1394-1400
static __inline__ void ywrap_up(struct vc_data *vc, int count)
Link Here
|
1394 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1419 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1395 |
struct fbcon_ops *ops = info->fbcon_par; |
1420 |
struct fbcon_ops *ops = info->fbcon_par; |
1396 |
struct display *p = &fb_display[vc->vc_num]; |
1421 |
struct display *p = &fb_display[vc->vc_num]; |
1397 |
|
1422 |
|
1398 |
p->yscroll += count; |
1423 |
p->yscroll += count; |
1399 |
if (p->yscroll >= p->vrows) /* Deal with wrap */ |
1424 |
if (p->yscroll >= p->vrows) /* Deal with wrap */ |
1400 |
p->yscroll -= p->vrows; |
1425 |
p->yscroll -= p->vrows; |
Lines 1413-1419
static __inline__ void ywrap_down(struct vc_data *vc, int count)
Link Here
|
1413 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1438 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1414 |
struct fbcon_ops *ops = info->fbcon_par; |
1439 |
struct fbcon_ops *ops = info->fbcon_par; |
1415 |
struct display *p = &fb_display[vc->vc_num]; |
1440 |
struct display *p = &fb_display[vc->vc_num]; |
1416 |
|
1441 |
|
1417 |
p->yscroll -= count; |
1442 |
p->yscroll -= count; |
1418 |
if (p->yscroll < 0) /* Deal with wrap */ |
1443 |
if (p->yscroll < 0) /* Deal with wrap */ |
1419 |
p->yscroll += p->vrows; |
1444 |
p->yscroll += p->vrows; |
Lines 1480-1486
static __inline__ void ypan_down(struct vc_data *vc, int count)
Link Here
|
1480 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1505 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1481 |
struct display *p = &fb_display[vc->vc_num]; |
1506 |
struct display *p = &fb_display[vc->vc_num]; |
1482 |
struct fbcon_ops *ops = info->fbcon_par; |
1507 |
struct fbcon_ops *ops = info->fbcon_par; |
1483 |
|
1508 |
|
1484 |
p->yscroll -= count; |
1509 |
p->yscroll -= count; |
1485 |
if (p->yscroll < 0) { |
1510 |
if (p->yscroll < 0) { |
1486 |
ops->bmove(vc, info, 0, 0, p->vrows - vc->vc_rows, |
1511 |
ops->bmove(vc, info, 0, 0, p->vrows - vc->vc_rows, |
Lines 1804-1810
static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
Link Here
|
1804 |
count = vc->vc_rows; |
1829 |
count = vc->vc_rows; |
1805 |
if (softback_top) |
1830 |
if (softback_top) |
1806 |
fbcon_softback_note(vc, t, count); |
1831 |
fbcon_softback_note(vc, t, count); |
1807 |
if (logo_shown >= 0) |
1832 |
if (logo_shown >= 0 || fbcon_decor_active(info, vc)) |
1808 |
goto redraw_up; |
1833 |
goto redraw_up; |
1809 |
switch (p->scrollmode) { |
1834 |
switch (p->scrollmode) { |
1810 |
case SCROLL_MOVE: |
1835 |
case SCROLL_MOVE: |
Lines 1897-1902
static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
Link Here
|
1897 |
count = vc->vc_rows; |
1922 |
count = vc->vc_rows; |
1898 |
if (logo_shown >= 0) |
1923 |
if (logo_shown >= 0) |
1899 |
goto redraw_down; |
1924 |
goto redraw_down; |
|
|
1925 |
if (fbcon_decor_active(info, vc)) |
1926 |
goto redraw_down; |
1900 |
switch (p->scrollmode) { |
1927 |
switch (p->scrollmode) { |
1901 |
case SCROLL_MOVE: |
1928 |
case SCROLL_MOVE: |
1902 |
fbcon_redraw_blit(vc, info, p, b - 1, b - t - count, |
1929 |
fbcon_redraw_blit(vc, info, p, b - 1, b - t - count, |
Lines 1989-1995
static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
Link Here
|
1989 |
{ |
2016 |
{ |
1990 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
2017 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1991 |
struct display *p = &fb_display[vc->vc_num]; |
2018 |
struct display *p = &fb_display[vc->vc_num]; |
1992 |
|
2019 |
|
1993 |
if (fbcon_is_inactive(vc, info)) |
2020 |
if (fbcon_is_inactive(vc, info)) |
1994 |
return; |
2021 |
return; |
1995 |
|
2022 |
|
Lines 2007-2013
static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx,
Link Here
|
2007 |
p->vrows - p->yscroll); |
2034 |
p->vrows - p->yscroll); |
2008 |
} |
2035 |
} |
2009 |
|
2036 |
|
2010 |
static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, |
2037 |
static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, |
2011 |
int dy, int dx, int height, int width, u_int y_break) |
2038 |
int dy, int dx, int height, int width, u_int y_break) |
2012 |
{ |
2039 |
{ |
2013 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
2040 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
Lines 2045-2050
static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s
Link Here
|
2045 |
} |
2072 |
} |
2046 |
return; |
2073 |
return; |
2047 |
} |
2074 |
} |
|
|
2075 |
|
2076 |
if (fbcon_decor_active(info, vc) && sy == dy && height == 1) { |
2077 |
/* must use slower redraw bmove to keep background pic intact */ |
2078 |
fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width); |
2079 |
return; |
2080 |
} |
2081 |
|
2048 |
ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, |
2082 |
ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, |
2049 |
height, width); |
2083 |
height, width); |
2050 |
} |
2084 |
} |
Lines 2096-2102
static void updatescrollmode(struct display *p,
Link Here
|
2096 |
} |
2130 |
} |
2097 |
} |
2131 |
} |
2098 |
|
2132 |
|
2099 |
static int fbcon_resize(struct vc_data *vc, unsigned int width, |
2133 |
static int fbcon_resize(struct vc_data *vc, unsigned int width, |
2100 |
unsigned int height, unsigned int user) |
2134 |
unsigned int height, unsigned int user) |
2101 |
{ |
2135 |
{ |
2102 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
2136 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
Lines 2115-2122
static int fbcon_resize(struct vc_data *vc, unsigned int width,
Link Here
|
2115 |
var.yres = virt_h * virt_fh; |
2149 |
var.yres = virt_h * virt_fh; |
2116 |
x_diff = info->var.xres - var.xres; |
2150 |
x_diff = info->var.xres - var.xres; |
2117 |
y_diff = info->var.yres - var.yres; |
2151 |
y_diff = info->var.yres - var.yres; |
2118 |
if (x_diff < 0 || x_diff > virt_fw || |
2152 |
if ((x_diff < 0 || x_diff > virt_fw || |
2119 |
y_diff < 0 || y_diff > virt_fh) { |
2153 |
y_diff < 0 || y_diff > virt_fh) && !vc->vc_decor.state) { |
2120 |
const struct fb_videomode *mode; |
2154 |
const struct fb_videomode *mode; |
2121 |
|
2155 |
|
2122 |
DPRINTK("attempting resize %ix%i\n", var.xres, var.yres); |
2156 |
DPRINTK("attempting resize %ix%i\n", var.xres, var.yres); |
Lines 2152-2157
static int fbcon_switch(struct vc_data *vc)
Link Here
|
2152 |
|
2186 |
|
2153 |
info = registered_fb[con2fb_map[vc->vc_num]]; |
2187 |
info = registered_fb[con2fb_map[vc->vc_num]]; |
2154 |
ops = info->fbcon_par; |
2188 |
ops = info->fbcon_par; |
|
|
2189 |
prev_console = ops->currcon; |
2190 |
if (prev_console != -1) |
2191 |
old_info = registered_fb[con2fb_map[prev_console]]; |
2192 |
|
2193 |
#ifdef CONFIG_FB_CON_DECOR |
2194 |
if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
2195 |
struct vc_data *vc_curr = vc_cons[prev_console].d; |
2196 |
if (vc_curr && fbcon_decor_active_vc(vc_curr)) { |
2197 |
/* Clear the screen to avoid displaying funky colors during |
2198 |
* palette updates. */ |
2199 |
memset((u8*)info->screen_base + info->fix.line_length * info->var.yoffset, |
2200 |
0, info->var.yres * info->fix.line_length); |
2201 |
} |
2202 |
} |
2203 |
#endif |
2155 |
|
2204 |
|
2156 |
if (softback_top) { |
2205 |
if (softback_top) { |
2157 |
if (softback_lines) |
2206 |
if (softback_lines) |
Lines 2170-2178
static int fbcon_switch(struct vc_data *vc)
Link Here
|
2170 |
logo_shown = FBCON_LOGO_CANSHOW; |
2219 |
logo_shown = FBCON_LOGO_CANSHOW; |
2171 |
} |
2220 |
} |
2172 |
|
2221 |
|
2173 |
prev_console = ops->currcon; |
|
|
2174 |
if (prev_console != -1) |
2175 |
old_info = registered_fb[con2fb_map[prev_console]]; |
2176 |
/* |
2222 |
/* |
2177 |
* FIXME: If we have multiple fbdev's loaded, we need to |
2223 |
* FIXME: If we have multiple fbdev's loaded, we need to |
2178 |
* update all info->currcon. Perhaps, we can place this |
2224 |
* update all info->currcon. Perhaps, we can place this |
Lines 2216-2221
static int fbcon_switch(struct vc_data *vc)
Link Here
|
2216 |
fbcon_del_cursor_timer(old_info); |
2262 |
fbcon_del_cursor_timer(old_info); |
2217 |
} |
2263 |
} |
2218 |
|
2264 |
|
|
|
2265 |
if (fbcon_decor_active_vc(vc)) { |
2266 |
struct vc_data *vc_curr = vc_cons[prev_console].d; |
2267 |
|
2268 |
if (!vc_curr->vc_decor.theme || |
2269 |
strcmp(vc->vc_decor.theme, vc_curr->vc_decor.theme) || |
2270 |
(fbcon_decor_active_nores(info, vc_curr) && |
2271 |
!fbcon_decor_active(info, vc_curr))) { |
2272 |
fbcon_decor_disable(vc, 0); |
2273 |
fbcon_decor_call_helper("modechange", vc->vc_num); |
2274 |
} |
2275 |
} |
2276 |
|
2219 |
if (fbcon_is_inactive(vc, info) || |
2277 |
if (fbcon_is_inactive(vc, info) || |
2220 |
ops->blank_state != FB_BLANK_UNBLANK) |
2278 |
ops->blank_state != FB_BLANK_UNBLANK) |
2221 |
fbcon_del_cursor_timer(info); |
2279 |
fbcon_del_cursor_timer(info); |
Lines 2264-2274
static int fbcon_switch(struct vc_data *vc)
Link Here
|
2264 |
ops->update_start(info); |
2322 |
ops->update_start(info); |
2265 |
} |
2323 |
} |
2266 |
|
2324 |
|
2267 |
fbcon_set_palette(vc, color_table); |
2325 |
fbcon_set_palette(vc, color_table); |
2268 |
fbcon_clear_margins(vc, 0); |
2326 |
fbcon_clear_margins(vc, 0); |
2269 |
|
2327 |
|
2270 |
if (logo_shown == FBCON_LOGO_DRAW) { |
2328 |
if (logo_shown == FBCON_LOGO_DRAW) { |
2271 |
|
|
|
2272 |
logo_shown = fg_console; |
2329 |
logo_shown = fg_console; |
2273 |
/* This is protected above by initmem_freed */ |
2330 |
/* This is protected above by initmem_freed */ |
2274 |
fb_show_logo(info, ops->rotate); |
2331 |
fb_show_logo(info, ops->rotate); |
Lines 2324-2338
static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
Link Here
|
2324 |
} |
2381 |
} |
2325 |
} |
2382 |
} |
2326 |
|
2383 |
|
2327 |
if (!fbcon_is_inactive(vc, info)) { |
2384 |
if (!fbcon_is_inactive(vc, info)) { |
2328 |
if (ops->blank_state != blank) { |
2385 |
if (ops->blank_state != blank) { |
2329 |
ops->blank_state = blank; |
2386 |
ops->blank_state = blank; |
2330 |
fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); |
2387 |
fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); |
2331 |
ops->cursor_flash = (!blank); |
2388 |
ops->cursor_flash = (!blank); |
2332 |
|
2389 |
|
2333 |
if (!(info->flags & FBINFO_MISC_USEREVENT)) |
2390 |
if (!(info->flags & FBINFO_MISC_USEREVENT)) { |
2334 |
if (fb_blank(info, blank)) |
2391 |
if (fb_blank(info, blank)) { |
2335 |
fbcon_generic_blank(vc, info, blank); |
2392 |
if (fbcon_decor_active(info, vc)) |
|
|
2393 |
fbcon_decor_blank(vc, info, blank); |
2394 |
else |
2395 |
fbcon_generic_blank(vc, info, blank); |
2396 |
} |
2397 |
} |
2336 |
} |
2398 |
} |
2337 |
|
2399 |
|
2338 |
if (!blank) |
2400 |
if (!blank) |
Lines 2454-2460
static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
Link Here
|
2454 |
vc->vc_complement_mask >>= 1; |
2516 |
vc->vc_complement_mask >>= 1; |
2455 |
vc->vc_s_complement_mask >>= 1; |
2517 |
vc->vc_s_complement_mask >>= 1; |
2456 |
} |
2518 |
} |
2457 |
|
2519 |
|
2458 |
/* ++Edmund: reorder the attribute bits */ |
2520 |
/* ++Edmund: reorder the attribute bits */ |
2459 |
if (vc->vc_can_do_color) { |
2521 |
if (vc->vc_can_do_color) { |
2460 |
unsigned short *cp = |
2522 |
unsigned short *cp = |
Lines 2477-2483
static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
Link Here
|
2477 |
vc->vc_complement_mask <<= 1; |
2539 |
vc->vc_complement_mask <<= 1; |
2478 |
vc->vc_s_complement_mask <<= 1; |
2540 |
vc->vc_s_complement_mask <<= 1; |
2479 |
} |
2541 |
} |
2480 |
|
2542 |
|
2481 |
/* ++Edmund: reorder the attribute bits */ |
2543 |
/* ++Edmund: reorder the attribute bits */ |
2482 |
{ |
2544 |
{ |
2483 |
unsigned short *cp = |
2545 |
unsigned short *cp = |
Lines 2507-2519
static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
Link Here
|
2507 |
} |
2569 |
} |
2508 |
|
2570 |
|
2509 |
if (resize) { |
2571 |
if (resize) { |
|
|
2572 |
/* reset wrap/pan */ |
2510 |
int cols, rows; |
2573 |
int cols, rows; |
2511 |
|
2574 |
|
2512 |
cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); |
2575 |
cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); |
2513 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
2576 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
|
|
2577 |
|
2578 |
if (fbcon_decor_active(info, vc)) { |
2579 |
info->var.xoffset = info->var.yoffset = p->yscroll = 0; |
2580 |
cols = vc->vc_decor.twidth; |
2581 |
rows = vc->vc_decor.theight; |
2582 |
} |
2514 |
cols /= w; |
2583 |
cols /= w; |
2515 |
rows /= h; |
2584 |
rows /= h; |
|
|
2585 |
|
2516 |
vc_resize(vc, cols, rows); |
2586 |
vc_resize(vc, cols, rows); |
|
|
2587 |
|
2517 |
if (CON_IS_VISIBLE(vc) && softback_buf) |
2588 |
if (CON_IS_VISIBLE(vc) && softback_buf) |
2518 |
fbcon_update_softback(vc); |
2589 |
fbcon_update_softback(vc); |
2519 |
} else if (CON_IS_VISIBLE(vc) |
2590 |
} else if (CON_IS_VISIBLE(vc) |
Lines 2597-2603
static int fbcon_set_font(struct vc_data *vc, struct console_font *font, unsigne
Link Here
|
2597 |
/* Check if the same font is on some other console already */ |
2661 |
/* Check if the same font is on some other console already */ |
2598 |
for (i = first_fb_vc; i <= last_fb_vc; i++) { |
2662 |
for (i = first_fb_vc; i <= last_fb_vc; i++) { |
2599 |
struct vc_data *tmp = vc_cons[i].d; |
2663 |
struct vc_data *tmp = vc_cons[i].d; |
2600 |
|
2664 |
|
2601 |
if (fb_display[i].userfont && |
2665 |
if (fb_display[i].userfont && |
2602 |
fb_display[i].fontdata && |
2666 |
fb_display[i].fontdata && |
2603 |
FNTSUM(fb_display[i].fontdata) == csum && |
2667 |
FNTSUM(fb_display[i].fontdata) == csum && |
Lines 2642-2648
static int fbcon_set_palette(struct vc_data *vc, unsigned char *table)
Link Here
|
2642 |
int i, j, k, depth; |
2713 |
int i, j, k, depth; |
2643 |
u8 val; |
2714 |
u8 val; |
2644 |
|
2715 |
|
2645 |
if (fbcon_is_inactive(vc, info)) |
2716 |
if (fbcon_is_inactive(vc, info) |
|
|
2717 |
#ifdef CONFIG_FB_CON_DECOR |
2718 |
|| vc->vc_num != fg_console |
2719 |
#endif |
2720 |
) |
2646 |
return -EINVAL; |
2721 |
return -EINVAL; |
2647 |
|
2722 |
|
2648 |
if (!CON_IS_VISIBLE(vc)) |
2723 |
if (!CON_IS_VISIBLE(vc)) |
Lines 2668-2681
static int fbcon_set_palette(struct vc_data *vc, unsigned char *table)
Link Here
|
2668 |
} else |
2743 |
} else |
2669 |
fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap); |
2744 |
fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap); |
2670 |
|
2745 |
|
2671 |
return fb_set_cmap(&palette_cmap, info); |
2746 |
if (fbcon_decor_active(info, vc_cons[fg_console].d) && |
|
|
2747 |
info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
2748 |
|
2749 |
u16 *red, *green, *blue; |
2750 |
int minlen = min(min(info->var.red.length, info->var.green.length), |
2751 |
info->var.blue.length); |
2752 |
int h; |
2753 |
|
2754 |
struct fb_cmap cmap = { |
2755 |
.start = 0, |
2756 |
.len = (1 << minlen), |
2757 |
.red = NULL, |
2758 |
.green = NULL, |
2759 |
.blue = NULL, |
2760 |
.transp = NULL |
2761 |
}; |
2762 |
|
2763 |
red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL); |
2764 |
|
2765 |
if (!red) |
2766 |
goto out; |
2767 |
|
2768 |
green = red + 256; |
2769 |
blue = green + 256; |
2770 |
cmap.red = red; |
2771 |
cmap.green = green; |
2772 |
cmap.blue = blue; |
2773 |
|
2774 |
for (i = 0; i < cmap.len; i++) { |
2775 |
red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1); |
2776 |
} |
2777 |
|
2778 |
h = fb_set_cmap(&cmap, info); |
2779 |
fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d); |
2780 |
kfree(red); |
2781 |
|
2782 |
return h; |
2783 |
|
2784 |
} else if (fbcon_decor_active(info, vc_cons[fg_console].d) && |
2785 |
info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL) |
2786 |
fb_set_cmap(&info->bgdecor.cmap, info); |
2787 |
|
2788 |
out: return fb_set_cmap(&palette_cmap, info); |
2672 |
} |
2789 |
} |
2673 |
|
2790 |
|
2674 |
static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) |
2791 |
static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) |
2675 |
{ |
2792 |
{ |
2676 |
unsigned long p; |
2793 |
unsigned long p; |
2677 |
int line; |
2794 |
int line; |
2678 |
|
2795 |
|
2679 |
if (vc->vc_num != fg_console || !softback_lines) |
2796 |
if (vc->vc_num != fg_console || !softback_lines) |
2680 |
return (u16 *) (vc->vc_origin + offset); |
2797 |
return (u16 *) (vc->vc_origin + offset); |
2681 |
line = offset / vc->vc_size_row; |
2798 |
line = offset / vc->vc_size_row; |
Lines 2894-2900
static void fbcon_modechanged(struct fb_info *info)
Link Here
|
2894 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
3011 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
2895 |
cols /= vc->vc_font.width; |
3012 |
cols /= vc->vc_font.width; |
2896 |
rows /= vc->vc_font.height; |
3013 |
rows /= vc->vc_font.height; |
2897 |
vc_resize(vc, cols, rows); |
3014 |
|
|
|
3015 |
if (!fbcon_decor_active_nores(info, vc)) { |
3016 |
vc_resize(vc, cols, rows); |
3017 |
} else { |
3018 |
fbcon_decor_disable(vc, 0); |
3019 |
fbcon_decor_call_helper("modechange", vc->vc_num); |
3020 |
} |
3021 |
|
2898 |
updatescrollmode(p, info, vc); |
3022 |
updatescrollmode(p, info, vc); |
2899 |
scrollback_max = 0; |
3023 |
scrollback_max = 0; |
2900 |
scrollback_current = 0; |
3024 |
scrollback_current = 0; |
Lines 2939-2945
static void fbcon_set_all_vcs(struct fb_info *info)
Link Here
|
2939 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
3063 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
2940 |
cols /= vc->vc_font.width; |
3064 |
cols /= vc->vc_font.width; |
2941 |
rows /= vc->vc_font.height; |
3065 |
rows /= vc->vc_font.height; |
2942 |
vc_resize(vc, cols, rows); |
3066 |
if (!fbcon_decor_active_nores(info, vc)) { |
|
|
3067 |
vc_resize(vc, cols, rows); |
3068 |
} |
2943 |
} |
3069 |
} |
2944 |
|
3070 |
|
2945 |
if (fg != -1) |
3071 |
if (fg != -1) |
Lines 3549-3554
static void fbcon_exit(void)
Link Here
|
3549 |
} |
3675 |
} |
3550 |
} |
3676 |
} |
3551 |
|
3677 |
|
|
|
3678 |
fbcon_decor_exit(); |
3552 |
fbcon_has_exited = 1; |
3679 |
fbcon_has_exited = 1; |
3553 |
} |
3680 |
} |
3554 |
|
3681 |
|
Lines 3602-3608
static void __exit fb_console_exit(void)
Link Here
|
3602 |
fbcon_exit(); |
3729 |
fbcon_exit(); |
3603 |
console_unlock(); |
3730 |
console_unlock(); |
3604 |
unregister_con_driver(&fb_con); |
3731 |
unregister_con_driver(&fb_con); |
3605 |
} |
3732 |
} |
3606 |
|
3733 |
|
3607 |
module_exit(fb_console_exit); |
3734 |
module_exit(fb_console_exit); |
3608 |
|
3735 |
|