|
Lines 80-85
Link Here
|
| 80 |
#include <asm/irq.h> |
80 |
#include <asm/irq.h> |
| 81 |
|
81 |
|
| 82 |
#include "fbcon.h" |
82 |
#include "fbcon.h" |
|
|
83 |
#include "../../console/fbcondecor.h" |
| 83 |
|
84 |
|
| 84 |
#ifdef FBCONDEBUG |
85 |
#ifdef FBCONDEBUG |
| 85 |
# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args) |
86 |
# define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args) |
|
Lines 95-101
Link Here
|
| 95 |
|
96 |
|
| 96 |
static struct display fb_display[MAX_NR_CONSOLES]; |
97 |
static struct display fb_display[MAX_NR_CONSOLES]; |
| 97 |
|
98 |
|
| 98 |
static signed char con2fb_map[MAX_NR_CONSOLES]; |
99 |
signed char con2fb_map[MAX_NR_CONSOLES]; |
| 99 |
static signed char con2fb_map_boot[MAX_NR_CONSOLES]; |
100 |
static signed char con2fb_map_boot[MAX_NR_CONSOLES]; |
| 100 |
|
101 |
|
| 101 |
static int logo_lines; |
102 |
static int logo_lines; |
|
Lines 287-293
Link Here
|
| 287 |
vc->vc_mode != KD_TEXT || ops->graphics); |
288 |
vc->vc_mode != KD_TEXT || ops->graphics); |
| 288 |
} |
289 |
} |
| 289 |
|
290 |
|
| 290 |
static int get_color(struct vc_data *vc, struct fb_info *info, |
291 |
int get_color(struct vc_data *vc, struct fb_info *info, |
| 291 |
u16 c, int is_fg) |
292 |
u16 c, int is_fg) |
| 292 |
{ |
293 |
{ |
| 293 |
int depth = fb_get_color_depth(&info->var, &info->fix); |
294 |
int depth = fb_get_color_depth(&info->var, &info->fix); |
|
Lines 561-566
Link Here
|
| 561 |
info_idx = -1; |
562 |
info_idx = -1; |
| 562 |
} else { |
563 |
} else { |
| 563 |
fbcon_has_console_bind = 1; |
564 |
fbcon_has_console_bind = 1; |
|
|
565 |
#ifdef CONFIG_FB_CON_DECOR |
| 566 |
fbcon_decor_init(); |
| 567 |
#endif |
| 564 |
} |
568 |
} |
| 565 |
|
569 |
|
| 566 |
return err; |
570 |
return err; |
|
Lines 1031-1036
Link Here
|
| 1031 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
1035 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
| 1032 |
cols /= vc->vc_font.width; |
1036 |
cols /= vc->vc_font.width; |
| 1033 |
rows /= vc->vc_font.height; |
1037 |
rows /= vc->vc_font.height; |
|
|
1038 |
|
| 1039 |
if (fbcon_decor_active(info, vc)) { |
| 1040 |
cols = vc->vc_decor.twidth / vc->vc_font.width; |
| 1041 |
rows = vc->vc_decor.theight / vc->vc_font.height; |
| 1042 |
} |
| 1043 |
|
| 1034 |
vc_resize(vc, cols, rows); |
1044 |
vc_resize(vc, cols, rows); |
| 1035 |
|
1045 |
|
| 1036 |
DPRINTK("mode: %s\n", info->fix.id); |
1046 |
DPRINTK("mode: %s\n", info->fix.id); |
|
Lines 1060-1066
Link Here
|
| 1060 |
cap = info->flags; |
1070 |
cap = info->flags; |
| 1061 |
|
1071 |
|
| 1062 |
if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW || |
1072 |
if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW || |
| 1063 |
(info->fix.type == FB_TYPE_TEXT)) |
1073 |
(info->fix.type == FB_TYPE_TEXT) || fbcon_decor_active(info, vc)) |
| 1064 |
logo = 0; |
1074 |
logo = 0; |
| 1065 |
|
1075 |
|
| 1066 |
if (var_to_display(p, &info->var, info)) |
1076 |
if (var_to_display(p, &info->var, info)) |
|
Lines 1295-1300
Link Here
|
| 1295 |
fbcon_clear_margins(vc, 0); |
1305 |
fbcon_clear_margins(vc, 0); |
| 1296 |
} |
1306 |
} |
| 1297 |
|
1307 |
|
|
|
1308 |
if (fbcon_decor_active(info, vc)) { |
| 1309 |
fbcon_decor_clear(vc, info, sy, sx, height, width); |
| 1310 |
return; |
| 1311 |
} |
| 1312 |
|
| 1298 |
/* Split blits that cross physical y_wrap boundary */ |
1313 |
/* Split blits that cross physical y_wrap boundary */ |
| 1299 |
|
1314 |
|
| 1300 |
y_break = p->vrows - p->yscroll; |
1315 |
y_break = p->vrows - p->yscroll; |
|
Lines 1314-1323
Link Here
|
| 1314 |
struct display *p = &fb_display[vc->vc_num]; |
1329 |
struct display *p = &fb_display[vc->vc_num]; |
| 1315 |
struct fbcon_ops *ops = info->fbcon_par; |
1330 |
struct fbcon_ops *ops = info->fbcon_par; |
| 1316 |
|
1331 |
|
| 1317 |
if (!fbcon_is_inactive(vc, info)) |
1332 |
if (!fbcon_is_inactive(vc, info)) { |
| 1318 |
ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, |
1333 |
|
| 1319 |
get_color(vc, info, scr_readw(s), 1), |
1334 |
if (fbcon_decor_active(info, vc)) |
| 1320 |
get_color(vc, info, scr_readw(s), 0)); |
1335 |
fbcon_decor_putcs(vc, info, s, count, ypos, xpos); |
|
|
1336 |
else |
| 1337 |
ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, |
| 1338 |
get_color(vc, info, scr_readw(s), 1), |
| 1339 |
get_color(vc, info, scr_readw(s), 0)); |
| 1340 |
} |
| 1321 |
} |
1341 |
} |
| 1322 |
|
1342 |
|
| 1323 |
static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) |
1343 |
static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) |
|
Lines 1333-1340
Link Here
|
| 1333 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
1353 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
| 1334 |
struct fbcon_ops *ops = info->fbcon_par; |
1354 |
struct fbcon_ops *ops = info->fbcon_par; |
| 1335 |
|
1355 |
|
| 1336 |
if (!fbcon_is_inactive(vc, info)) |
1356 |
if (!fbcon_is_inactive(vc, info)) { |
| 1337 |
ops->clear_margins(vc, info, margin_color, bottom_only); |
1357 |
if (fbcon_decor_active(info, vc)) |
|
|
1358 |
fbcon_decor_clear_margins(vc, info, bottom_only); |
| 1359 |
else |
| 1360 |
ops->clear_margins(vc, info, margin_color, bottom_only); |
| 1361 |
} |
| 1338 |
} |
1362 |
} |
| 1339 |
|
1363 |
|
| 1340 |
static void fbcon_cursor(struct vc_data *vc, int mode) |
1364 |
static void fbcon_cursor(struct vc_data *vc, int mode) |
|
Lines 1855-1861
Link Here
|
| 1855 |
count = vc->vc_rows; |
1879 |
count = vc->vc_rows; |
| 1856 |
if (softback_top) |
1880 |
if (softback_top) |
| 1857 |
fbcon_softback_note(vc, t, count); |
1881 |
fbcon_softback_note(vc, t, count); |
| 1858 |
if (logo_shown >= 0) |
1882 |
if (logo_shown >= 0 || fbcon_decor_active(info, vc)) |
| 1859 |
goto redraw_up; |
1883 |
goto redraw_up; |
| 1860 |
switch (p->scrollmode) { |
1884 |
switch (p->scrollmode) { |
| 1861 |
case SCROLL_MOVE: |
1885 |
case SCROLL_MOVE: |
|
Lines 1948-1953
Link Here
|
| 1948 |
count = vc->vc_rows; |
1972 |
count = vc->vc_rows; |
| 1949 |
if (logo_shown >= 0) |
1973 |
if (logo_shown >= 0) |
| 1950 |
goto redraw_down; |
1974 |
goto redraw_down; |
|
|
1975 |
if (fbcon_decor_active(info, vc)) |
| 1976 |
goto redraw_down; |
| 1951 |
switch (p->scrollmode) { |
1977 |
switch (p->scrollmode) { |
| 1952 |
case SCROLL_MOVE: |
1978 |
case SCROLL_MOVE: |
| 1953 |
fbcon_redraw_blit(vc, info, p, b - 1, b - t - count, |
1979 |
fbcon_redraw_blit(vc, info, p, b - 1, b - t - count, |
|
Lines 2096-2101
Link Here
|
| 2096 |
} |
2122 |
} |
| 2097 |
return; |
2123 |
return; |
| 2098 |
} |
2124 |
} |
|
|
2125 |
|
| 2126 |
if (fbcon_decor_active(info, vc) && sy == dy && height == 1) { |
| 2127 |
/* must use slower redraw bmove to keep background pic intact */ |
| 2128 |
fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width); |
| 2129 |
return; |
| 2130 |
} |
| 2131 |
|
| 2099 |
ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, |
2132 |
ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, |
| 2100 |
height, width); |
2133 |
height, width); |
| 2101 |
} |
2134 |
} |
|
Lines 2166-2173
Link Here
|
| 2166 |
var.yres = virt_h * virt_fh; |
2199 |
var.yres = virt_h * virt_fh; |
| 2167 |
x_diff = info->var.xres - var.xres; |
2200 |
x_diff = info->var.xres - var.xres; |
| 2168 |
y_diff = info->var.yres - var.yres; |
2201 |
y_diff = info->var.yres - var.yres; |
| 2169 |
if (x_diff < 0 || x_diff > virt_fw || |
2202 |
if ((x_diff < 0 || x_diff > virt_fw || |
| 2170 |
y_diff < 0 || y_diff > virt_fh) { |
2203 |
y_diff < 0 || y_diff > virt_fh) && !vc->vc_decor.state) { |
| 2171 |
const struct fb_videomode *mode; |
2204 |
const struct fb_videomode *mode; |
| 2172 |
|
2205 |
|
| 2173 |
DPRINTK("attempting resize %ix%i\n", var.xres, var.yres); |
2206 |
DPRINTK("attempting resize %ix%i\n", var.xres, var.yres); |
|
Lines 2203-2208
Link Here
|
| 2203 |
|
2236 |
|
| 2204 |
info = registered_fb[con2fb_map[vc->vc_num]]; |
2237 |
info = registered_fb[con2fb_map[vc->vc_num]]; |
| 2205 |
ops = info->fbcon_par; |
2238 |
ops = info->fbcon_par; |
|
|
2239 |
prev_console = ops->currcon; |
| 2240 |
if (prev_console != -1) |
| 2241 |
old_info = registered_fb[con2fb_map[prev_console]]; |
| 2242 |
|
| 2243 |
#ifdef CONFIG_FB_CON_DECOR |
| 2244 |
if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
| 2245 |
struct vc_data *vc_curr = vc_cons[prev_console].d; |
| 2246 |
|
| 2247 |
if (vc_curr && fbcon_decor_active_vc(vc_curr)) { |
| 2248 |
// Clear the screen to avoid displaying funky colors |
| 2249 |
// during palette updates. |
| 2250 |
memset((u8 *)info->screen_base + info->fix.line_length * info->var.yoffset, |
| 2251 |
0, info->var.yres * info->fix.line_length); |
| 2252 |
} |
| 2253 |
} |
| 2254 |
#endif |
| 2206 |
|
2255 |
|
| 2207 |
if (softback_top) { |
2256 |
if (softback_top) { |
| 2208 |
if (softback_lines) |
2257 |
if (softback_lines) |
|
Lines 2221-2229
Link Here
|
| 2221 |
logo_shown = FBCON_LOGO_CANSHOW; |
2270 |
logo_shown = FBCON_LOGO_CANSHOW; |
| 2222 |
} |
2271 |
} |
| 2223 |
|
2272 |
|
| 2224 |
prev_console = ops->currcon; |
|
|
| 2225 |
if (prev_console != -1) |
| 2226 |
old_info = registered_fb[con2fb_map[prev_console]]; |
| 2227 |
/* |
2273 |
/* |
| 2228 |
* FIXME: If we have multiple fbdev's loaded, we need to |
2274 |
* FIXME: If we have multiple fbdev's loaded, we need to |
| 2229 |
* update all info->currcon. Perhaps, we can place this |
2275 |
* update all info->currcon. Perhaps, we can place this |
|
Lines 2267-2272
Link Here
|
| 2267 |
fbcon_del_cursor_timer(old_info); |
2313 |
fbcon_del_cursor_timer(old_info); |
| 2268 |
} |
2314 |
} |
| 2269 |
|
2315 |
|
|
|
2316 |
if (fbcon_decor_active_vc(vc)) { |
| 2317 |
struct vc_data *vc_curr = vc_cons[prev_console].d; |
| 2318 |
|
| 2319 |
if (!vc_curr->vc_decor.theme || |
| 2320 |
strcmp(vc->vc_decor.theme, vc_curr->vc_decor.theme) || |
| 2321 |
(fbcon_decor_active_nores(info, vc_curr) && |
| 2322 |
!fbcon_decor_active(info, vc_curr))) { |
| 2323 |
fbcon_decor_disable(vc, 0); |
| 2324 |
fbcon_decor_call_helper("modechange", vc->vc_num); |
| 2325 |
} |
| 2326 |
} |
| 2327 |
|
| 2270 |
if (fbcon_is_inactive(vc, info) || |
2328 |
if (fbcon_is_inactive(vc, info) || |
| 2271 |
ops->blank_state != FB_BLANK_UNBLANK) |
2329 |
ops->blank_state != FB_BLANK_UNBLANK) |
| 2272 |
fbcon_del_cursor_timer(info); |
2330 |
fbcon_del_cursor_timer(info); |
|
Lines 2375-2389
Link Here
|
| 2375 |
} |
2433 |
} |
| 2376 |
} |
2434 |
} |
| 2377 |
|
2435 |
|
| 2378 |
if (!fbcon_is_inactive(vc, info)) { |
2436 |
if (!fbcon_is_inactive(vc, info)) { |
| 2379 |
if (ops->blank_state != blank) { |
2437 |
if (ops->blank_state != blank) { |
| 2380 |
ops->blank_state = blank; |
2438 |
ops->blank_state = blank; |
| 2381 |
fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); |
2439 |
fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); |
| 2382 |
ops->cursor_flash = (!blank); |
2440 |
ops->cursor_flash = (!blank); |
| 2383 |
|
2441 |
|
| 2384 |
if (!(info->flags & FBINFO_MISC_USEREVENT)) |
2442 |
if (!(info->flags & FBINFO_MISC_USEREVENT)) { |
| 2385 |
if (fb_blank(info, blank)) |
2443 |
if (fb_blank(info, blank)) { |
| 2386 |
fbcon_generic_blank(vc, info, blank); |
2444 |
if (fbcon_decor_active(info, vc)) |
|
|
2445 |
fbcon_decor_blank(vc, info, blank); |
| 2446 |
else |
| 2447 |
fbcon_generic_blank(vc, info, blank); |
| 2448 |
} |
| 2449 |
} |
| 2387 |
} |
2450 |
} |
| 2388 |
|
2451 |
|
| 2389 |
if (!blank) |
2452 |
if (!blank) |
|
Lines 2566-2578
Link Here
|
| 2566 |
set_vc_hi_font(vc, true); |
2629 |
set_vc_hi_font(vc, true); |
| 2567 |
|
2630 |
|
| 2568 |
if (resize) { |
2631 |
if (resize) { |
|
|
2632 |
/* reset wrap/pan */ |
| 2569 |
int cols, rows; |
2633 |
int cols, rows; |
| 2570 |
|
2634 |
|
| 2571 |
cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); |
2635 |
cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); |
| 2572 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
2636 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
|
|
2637 |
|
| 2638 |
if (fbcon_decor_active(info, vc)) { |
| 2639 |
info->var.xoffset = info->var.yoffset = p->yscroll = 0; |
| 2640 |
cols = vc->vc_decor.twidth; |
| 2641 |
rows = vc->vc_decor.theight; |
| 2642 |
} |
| 2573 |
cols /= w; |
2643 |
cols /= w; |
| 2574 |
rows /= h; |
2644 |
rows /= h; |
|
|
2645 |
|
| 2575 |
vc_resize(vc, cols, rows); |
2646 |
vc_resize(vc, cols, rows); |
|
|
2647 |
|
| 2576 |
if (con_is_visible(vc) && softback_buf) |
2648 |
if (con_is_visible(vc) && softback_buf) |
| 2577 |
fbcon_update_softback(vc); |
2649 |
fbcon_update_softback(vc); |
| 2578 |
} else if (con_is_visible(vc) |
2650 |
} else if (con_is_visible(vc) |
|
Lines 2702-2708
Link Here
|
| 2702 |
int i, j, k, depth; |
2774 |
int i, j, k, depth; |
| 2703 |
u8 val; |
2775 |
u8 val; |
| 2704 |
|
2776 |
|
| 2705 |
if (fbcon_is_inactive(vc, info)) |
2777 |
if (fbcon_is_inactive(vc, info) |
|
|
2778 |
#ifdef CONFIG_FB_CON_DECOR |
| 2779 |
|| vc->vc_num != fg_console |
| 2780 |
#endif |
| 2781 |
) |
| 2706 |
return; |
2782 |
return; |
| 2707 |
|
2783 |
|
| 2708 |
if (!con_is_visible(vc)) |
2784 |
if (!con_is_visible(vc)) |
|
Lines 2728-2734
Link Here
|
| 2728 |
} else |
2804 |
} else |
| 2729 |
fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap); |
2805 |
fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap); |
| 2730 |
|
2806 |
|
| 2731 |
fb_set_cmap(&palette_cmap, info); |
2807 |
if (fbcon_decor_active(info, vc_cons[fg_console].d) && |
|
|
2808 |
info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
| 2809 |
|
| 2810 |
u16 *red, *green, *blue; |
| 2811 |
int minlen = min(min(info->var.red.length, info->var.green.length), |
| 2812 |
info->var.blue.length); |
| 2813 |
|
| 2814 |
struct fb_cmap cmap = { |
| 2815 |
.start = 0, |
| 2816 |
.len = (1 << minlen), |
| 2817 |
.red = NULL, |
| 2818 |
.green = NULL, |
| 2819 |
.blue = NULL, |
| 2820 |
.transp = NULL |
| 2821 |
}; |
| 2822 |
|
| 2823 |
red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL); |
| 2824 |
|
| 2825 |
if (!red) |
| 2826 |
goto out; |
| 2827 |
|
| 2828 |
green = red + 256; |
| 2829 |
blue = green + 256; |
| 2830 |
cmap.red = red; |
| 2831 |
cmap.green = green; |
| 2832 |
cmap.blue = blue; |
| 2833 |
|
| 2834 |
for (i = 0; i < cmap.len; i++) |
| 2835 |
red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1); |
| 2836 |
|
| 2837 |
fb_set_cmap(&cmap, info); |
| 2838 |
fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d); |
| 2839 |
kfree(red); |
| 2840 |
|
| 2841 |
return; |
| 2842 |
|
| 2843 |
} else if (fbcon_decor_active(info, vc_cons[fg_console].d) && |
| 2844 |
info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL) |
| 2845 |
fb_set_cmap(&info->bgdecor.cmap, info); |
| 2846 |
|
| 2847 |
out: fb_set_cmap(&palette_cmap, info); |
| 2732 |
} |
2848 |
} |
| 2733 |
|
2849 |
|
| 2734 |
static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) |
2850 |
static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) |
|
Lines 2953-2959
Link Here
|
| 2953 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
3069 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
| 2954 |
cols /= vc->vc_font.width; |
3070 |
cols /= vc->vc_font.width; |
| 2955 |
rows /= vc->vc_font.height; |
3071 |
rows /= vc->vc_font.height; |
| 2956 |
vc_resize(vc, cols, rows); |
3072 |
|
|
|
3073 |
if (!fbcon_decor_active_nores(info, vc)) { |
| 3074 |
vc_resize(vc, cols, rows); |
| 3075 |
} else { |
| 3076 |
fbcon_decor_disable(vc, 0); |
| 3077 |
fbcon_decor_call_helper("modechange", vc->vc_num); |
| 3078 |
} |
| 3079 |
|
| 2957 |
updatescrollmode(p, info, vc); |
3080 |
updatescrollmode(p, info, vc); |
| 2958 |
scrollback_max = 0; |
3081 |
scrollback_max = 0; |
| 2959 |
scrollback_current = 0; |
3082 |
scrollback_current = 0; |
|
Lines 2998-3004
Link Here
|
| 2998 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
3121 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
| 2999 |
cols /= vc->vc_font.width; |
3122 |
cols /= vc->vc_font.width; |
| 3000 |
rows /= vc->vc_font.height; |
3123 |
rows /= vc->vc_font.height; |
| 3001 |
vc_resize(vc, cols, rows); |
3124 |
if (!fbcon_decor_active_nores(info, vc)) |
|
|
3125 |
vc_resize(vc, cols, rows); |
| 3002 |
} |
3126 |
} |
| 3003 |
|
3127 |
|
| 3004 |
if (fg != -1) |
3128 |
if (fg != -1) |
|
Lines 3706-3711
Link Here
|
| 3706 |
} |
3830 |
} |
| 3707 |
} |
3831 |
} |
| 3708 |
|
3832 |
|
|
|
3833 |
fbcon_decor_exit(); |
| 3709 |
fbcon_has_exited = 1; |
3834 |
fbcon_has_exited = 1; |
| 3710 |
} |
3835 |
} |
| 3711 |
|
3836 |
|