Changeset efa4154 for npl/kernel/linux_src/4200_fbcondecor.patch
- Timestamp:
- 03/06/20 11:28:58 (5 years ago)
- Branches:
- master
- Children:
- e856512
- Parents:
- f6630dd
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
npl/kernel/linux_src/4200_fbcondecor.patch
rf6630dd refa4154 1 1 diff --git a/Documentation/fb/00-INDEX b/Documentation/fb/00-INDEX 2 index fe85e7c ..22309301006442 index fe85e7c5907a..22309308ba56 100644 3 3 --- a/Documentation/fb/00-INDEX 4 4 +++ b/Documentation/fb/00-INDEX … … 14 14 diff --git a/Documentation/fb/fbcondecor.txt b/Documentation/fb/fbcondecor.txt 15 15 new file mode 100644 16 index 0000000 ..637209e16 index 000000000000..637209e11ccd 17 17 --- /dev/null 18 18 +++ b/Documentation/fb/fbcondecor.txt … … 226 226 + 227 227 diff --git a/drivers/Makefile b/drivers/Makefile 228 index 53abb4a..1721aee100644228 index 1d034b680431..9f41f2ea0c8b 100644 229 229 --- a/drivers/Makefile 230 230 +++ b/drivers/Makefile 231 @@ - 17,6 +17,10 @@ obj-y += pwm/232 obj-$(CONFIG_PCI) += pci/231 @@ -23,6 +23,10 @@ obj-y += pci/dwc/ 232 233 233 obj-$(CONFIG_PARISC) += parisc/ 234 234 obj-$(CONFIG_RAPIDIO) += rapidio/ … … 240 240 obj-y += idle/ 241 241 242 @@ - 45,11 +49,6 @@ obj-$(CONFIG_REGULATOR) += regulator/242 @@ -53,11 +57,6 @@ obj-$(CONFIG_REGULATOR) += regulator/ 243 243 # reset controllers early, since gpu drivers might rely on them to initialize 244 244 obj-$(CONFIG_RESET_CONTROLLER) += reset/ … … 253 253 254 254 diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig 255 index 38da6e2..fe58152100644255 index 7f1f1fbcef9e..8439b618dfc0 100644 256 256 --- a/drivers/video/console/Kconfig 257 257 +++ b/drivers/video/console/Kconfig 258 @@ -1 30,6 +130,19 @@ config FRAMEBUFFER_CONSOLE_ROTATION258 @@ -151,6 +151,19 @@ config FRAMEBUFFER_CONSOLE_ROTATION 259 259 such that other users of the framebuffer will remain normally 260 260 oriented. … … 277 277 depends on PARISC 278 278 diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile 279 index 43bfa48..cc104b6100644279 index db07b784bd2c..3e369bd120b8 100644 280 280 --- a/drivers/video/console/Makefile 281 281 +++ b/drivers/video/console/Makefile 282 @@ - 16,4 +16,5 @@ obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon_rotate.o fbcon_cw.o fbcon_ud.o \283 fbcon_ccw.o284 endif282 @@ -9,4 +9,5 @@ obj-$(CONFIG_STI_CONSOLE) += sticon.o sticore.o 283 obj-$(CONFIG_VGA_CONSOLE) += vgacon.o 284 obj-$(CONFIG_MDA_CONSOLE) += mdacon.o 285 285 286 286 +obj-$(CONFIG_FB_CON_DECOR) += fbcondecor.o cfbcondecor.o 287 287 obj-$(CONFIG_FB_STI) += sticore.o 288 diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c289 index dbfe4ee..14da307 100644290 --- a/drivers/video/console/bitblit.c291 +++ b/drivers/video/console/bitblit.c292 @@ -18,6 +18,7 @@293 #include <linux/console.h>294 #include <asm/types.h>295 #include "fbcon.h"296 +#include "fbcondecor.h"297 298 /*299 * Accelerated handlers.300 @@ -55,6 +56,13 @@ static void bit_bmove(struct vc_data *vc, struct fb_info *info, int sy,301 area.height = height * vc->vc_font.height;302 area.width = width * vc->vc_font.width;303 304 + if (fbcon_decor_active(info, vc)) {305 + area.sx += vc->vc_decor.tx;306 + area.sy += vc->vc_decor.ty;307 + area.dx += vc->vc_decor.tx;308 + area.dy += vc->vc_decor.ty;309 + }310 +311 info->fbops->fb_copyarea(info, &area);312 }313 314 @@ -379,11 +387,15 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode,315 cursor.image.depth = 1;316 cursor.rop = ROP_XOR;317 318 - if (info->fbops->fb_cursor)319 - err = info->fbops->fb_cursor(info, &cursor);320 + if (fbcon_decor_active(info, vc)) {321 + fbcon_decor_cursor(info, &cursor);322 + } else {323 + if (info->fbops->fb_cursor)324 + err = info->fbops->fb_cursor(info, &cursor);325 326 - if (err)327 - soft_cursor(info, &cursor);328 + if (err)329 + soft_cursor(info, &cursor);330 + }331 332 ops->cursor_reset = 0;333 }334 288 diff --git a/drivers/video/console/cfbcondecor.c b/drivers/video/console/cfbcondecor.c 335 289 new file mode 100644 336 index 0000000 ..c262540290 index 000000000000..b00960803edc 337 291 --- /dev/null 338 292 +++ b/drivers/video/console/cfbcondecor.c … … 362 316 +#include <asm/irq.h> 363 317 + 364 +#include " fbcon.h"318 +#include "../fbdev/core/fbcon.h" 365 319 +#include "fbcondecor.h" 366 320 + … … 811 765 +} 812 766 + 813 diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c814 index b87f5cf..ce44538 100644815 --- a/drivers/video/console/fbcon.c816 +++ b/drivers/video/console/fbcon.c817 @@ -79,6 +79,7 @@818 #include <asm/irq.h>819 820 #include "fbcon.h"821 +#include "../console/fbcondecor.h"822 823 #ifdef FBCONDEBUG824 # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args)825 @@ -94,7 +95,7 @@ enum {826 827 static struct display fb_display[MAX_NR_CONSOLES];828 829 -static signed char con2fb_map[MAX_NR_CONSOLES];830 +signed char con2fb_map[MAX_NR_CONSOLES];831 static signed char con2fb_map_boot[MAX_NR_CONSOLES];832 833 static int logo_lines;834 @@ -282,7 +283,7 @@ static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info)835 !vt_force_oops_output(vc);836 }837 838 -static int get_color(struct vc_data *vc, struct fb_info *info,839 +int get_color(struct vc_data *vc, struct fb_info *info,840 u16 c, int is_fg)841 {842 int depth = fb_get_color_depth(&info->var, &info->fix);843 @@ -546,6 +547,9 @@ static int do_fbcon_takeover(int show_logo)844 info_idx = -1;845 } else {846 fbcon_has_console_bind = 1;847 +#ifdef CONFIG_FB_CON_DECOR848 + fbcon_decor_init();849 +#endif850 }851 852 return err;853 @@ -1005,6 +1009,12 @@ static const char *fbcon_startup(void)854 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);855 cols /= vc->vc_font.width;856 rows /= vc->vc_font.height;857 +858 + if (fbcon_decor_active(info, vc)) {859 + cols = vc->vc_decor.twidth / vc->vc_font.width;860 + rows = vc->vc_decor.theight / vc->vc_font.height;861 + }862 +863 vc_resize(vc, cols, rows);864 865 DPRINTK("mode: %s\n", info->fix.id);866 @@ -1034,7 +1044,7 @@ static void fbcon_init(struct vc_data *vc, int init)867 cap = info->flags;868 869 if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||870 - (info->fix.type == FB_TYPE_TEXT))871 + (info->fix.type == FB_TYPE_TEXT) || fbcon_decor_active(info, vc))872 logo = 0;873 874 if (var_to_display(p, &info->var, info))875 @@ -1259,6 +1269,11 @@ static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height,876 fbcon_clear_margins(vc, 0);877 }878 879 + if (fbcon_decor_active(info, vc)) {880 + fbcon_decor_clear(vc, info, sy, sx, height, width);881 + return;882 + }883 +884 /* Split blits that cross physical y_wrap boundary */885 886 y_break = p->vrows - p->yscroll;887 @@ -1278,10 +1293,15 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s,888 struct display *p = &fb_display[vc->vc_num];889 struct fbcon_ops *ops = info->fbcon_par;890 891 - if (!fbcon_is_inactive(vc, info))892 - ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,893 - get_color(vc, info, scr_readw(s), 1),894 - get_color(vc, info, scr_readw(s), 0));895 + if (!fbcon_is_inactive(vc, info)) {896 +897 + if (fbcon_decor_active(info, vc))898 + fbcon_decor_putcs(vc, info, s, count, ypos, xpos);899 + else900 + ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,901 + get_color(vc, info, scr_readw(s), 1),902 + get_color(vc, info, scr_readw(s), 0));903 + }904 }905 906 static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos)907 @@ -1297,8 +1317,12 @@ static void fbcon_clear_margins(struct vc_data *vc, int bottom_only)908 struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];909 struct fbcon_ops *ops = info->fbcon_par;910 911 - if (!fbcon_is_inactive(vc, info))912 - ops->clear_margins(vc, info, bottom_only);913 + if (!fbcon_is_inactive(vc, info)) {914 + if (fbcon_decor_active(info, vc))915 + fbcon_decor_clear_margins(vc, info, bottom_only);916 + else917 + ops->clear_margins(vc, info, bottom_only);918 + }919 }920 921 static void fbcon_cursor(struct vc_data *vc, int mode)922 @@ -1819,7 +1843,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,923 count = vc->vc_rows;924 if (softback_top)925 fbcon_softback_note(vc, t, count);926 - if (logo_shown >= 0)927 + if (logo_shown >= 0 || fbcon_decor_active(info, vc))928 goto redraw_up;929 switch (p->scrollmode) {930 case SCROLL_MOVE:931 @@ -1912,6 +1936,8 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,932 count = vc->vc_rows;933 if (logo_shown >= 0)934 goto redraw_down;935 + if (fbcon_decor_active(info, vc))936 + goto redraw_down;937 switch (p->scrollmode) {938 case SCROLL_MOVE:939 fbcon_redraw_blit(vc, info, p, b - 1, b - t - count,940 @@ -2060,6 +2086,13 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s941 }942 return;943 }944 +945 + if (fbcon_decor_active(info, vc) && sy == dy && height == 1) {946 + /* must use slower redraw bmove to keep background pic intact */947 + fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width);948 + return;949 + }950 +951 ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx,952 height, width);953 }954 @@ -2130,8 +2163,8 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,955 var.yres = virt_h * virt_fh;956 x_diff = info->var.xres - var.xres;957 y_diff = info->var.yres - var.yres;958 - if (x_diff < 0 || x_diff > virt_fw ||959 - y_diff < 0 || y_diff > virt_fh) {960 + if ((x_diff < 0 || x_diff > virt_fw ||961 + y_diff < 0 || y_diff > virt_fh) && !vc->vc_decor.state) {962 const struct fb_videomode *mode;963 964 DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);965 @@ -2167,6 +2200,22 @@ static int fbcon_switch(struct vc_data *vc)966 967 info = registered_fb[con2fb_map[vc->vc_num]];968 ops = info->fbcon_par;969 + prev_console = ops->currcon;970 + if (prev_console != -1)971 + old_info = registered_fb[con2fb_map[prev_console]];972 +973 +#ifdef CONFIG_FB_CON_DECOR974 + if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) {975 + struct vc_data *vc_curr = vc_cons[prev_console].d;976 +977 + if (vc_curr && fbcon_decor_active_vc(vc_curr)) {978 + // Clear the screen to avoid displaying funky colors979 + // during palette updates.980 + memset((u8 *)info->screen_base + info->fix.line_length * info->var.yoffset,981 + 0, info->var.yres * info->fix.line_length);982 + }983 + }984 +#endif985 986 if (softback_top) {987 if (softback_lines)988 @@ -2185,9 +2234,6 @@ static int fbcon_switch(struct vc_data *vc)989 logo_shown = FBCON_LOGO_CANSHOW;990 }991 992 - prev_console = ops->currcon;993 - if (prev_console != -1)994 - old_info = registered_fb[con2fb_map[prev_console]];995 /*996 * FIXME: If we have multiple fbdev's loaded, we need to997 * update all info->currcon. Perhaps, we can place this998 @@ -2231,6 +2277,18 @@ static int fbcon_switch(struct vc_data *vc)999 fbcon_del_cursor_timer(old_info);1000 }1001 1002 + if (fbcon_decor_active_vc(vc)) {1003 + struct vc_data *vc_curr = vc_cons[prev_console].d;1004 +1005 + if (!vc_curr->vc_decor.theme ||1006 + strcmp(vc->vc_decor.theme, vc_curr->vc_decor.theme) ||1007 + (fbcon_decor_active_nores(info, vc_curr) &&1008 + !fbcon_decor_active(info, vc_curr))) {1009 + fbcon_decor_disable(vc, 0);1010 + fbcon_decor_call_helper("modechange", vc->vc_num);1011 + }1012 + }1013 +1014 if (fbcon_is_inactive(vc, info) ||1015 ops->blank_state != FB_BLANK_UNBLANK)1016 fbcon_del_cursor_timer(info);1017 @@ -2339,15 +2397,20 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)1018 }1019 }1020 1021 - if (!fbcon_is_inactive(vc, info)) {1022 + if (!fbcon_is_inactive(vc, info)) {1023 if (ops->blank_state != blank) {1024 ops->blank_state = blank;1025 fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);1026 ops->cursor_flash = (!blank);1027 1028 - if (!(info->flags & FBINFO_MISC_USEREVENT))1029 - if (fb_blank(info, blank))1030 - fbcon_generic_blank(vc, info, blank);1031 + if (!(info->flags & FBINFO_MISC_USEREVENT)) {1032 + if (fb_blank(info, blank)) {1033 + if (fbcon_decor_active(info, vc))1034 + fbcon_decor_blank(vc, info, blank);1035 + else1036 + fbcon_generic_blank(vc, info, blank);1037 + }1038 + }1039 }1040 1041 if (!blank)1042 @@ -2522,13 +2585,22 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,1043 }1044 1045 if (resize) {1046 + /* reset wrap/pan */1047 int cols, rows;1048 1049 cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres);1050 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);1051 +1052 + if (fbcon_decor_active(info, vc)) {1053 + info->var.xoffset = info->var.yoffset = p->yscroll = 0;1054 + cols = vc->vc_decor.twidth;1055 + rows = vc->vc_decor.theight;1056 + }1057 cols /= w;1058 rows /= h;1059 +1060 vc_resize(vc, cols, rows);1061 +1062 if (con_is_visible(vc) && softback_buf)1063 fbcon_update_softback(vc);1064 } else if (con_is_visible(vc)1065 @@ -2657,7 +2729,11 @@ static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table)1066 int i, j, k, depth;1067 u8 val;1068 1069 - if (fbcon_is_inactive(vc, info))1070 + if (fbcon_is_inactive(vc, info)1071 +#ifdef CONFIG_FB_CON_DECOR1072 + || vc->vc_num != fg_console1073 +#endif1074 + )1075 return;1076 1077 if (!con_is_visible(vc))1078 @@ -2683,7 +2759,47 @@ static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table)1079 } else1080 fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap);1081 1082 - fb_set_cmap(&palette_cmap, info);1083 + if (fbcon_decor_active(info, vc_cons[fg_console].d) &&1084 + info->fix.visual == FB_VISUAL_DIRECTCOLOR) {1085 +1086 + u16 *red, *green, *blue;1087 + int minlen = min(min(info->var.red.length, info->var.green.length),1088 + info->var.blue.length);1089 +1090 + struct fb_cmap cmap = {1091 + .start = 0,1092 + .len = (1 << minlen),1093 + .red = NULL,1094 + .green = NULL,1095 + .blue = NULL,1096 + .transp = NULL1097 + };1098 +1099 + red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL);1100 +1101 + if (!red)1102 + goto out;1103 +1104 + green = red + 256;1105 + blue = green + 256;1106 + cmap.red = red;1107 + cmap.green = green;1108 + cmap.blue = blue;1109 +1110 + for (i = 0; i < cmap.len; i++)1111 + red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1);1112 +1113 + fb_set_cmap(&cmap, info);1114 + fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d);1115 + kfree(red);1116 +1117 + return;1118 +1119 + } else if (fbcon_decor_active(info, vc_cons[fg_console].d) &&1120 + info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL)1121 + fb_set_cmap(&info->bgdecor.cmap, info);1122 +1123 +out: fb_set_cmap(&palette_cmap, info);1124 }1125 1126 static u16 *fbcon_screen_pos(struct vc_data *vc, int offset)1127 @@ -2908,7 +3024,14 @@ static void fbcon_modechanged(struct fb_info *info)1128 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);1129 cols /= vc->vc_font.width;1130 rows /= vc->vc_font.height;1131 - vc_resize(vc, cols, rows);1132 +1133 + if (!fbcon_decor_active_nores(info, vc)) {1134 + vc_resize(vc, cols, rows);1135 + } else {1136 + fbcon_decor_disable(vc, 0);1137 + fbcon_decor_call_helper("modechange", vc->vc_num);1138 + }1139 +1140 updatescrollmode(p, info, vc);1141 scrollback_max = 0;1142 scrollback_current = 0;1143 @@ -2953,7 +3076,8 @@ static void fbcon_set_all_vcs(struct fb_info *info)1144 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);1145 cols /= vc->vc_font.width;1146 rows /= vc->vc_font.height;1147 - vc_resize(vc, cols, rows);1148 + if (!fbcon_decor_active_nores(info, vc))1149 + vc_resize(vc, cols, rows);1150 }1151 1152 if (fg != -1)1153 @@ -3594,6 +3718,7 @@ static void fbcon_exit(void)1154 }1155 }1156 1157 + fbcon_decor_exit();1158 fbcon_has_exited = 1;1159 }1160 1161 767 diff --git a/drivers/video/console/fbcondecor.c b/drivers/video/console/fbcondecor.c 1162 768 new file mode 100644 1163 index 0000000 ..65cc0d3769 index 000000000000..78288a497a60 1164 770 --- /dev/null 1165 771 +++ b/drivers/video/console/fbcondecor.c … … 1202 808 +#include <linux/compat.h> 1203 809 +#include <linux/console.h> 1204 + 810 +#include <linux/binfmts.h> 1205 811 +#include <linux/uaccess.h> 1206 812 +#include <asm/irq.h> 1207 813 + 1208 +#include " fbcon.h"814 +#include "../fbdev/core/fbcon.h" 1209 815 +#include "fbcondecor.h" 1210 816 + … … 1337 943 + return -EINVAL; 1338 944 + 1339 + len = str len_user(cfg->theme);945 + len = strnlen_user(cfg->theme, MAX_ARG_STRLEN); 1340 946 + if (!len || len > FBCON_DECOR_THEME_LEN) 1341 947 + return -EINVAL; … … 1716 1322 diff --git a/drivers/video/console/fbcondecor.h b/drivers/video/console/fbcondecor.h 1717 1323 new file mode 100644 1718 index 0000000 ..c49386c1324 index 000000000000..c49386c16695 1719 1325 --- /dev/null 1720 1326 +++ b/drivers/video/console/fbcondecor.h … … 1798 1404 +#endif /* __FBCON_DECOR_H */ 1799 1405 diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig 1800 index 88b008f..c84113d1006441406 index 5e58f5ec0a28..1daa8c2cb2d8 100644 1801 1407 --- a/drivers/video/fbdev/Kconfig 1802 1408 +++ b/drivers/video/fbdev/Kconfig 1803 @@ -12 16,7 +1216,6 @@ config FB_MATROX1409 @@ -1226,7 +1226,6 @@ config FB_MATROX 1804 1410 select FB_CFB_FILLRECT 1805 1411 select FB_CFB_COPYAREA … … 1809 1415 ---help--- 1810 1416 Say Y here if you have a Matrox Millennium, Matrox Millennium II, 1417 diff --git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/bitblit.c 1418 index 790900d646c0..3f940c93752c 100644 1419 --- a/drivers/video/fbdev/core/bitblit.c 1420 +++ b/drivers/video/fbdev/core/bitblit.c 1421 @@ -18,6 +18,7 @@ 1422 #include <linux/console.h> 1423 #include <asm/types.h> 1424 #include "fbcon.h" 1425 +#include "../../console/fbcondecor.h" 1426 1427 /* 1428 * Accelerated handlers. 1429 @@ -55,6 +56,13 @@ static void bit_bmove(struct vc_data *vc, struct fb_info *info, int sy, 1430 area.height = height * vc->vc_font.height; 1431 area.width = width * vc->vc_font.width; 1432 1433 + if (fbcon_decor_active(info, vc)) { 1434 + area.sx += vc->vc_decor.tx; 1435 + area.sy += vc->vc_decor.ty; 1436 + area.dx += vc->vc_decor.tx; 1437 + area.dy += vc->vc_decor.ty; 1438 + } 1439 + 1440 info->fbops->fb_copyarea(info, &area); 1441 } 1442 1443 @@ -379,11 +387,15 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode, 1444 cursor.image.depth = 1; 1445 cursor.rop = ROP_XOR; 1446 1447 - if (info->fbops->fb_cursor) 1448 - err = info->fbops->fb_cursor(info, &cursor); 1449 + if (fbcon_decor_active(info, vc)) { 1450 + fbcon_decor_cursor(info, &cursor); 1451 + } else { 1452 + if (info->fbops->fb_cursor) 1453 + err = info->fbops->fb_cursor(info, &cursor); 1454 1455 - if (err) 1456 - soft_cursor(info, &cursor); 1457 + if (err) 1458 + soft_cursor(info, &cursor); 1459 + } 1460 1461 ops->cursor_reset = 0; 1462 } 1811 1463 diff --git a/drivers/video/fbdev/core/fbcmap.c b/drivers/video/fbdev/core/fbcmap.c 1812 index f89245b..c2c12ce1006441464 index 68a113594808..21f977cb59d2 100644 1813 1465 --- a/drivers/video/fbdev/core/fbcmap.c 1814 1466 +++ b/drivers/video/fbdev/core/fbcmap.c … … 1822 1474 0x0000, 0xaaaa 1823 1475 }; 1824 @@ -25 4,9 +256,12 @@ int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *info)1476 @@ -256,9 +258,12 @@ int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *info) 1825 1477 break; 1826 1478 } … … 1837 1489 } 1838 1490 1491 diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c 1492 index 04612f938bab..95c349200078 100644 1493 --- a/drivers/video/fbdev/core/fbcon.c 1494 +++ b/drivers/video/fbdev/core/fbcon.c 1495 @@ -80,6 +80,7 @@ 1496 #include <asm/irq.h> 1497 1498 #include "fbcon.h" 1499 +#include "../../console/fbcondecor.h" 1500 1501 #ifdef FBCONDEBUG 1502 # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args) 1503 @@ -95,7 +96,7 @@ enum { 1504 1505 static struct display fb_display[MAX_NR_CONSOLES]; 1506 1507 -static signed char con2fb_map[MAX_NR_CONSOLES]; 1508 +signed char con2fb_map[MAX_NR_CONSOLES]; 1509 static signed char con2fb_map_boot[MAX_NR_CONSOLES]; 1510 1511 static int logo_lines; 1512 @@ -282,7 +283,7 @@ static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info) 1513 !vt_force_oops_output(vc); 1514 } 1515 1516 -static int get_color(struct vc_data *vc, struct fb_info *info, 1517 +int get_color(struct vc_data *vc, struct fb_info *info, 1518 u16 c, int is_fg) 1519 { 1520 int depth = fb_get_color_depth(&info->var, &info->fix); 1521 @@ -551,6 +552,9 @@ static int do_fbcon_takeover(int show_logo) 1522 info_idx = -1; 1523 } else { 1524 fbcon_has_console_bind = 1; 1525 +#ifdef CONFIG_FB_CON_DECOR 1526 + fbcon_decor_init(); 1527 +#endif 1528 } 1529 1530 return err; 1531 @@ -1013,6 +1017,12 @@ static const char *fbcon_startup(void) 1532 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); 1533 cols /= vc->vc_font.width; 1534 rows /= vc->vc_font.height; 1535 + 1536 + if (fbcon_decor_active(info, vc)) { 1537 + cols = vc->vc_decor.twidth / vc->vc_font.width; 1538 + rows = vc->vc_decor.theight / vc->vc_font.height; 1539 + } 1540 + 1541 vc_resize(vc, cols, rows); 1542 1543 DPRINTK("mode: %s\n", info->fix.id); 1544 @@ -1042,7 +1052,7 @@ static void fbcon_init(struct vc_data *vc, int init) 1545 cap = info->flags; 1546 1547 if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW || 1548 - (info->fix.type == FB_TYPE_TEXT)) 1549 + (info->fix.type == FB_TYPE_TEXT) || fbcon_decor_active(info, vc)) 1550 logo = 0; 1551 1552 if (var_to_display(p, &info->var, info)) 1553 @@ -1275,6 +1285,11 @@ static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height, 1554 fbcon_clear_margins(vc, 0); 1555 } 1556 1557 + if (fbcon_decor_active(info, vc)) { 1558 + fbcon_decor_clear(vc, info, sy, sx, height, width); 1559 + return; 1560 + } 1561 + 1562 /* Split blits that cross physical y_wrap boundary */ 1563 1564 y_break = p->vrows - p->yscroll; 1565 @@ -1294,10 +1309,15 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s, 1566 struct display *p = &fb_display[vc->vc_num]; 1567 struct fbcon_ops *ops = info->fbcon_par; 1568 1569 - if (!fbcon_is_inactive(vc, info)) 1570 - ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, 1571 - get_color(vc, info, scr_readw(s), 1), 1572 - get_color(vc, info, scr_readw(s), 0)); 1573 + if (!fbcon_is_inactive(vc, info)) { 1574 + 1575 + if (fbcon_decor_active(info, vc)) 1576 + fbcon_decor_putcs(vc, info, s, count, ypos, xpos); 1577 + else 1578 + ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, 1579 + get_color(vc, info, scr_readw(s), 1), 1580 + get_color(vc, info, scr_readw(s), 0)); 1581 + } 1582 } 1583 1584 static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) 1585 @@ -1313,8 +1333,12 @@ static void fbcon_clear_margins(struct vc_data *vc, int bottom_only) 1586 struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; 1587 struct fbcon_ops *ops = info->fbcon_par; 1588 1589 - if (!fbcon_is_inactive(vc, info)) 1590 - ops->clear_margins(vc, info, margin_color, bottom_only); 1591 + if (!fbcon_is_inactive(vc, info)) { 1592 + if (fbcon_decor_active(info, vc)) 1593 + fbcon_decor_clear_margins(vc, info, bottom_only); 1594 + else 1595 + ops->clear_margins(vc, info, margin_color, bottom_only); 1596 + } 1597 } 1598 1599 static void fbcon_cursor(struct vc_data *vc, int mode) 1600 @@ -1835,7 +1859,7 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b, 1601 count = vc->vc_rows; 1602 if (softback_top) 1603 fbcon_softback_note(vc, t, count); 1604 - if (logo_shown >= 0) 1605 + if (logo_shown >= 0 || fbcon_decor_active(info, vc)) 1606 goto redraw_up; 1607 switch (p->scrollmode) { 1608 case SCROLL_MOVE: 1609 @@ -1928,6 +1952,8 @@ static bool fbcon_scroll(struct vc_data *vc, unsigned int t, unsigned int b, 1610 count = vc->vc_rows; 1611 if (logo_shown >= 0) 1612 goto redraw_down; 1613 + if (fbcon_decor_active(info, vc)) 1614 + goto redraw_down; 1615 switch (p->scrollmode) { 1616 case SCROLL_MOVE: 1617 fbcon_redraw_blit(vc, info, p, b - 1, b - t - count, 1618 @@ -2076,6 +2102,13 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s 1619 } 1620 return; 1621 } 1622 + 1623 + if (fbcon_decor_active(info, vc) && sy == dy && height == 1) { 1624 + /* must use slower redraw bmove to keep background pic intact */ 1625 + fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width); 1626 + return; 1627 + } 1628 + 1629 ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, 1630 height, width); 1631 } 1632 @@ -2146,8 +2179,8 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width, 1633 var.yres = virt_h * virt_fh; 1634 x_diff = info->var.xres - var.xres; 1635 y_diff = info->var.yres - var.yres; 1636 - if (x_diff < 0 || x_diff > virt_fw || 1637 - y_diff < 0 || y_diff > virt_fh) { 1638 + if ((x_diff < 0 || x_diff > virt_fw || 1639 + y_diff < 0 || y_diff > virt_fh) && !vc->vc_decor.state) { 1640 const struct fb_videomode *mode; 1641 1642 DPRINTK("attempting resize %ix%i\n", var.xres, var.yres); 1643 @@ -2183,6 +2216,22 @@ static int fbcon_switch(struct vc_data *vc) 1644 1645 info = registered_fb[con2fb_map[vc->vc_num]]; 1646 ops = info->fbcon_par; 1647 + prev_console = ops->currcon; 1648 + if (prev_console != -1) 1649 + old_info = registered_fb[con2fb_map[prev_console]]; 1650 + 1651 +#ifdef CONFIG_FB_CON_DECOR 1652 + if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) { 1653 + struct vc_data *vc_curr = vc_cons[prev_console].d; 1654 + 1655 + if (vc_curr && fbcon_decor_active_vc(vc_curr)) { 1656 + // Clear the screen to avoid displaying funky colors 1657 + // during palette updates. 1658 + memset((u8 *)info->screen_base + info->fix.line_length * info->var.yoffset, 1659 + 0, info->var.yres * info->fix.line_length); 1660 + } 1661 + } 1662 +#endif 1663 1664 if (softback_top) { 1665 if (softback_lines) 1666 @@ -2201,9 +2250,6 @@ static int fbcon_switch(struct vc_data *vc) 1667 logo_shown = FBCON_LOGO_CANSHOW; 1668 } 1669 1670 - prev_console = ops->currcon; 1671 - if (prev_console != -1) 1672 - old_info = registered_fb[con2fb_map[prev_console]]; 1673 /* 1674 * FIXME: If we have multiple fbdev's loaded, we need to 1675 * update all info->currcon. Perhaps, we can place this 1676 @@ -2247,6 +2293,18 @@ static int fbcon_switch(struct vc_data *vc) 1677 fbcon_del_cursor_timer(old_info); 1678 } 1679 1680 + if (fbcon_decor_active_vc(vc)) { 1681 + struct vc_data *vc_curr = vc_cons[prev_console].d; 1682 + 1683 + if (!vc_curr->vc_decor.theme || 1684 + strcmp(vc->vc_decor.theme, vc_curr->vc_decor.theme) || 1685 + (fbcon_decor_active_nores(info, vc_curr) && 1686 + !fbcon_decor_active(info, vc_curr))) { 1687 + fbcon_decor_disable(vc, 0); 1688 + fbcon_decor_call_helper("modechange", vc->vc_num); 1689 + } 1690 + } 1691 + 1692 if (fbcon_is_inactive(vc, info) || 1693 ops->blank_state != FB_BLANK_UNBLANK) 1694 fbcon_del_cursor_timer(info); 1695 @@ -2355,15 +2413,20 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) 1696 } 1697 } 1698 1699 - if (!fbcon_is_inactive(vc, info)) { 1700 + if (!fbcon_is_inactive(vc, info)) { 1701 if (ops->blank_state != blank) { 1702 ops->blank_state = blank; 1703 fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); 1704 ops->cursor_flash = (!blank); 1705 1706 - if (!(info->flags & FBINFO_MISC_USEREVENT)) 1707 - if (fb_blank(info, blank)) 1708 - fbcon_generic_blank(vc, info, blank); 1709 + if (!(info->flags & FBINFO_MISC_USEREVENT)) { 1710 + if (fb_blank(info, blank)) { 1711 + if (fbcon_decor_active(info, vc)) 1712 + fbcon_decor_blank(vc, info, blank); 1713 + else 1714 + fbcon_generic_blank(vc, info, blank); 1715 + } 1716 + } 1717 } 1718 1719 if (!blank) 1720 @@ -2546,13 +2609,22 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, 1721 set_vc_hi_font(vc, true); 1722 1723 if (resize) { 1724 + /* reset wrap/pan */ 1725 int cols, rows; 1726 1727 cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres); 1728 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); 1729 + 1730 + if (fbcon_decor_active(info, vc)) { 1731 + info->var.xoffset = info->var.yoffset = p->yscroll = 0; 1732 + cols = vc->vc_decor.twidth; 1733 + rows = vc->vc_decor.theight; 1734 + } 1735 cols /= w; 1736 rows /= h; 1737 + 1738 vc_resize(vc, cols, rows); 1739 + 1740 if (con_is_visible(vc) && softback_buf) 1741 fbcon_update_softback(vc); 1742 } else if (con_is_visible(vc) 1743 @@ -2681,7 +2753,11 @@ static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table) 1744 int i, j, k, depth; 1745 u8 val; 1746 1747 - if (fbcon_is_inactive(vc, info)) 1748 + if (fbcon_is_inactive(vc, info) 1749 +#ifdef CONFIG_FB_CON_DECOR 1750 + || vc->vc_num != fg_console 1751 +#endif 1752 + ) 1753 return; 1754 1755 if (!con_is_visible(vc)) 1756 @@ -2707,7 +2783,47 @@ static void fbcon_set_palette(struct vc_data *vc, const unsigned char *table) 1757 } else 1758 fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap); 1759 1760 - fb_set_cmap(&palette_cmap, info); 1761 + if (fbcon_decor_active(info, vc_cons[fg_console].d) && 1762 + info->fix.visual == FB_VISUAL_DIRECTCOLOR) { 1763 + 1764 + u16 *red, *green, *blue; 1765 + int minlen = min(min(info->var.red.length, info->var.green.length), 1766 + info->var.blue.length); 1767 + 1768 + struct fb_cmap cmap = { 1769 + .start = 0, 1770 + .len = (1 << minlen), 1771 + .red = NULL, 1772 + .green = NULL, 1773 + .blue = NULL, 1774 + .transp = NULL 1775 + }; 1776 + 1777 + red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL); 1778 + 1779 + if (!red) 1780 + goto out; 1781 + 1782 + green = red + 256; 1783 + blue = green + 256; 1784 + cmap.red = red; 1785 + cmap.green = green; 1786 + cmap.blue = blue; 1787 + 1788 + for (i = 0; i < cmap.len; i++) 1789 + red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1); 1790 + 1791 + fb_set_cmap(&cmap, info); 1792 + fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d); 1793 + kfree(red); 1794 + 1795 + return; 1796 + 1797 + } else if (fbcon_decor_active(info, vc_cons[fg_console].d) && 1798 + info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL) 1799 + fb_set_cmap(&info->bgdecor.cmap, info); 1800 + 1801 +out: fb_set_cmap(&palette_cmap, info); 1802 } 1803 1804 static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) 1805 @@ -2932,7 +3048,14 @@ static void fbcon_modechanged(struct fb_info *info) 1806 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); 1807 cols /= vc->vc_font.width; 1808 rows /= vc->vc_font.height; 1809 - vc_resize(vc, cols, rows); 1810 + 1811 + if (!fbcon_decor_active_nores(info, vc)) { 1812 + vc_resize(vc, cols, rows); 1813 + } else { 1814 + fbcon_decor_disable(vc, 0); 1815 + fbcon_decor_call_helper("modechange", vc->vc_num); 1816 + } 1817 + 1818 updatescrollmode(p, info, vc); 1819 scrollback_max = 0; 1820 scrollback_current = 0; 1821 @@ -2977,7 +3100,8 @@ static void fbcon_set_all_vcs(struct fb_info *info) 1822 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); 1823 cols /= vc->vc_font.width; 1824 rows /= vc->vc_font.height; 1825 - vc_resize(vc, cols, rows); 1826 + if (!fbcon_decor_active_nores(info, vc)) 1827 + vc_resize(vc, cols, rows); 1828 } 1829 1830 if (fg != -1) 1831 @@ -3618,6 +3742,7 @@ static void fbcon_exit(void) 1832 } 1833 } 1834 1835 + fbcon_decor_exit(); 1836 fbcon_has_exited = 1; 1837 } 1838 1839 1839 diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c 1840 index 76c1ad9..fafc0af1006441840 index f741ba8df01b..b0141433d249 100644 1841 1841 --- a/drivers/video/fbdev/core/fbmem.c 1842 1842 +++ b/drivers/video/fbdev/core/fbmem.c 1843 @@ -125 1,15 +1251,6 @@ struct fb_fix_screeninfo32 {1843 @@ -1253,15 +1253,6 @@ struct fb_fix_screeninfo32 { 1844 1844 u16 reserved[3]; 1845 1845 }; … … 1859 1859 diff --git a/include/linux/console_decor.h b/include/linux/console_decor.h 1860 1860 new file mode 100644 1861 index 0000000 ..15143551861 index 000000000000..15143556c2aa 1862 1862 --- /dev/null 1863 1863 +++ b/include/linux/console_decor.h … … 1910 1910 +#endif 1911 1911 diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h 1912 index 6fd3c90..c6495551006441912 index c0ec478ea5bf..8bfed6b21fc9 100644 1913 1913 --- a/include/linux/console_struct.h 1914 1914 +++ b/include/linux/console_struct.h 1915 @@ -2 0,6 +20,7 @@ struct vt_struct;1915 @@ -21,6 +21,7 @@ struct vt_struct; 1916 1916 struct uni_pagedir; 1917 1917 … … 1921 1921 /* 1922 1922 * Example: vc_data of a console that was scrolled 3 lines down. 1923 @@ -14 0,6 +141,8 @@ struct vc_data {1923 @@ -141,6 +142,8 @@ struct vc_data { 1924 1924 struct uni_pagedir *vc_uni_pagedir; 1925 1925 struct uni_pagedir **vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */ … … 1931 1931 1932 1932 diff --git a/include/linux/fb.h b/include/linux/fb.h 1933 index a964d07..672cc641006441933 index bc24e48e396d..ad7d182c7545 100644 1934 1934 --- a/include/linux/fb.h 1935 1935 +++ b/include/linux/fb.h 1936 @@ -23 8,6 +238,34 @@ struct fb_deferred_io {1936 @@ -239,6 +239,34 @@ struct fb_deferred_io { 1937 1937 }; 1938 1938 #endif … … 1969 1969 * Frame buffer operations 1970 1970 * 1971 @@ -50 8,6 +536,9 @@ struct fb_info {1971 @@ -509,6 +537,9 @@ struct fb_info { 1972 1972 #define FBINFO_STATE_SUSPENDED 1 1973 1973 u32 state; /* Hardware state i.e suspend */ … … 1980 1980 /* we need the PCI or similar aperture base/size not 1981 1981 diff --git a/include/uapi/linux/fb.h b/include/uapi/linux/fb.h 1982 index fb795c3..4b57c671006441982 index 6cd9b198b7c6..a228440649fa 100644 1983 1983 --- a/include/uapi/linux/fb.h 1984 1984 +++ b/include/uapi/linux/fb.h 1985 @@ - 8,6 +8,23 @@1985 @@ -9,6 +9,23 @@ 1986 1986 1987 1987 #define FB_MAX 32 /* sufficient for now */ … … 2007 2007 0x46 is 'F' */ 2008 2008 #define FBIOGET_VSCREENINFO 0x4600 2009 @@ -3 5,6 +52,25 @@2009 @@ -36,6 +53,25 @@ 2010 2010 #define FBIOGET_DISPINFO 0x4618 2011 2011 #define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32) … … 2033 2033 #define FB_TYPE_PLANES 1 /* Non interleaved planes */ 2034 2034 #define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */ 2035 @@ -27 7,6 +313,29 @@ struct fb_var_screeninfo {2035 @@ -278,6 +314,29 @@ struct fb_var_screeninfo { 2036 2036 __u32 reserved[4]; /* Reserved for future compatibility */ 2037 2037 }; … … 2064 2064 __u32 len; /* Number of entries */ 2065 2065 diff --git a/kernel/sysctl.c b/kernel/sysctl.c 2066 index 6ee416e..d2c24251006442066 index d9c31bc2eaea..e33ac56cc32a 100644 2067 2067 --- a/kernel/sysctl.c 2068 2068 +++ b/kernel/sysctl.c 2069 @@ -1 49,6 +149,10 @@ static const int cap_last_cap = CAP_LAST_CAP;2069 @@ -150,6 +150,10 @@ static const int cap_last_cap = CAP_LAST_CAP; 2070 2070 static unsigned long hung_task_timeout_max = (LONG_MAX/HZ); 2071 2071 #endif … … 2078 2078 #include <linux/inotify.h> 2079 2079 #endif 2080 @@ -2 66,6 +270,15 @@ static struct ctl_table sysctl_base_table[] = {2080 @@ -283,6 +287,15 @@ static struct ctl_table sysctl_base_table[] = { 2081 2081 .mode = 0555, 2082 2082 .child = dev_table,
Note: See TracChangeset
for help on using the changeset viewer.