From 1dfc1611e9663a1a972f7c34417534f037a2bba2 Mon Sep 17 00:00:00 2001 From: mars <1403122061@qq.com> Date: Thu, 14 May 2020 20:48:10 +0800 Subject: [PATCH] Resync for linux-5.6.13 --- v5.x/cjktty-5.6.patch | 284 +++++++++++++++++------------------------- 1 file changed, 116 insertions(+), 168 deletions(-) diff --git a/v5.x/cjktty-5.6.patch b/v5.x/cjktty-5.6.patch index 4deddaf..7ebc770 100644 --- a/v5.x/cjktty-5.6.patch +++ b/v5.x/cjktty-5.6.patch @@ -1,19 +1,18 @@ -From 225de05d0b479987a2580bf97b8481ad5746dc82 Mon Sep 17 00:00:00 2001 +From 12069f22af1b2672bb9231c55aa434afd9834088 Mon Sep 17 00:00:00 2001 From: mars <1403122061@qq.com> -Date: Mon, 30 Mar 2020 15:57:42 +0800 +Date: Thu, 14 May 2020 20:43:46 +0800 Subject: [PATCH] add cjk tty support --- drivers/tty/vt/selection.c | 2 + - drivers/tty/vt/vt.c | 107 +- + drivers/tty/vt/vt.c | 92 +- drivers/video/console/Kconfig | 1 + - drivers/video/console/Makefile | 1 + - drivers/video/fbdev/core/bitblit.c | 57 +- - drivers/video/fbdev/core/fbcon.c | 72 +- + drivers/video/fbdev/core/bitblit.c | 54 +- + drivers/video/fbdev/core/fbcon.c | 76 +- drivers/video/fbdev/core/fbcon.h | 9 + - drivers/video/fbdev/core/fbcon_ccw.c | 31 +- - drivers/video/fbdev/core/fbcon_cw.c | 27 +- - drivers/video/fbdev/core/fbcon_ud.c | 41 +- + drivers/video/fbdev/core/fbcon_ccw.c | 26 +- + drivers/video/fbdev/core/fbcon_cw.c | 26 +- + drivers/video/fbdev/core/fbcon_ud.c | 39 +- include/linux/font.h | 5 +- lib/fonts/Kconfig | 12 + lib/fonts/Makefile | 1 + @@ -30,15 +29,15 @@ Subject: [PATCH] add cjk tty support lib/fonts/font_sun12x22.c | 1 + lib/fonts/font_sun8x16.c | 1 + lib/fonts/fonts.c | 3 + - 26 files changed, 140124 insertions(+), 61 deletions(-) + 25 files changed, 140114 insertions(+), 48 deletions(-) create mode 100644 lib/fonts/font_16x16_cjk.c create mode 100644 lib/fonts/font_cjk.h diff --git a/drivers/tty/vt/selection.c b/drivers/tty/vt/selection.c -index d7d2e4b..5dcf740 100644 +index 7556139..8b07c79 100644 --- a/drivers/tty/vt/selection.c +++ b/drivers/tty/vt/selection.c -@@ -334,6 +334,8 @@ static int __set_selection_kernel(struct tiocl_selection *v, struct tty_struct * +@@ -339,6 +339,8 @@ static int __set_selection_kernel(struct tiocl_selection *v, struct tty_struct * } obp = bp; } @@ -48,17 +47,17 @@ index d7d2e4b..5dcf740 100644 sel_buffer_lth = bp - sel_buffer; diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c -index 15d2769..21e0fdc 100644 +index 699d8b5..c9b6f77 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c -@@ -303,6 +303,19 @@ static inline unsigned short *screenpos(struct vc_data *vc, int offset, int view +@@ -304,6 +304,19 @@ static inline unsigned short *screenpos(struct vc_data *vc, int offset, int view return p; } +static inline unsigned short *screenpos_utf8(struct vc_data *vc, int offset, int viewed) +{ + unsigned short *p; -+ ++ + if (!viewed) + p = (unsigned short *)(vc->vc_origin + offset + vc->vc_screenbuf_size); + else if (!vc->vc_sw->con_screen_pos) @@ -71,7 +70,7 @@ index 15d2769..21e0fdc 100644 /* Called from the keyboard irq path.. */ static inline void scrolldelta(int lines) { -@@ -640,6 +653,11 @@ static void con_scroll(struct vc_data *vc, unsigned int t, unsigned int b, +@@ -646,6 +659,11 @@ static void con_scroll(struct vc_data *vc, unsigned int t, unsigned int b, } scr_memmovew(d, s, (b - t - nr) * vc->vc_size_row); scr_memsetw(clear, vc->vc_video_erase_char, vc->vc_size_row * nr); @@ -83,7 +82,7 @@ index 15d2769..21e0fdc 100644 } static void do_update_region(struct vc_data *vc, unsigned long start, int count) -@@ -801,6 +819,8 @@ void complement_pos(struct vc_data *vc, int offset) +@@ -807,6 +825,8 @@ void complement_pos(struct vc_data *vc, int offset) static int old_offset = -1; static unsigned short old; static unsigned short oldx, oldy; @@ -92,7 +91,7 @@ index 15d2769..21e0fdc 100644 WARN_CONSOLE_UNLOCKED(); -@@ -808,7 +828,7 @@ void complement_pos(struct vc_data *vc, int offset) +@@ -814,7 +834,7 @@ void complement_pos(struct vc_data *vc, int offset) old_offset < vc->vc_screenbuf_size) { scr_writew(old, screenpos(vc, old_offset, 1)); if (con_should_update(vc)) @@ -101,7 +100,7 @@ index 15d2769..21e0fdc 100644 notify_update(vc); } -@@ -819,13 +839,15 @@ void complement_pos(struct vc_data *vc, int offset) +@@ -825,13 +845,15 @@ void complement_pos(struct vc_data *vc, int offset) unsigned short new; unsigned short *p; p = screenpos(vc, offset, 1); @@ -118,7 +117,7 @@ index 15d2769..21e0fdc 100644 } notify_update(vc); } -@@ -1106,7 +1128,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ +@@ -1125,7 +1147,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */ if (!*vc->vc_uni_pagedir_loc) con_set_default_unimap(vc); @@ -127,16 +126,15 @@ index 15d2769..21e0fdc 100644 if (!vc->vc_screenbuf) goto err_free; -@@ -1168,7 +1190,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, - { +@@ -1188,6 +1210,7 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, unsigned long old_origin, new_origin, new_scr_end, rlth, rrem, err = 0; unsigned long end; -- unsigned int old_rows, old_row_size, first_copied_row; -+ unsigned int old_rows, old_row_size, first_copied_row, old_screen_size; + unsigned int old_rows, old_row_size, first_copied_row; ++ unsigned int old_screen_size; unsigned int new_cols, new_rows, new_row_size, new_screen_size; unsigned int user; unsigned short *newscreen; -@@ -1189,13 +1211,16 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, +@@ -1208,13 +1231,14 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, new_rows = (lines ? lines : vc->vc_rows); new_row_size = new_cols << 1; new_screen_size = new_row_size * new_rows; @@ -145,23 +143,21 @@ index 15d2769..21e0fdc 100644 if (new_cols == vc->vc_cols && new_rows == vc->vc_rows) return 0; - if (new_screen_size > (4 << 20)) + if (new_screen_size > KMALLOC_MAX_SIZE) return -EINVAL; - newscreen = kzalloc(new_screen_size, GFP_USER); -+ + newscreen = kzalloc(new_screen_size * 2, GFP_USER); -+ if (!newscreen) return -ENOMEM; -@@ -1260,15 +1285,23 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, +@@ -1279,15 +1303,23 @@ static int vc_do_resize(struct tty_struct *tty, struct vc_data *vc, while (old_origin < end) { scr_memcpyw((unsigned short *) new_origin, (unsigned short *) old_origin, rlth); - if (rrem) + scr_memcpyw((unsigned short *) new_origin + (new_screen_size >> 1), + (unsigned short *) old_origin + (old_screen_size >> 1), rlth); -+ if (rrem){ ++ if (rrem) { scr_memsetw((void *)(new_origin + rlth), vc->vc_video_erase_char, rrem); + scr_memsetw((void *)(new_origin + rlth + (new_screen_size)), @@ -171,7 +167,7 @@ index 15d2769..21e0fdc 100644 new_origin += new_row_size; } - if (new_scr_end > new_origin) -+ if (new_scr_end > new_origin){ ++ if (new_scr_end > new_origin) { scr_memsetw((void *)new_origin, vc->vc_video_erase_char, new_scr_end - new_origin); + scr_memsetw((void *)new_origin + (new_screen_size), vc->vc_video_erase_char, @@ -180,7 +176,7 @@ index 15d2769..21e0fdc 100644 kfree(vc->vc_screenbuf); vc->vc_screenbuf = newscreen; vc->vc_screenbuf_size = new_screen_size; -@@ -2612,6 +2645,8 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co +@@ -2631,6 +2663,8 @@ static int do_con_write(struct tty_struct *tty, const unsigned char *buf, int co rescan = 0; inverse = 0; width = 1; @@ -189,70 +185,53 @@ index 15d2769..21e0fdc 100644 /* Do no translation at all in control states */ if (vc->vc_state != ESnormal) { -@@ -2679,7 +2714,7 @@ rescan_last_byte: - continue; - } - } -- /* Nothing to do if an ASCII byte was received */ -+ - } - /* End of UTF-8 decoding. */ - /* c is the received character, or U+FFFD for invalid sequences. */ -@@ -2767,11 +2802,30 @@ rescan_last_byte: - } +@@ -2787,10 +2821,28 @@ rescan_last_byte: if (vc->vc_decim) insert_char(vc, 1); -- vc_uniscr_putc(vc, next_c); + vc_uniscr_putc(vc, next_c); - scr_writew(himask ? - ((vc_attr << 8) & ~himask) + ((tc & 0x100) ? himask : 0) + (tc & 0xff) : - (vc_attr << 8) + tc, - (u16 *) vc->vc_pos); -+ -+ if(is_double_width(c) && width==2) ++ if (is_double_width(c) && width==2) + { + tc = 0xFF; + scr_writew(himask ? -+ ((vc_attr << 8) & ~himask) + ((tc & 0x100) ? himask : 0) + (tc & 0xff) : -+ (vc_attr << 8) + tc, -+ (u16 *) vc->vc_pos); ++ ((vc_attr << 8) & ~himask) + ((tc & 0x100) ? himask : 0) + (tc & 0xff) : ++ (vc_attr << 8) + tc, ++ (u16 *) vc->vc_pos); + scr_writew(c, (u16 *) vc->vc_pos + (vc->vc_screenbuf_size >> 1)); -+ }else if(is_double_width(c) && width==1){ ++ } else if (is_double_width(c) && width==1) { + tc = 0xFE; + scr_writew(himask ? -+ ((vc_attr << 8) & ~himask) + ((tc & 0x100) ? himask : 0) + (tc & 0xff) : -+ (vc_attr << 8) + tc, -+ (u16 *) vc->vc_pos); ++ ((vc_attr << 8) & ~himask) + ((tc & 0x100) ? himask : 0) + (tc & 0xff) : ++ (vc_attr << 8) + tc, ++ (u16 *) vc->vc_pos); + scr_writew(c, (u16 *) vc->vc_pos + (vc->vc_screenbuf_size >> 1)); -+ }else{ ++ } else { + scr_writew(himask ? -+ ((vc_attr << 8) & ~himask) + ((tc & 0x100) ? himask : 0) + (tc & 0xff) : -+ (vc_attr << 8) + tc, -+ (u16 *) vc->vc_pos); ++ ((vc_attr << 8) & ~himask) + ((tc & 0x100) ? himask : 0) + (tc & 0xff) : ++ (vc_attr << 8) + tc, ++ (u16 *) vc->vc_pos); + scr_writew(c, (u16 *) vc->vc_pos + (vc->vc_screenbuf_size >> 1)); + } -+ if (con_should_update(vc) && draw_x < 0) { draw_x = vc->vc_x; draw_from = vc->vc_pos; -@@ -2788,14 +2842,12 @@ rescan_last_byte: - +@@ -2808,11 +2860,11 @@ rescan_last_byte: tc = conv_uni_to_pc(vc, ' '); /* A space is printed in the second column */ if (tc < 0) tc = ' '; -- next_c = ' '; -+ - } -- notify_write(vc, c); + next_c = ' '; +- } + notify_write(vc, c); -- if (inverse) -- con_flush(vc, draw_from, draw_to, &draw_x); -+ notify_write(vc, c); + if (inverse) + con_flush(vc, draw_from, draw_to, &draw_x); ++ } -- if (rescan) { -+ if (rescan) { + if (rescan) { rescan = 0; - inverse = 0; - width = 1; -@@ -3370,7 +3422,7 @@ static int __init con_init(void) +@@ -3397,7 +3449,7 @@ static int __init con_init(void) INIT_WORK(&vc_cons[currcons].SAK_work, vc_SAK); tty_port_init(&vc->port); visual_init(vc, currcons, 1); @@ -261,7 +240,7 @@ index 15d2769..21e0fdc 100644 vc_init(vc, vc->vc_rows, vc->vc_cols, currcons || !vc->vc_sw->con_save_screen); } -@@ -4607,6 +4659,11 @@ static int con_font_copy(struct vc_data *vc, struct console_font_op *op) +@@ -4635,6 +4687,11 @@ static int con_font_copy(struct vc_data *vc, struct console_font_op *op) int con_font_op(struct vc_data *vc, struct console_font_op *op) { @@ -273,7 +252,7 @@ index 15d2769..21e0fdc 100644 switch (op->op) { case KD_FONT_OP_SET: return con_font_set(vc, op); -@@ -4630,9 +4687,15 @@ u16 screen_glyph(struct vc_data *vc, int offset) +@@ -4658,9 +4715,14 @@ u16 screen_glyph(struct vc_data *vc, int offset) u16 w = scr_readw(screenpos(vc, offset, 1)); u16 c = w & 0xff; @@ -281,10 +260,9 @@ index 15d2769..21e0fdc 100644 - c |= 0x100; - return c; + u16 c_utf8 = scr_readw(screenpos_utf8(vc, offset, 1)); -+ -+ if ( (c == 0xff || c == 0xfe) && c_utf8 != 0){ ++ if ((c == 0xff || c == 0xfe) && c_utf8 != 0) { + return c_utf8; -+ }else{ ++ } else { + if (w & vc->vc_hi_font_mask) + c |= 0x100; + return c; @@ -304,20 +282,8 @@ index 70c10ea..e103d97 100644 help Enable display rotation for the framebuffer console. This is done in software and may be significantly slower than a normally oriented -diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile -index db07b78..150d019 100644 ---- a/drivers/video/console/Makefile -+++ b/drivers/video/console/Makefile -@@ -3,6 +3,7 @@ - # 5 Aug 1999, James Simmons, - # Rewritten to use lists instead of if-statements. - -+# Font handling - obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o - obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o - obj-$(CONFIG_STI_CONSOLE) += sticon.o sticore.o diff --git a/drivers/video/fbdev/core/bitblit.c b/drivers/video/fbdev/core/bitblit.c -index ca935c0..840d374 100644 +index ca935c0..b24e177 100644 --- a/drivers/video/fbdev/core/bitblit.c +++ b/drivers/video/fbdev/core/bitblit.c @@ -10,6 +10,7 @@ @@ -358,12 +324,12 @@ index ca935c0..840d374 100644 + u16 charmask) +{ + u32 utf8_c; -+ ++ + u8 *src = vc->vc_font.data + (scr_readw(s)& + charmask)*cellsize; -+ ++ + utf8_c = utf8_pos(vc, s); -+ ++ + if( utf8_c <= vc->vc_font.charcount) + { + /* @@ -385,39 +351,27 @@ index ca935c0..840d374 100644 static inline void bit_putcs_aligned(struct vc_data *vc, struct fb_info *info, const u16 *s, u32 attr, u32 cnt, u32 d_pitch, u32 s_pitch, u32 cellsize, -@@ -84,14 +128,12 @@ static inline void bit_putcs_aligned(struct vc_data *vc, struct fb_info *info, +@@ -84,8 +128,7 @@ static inline void bit_putcs_aligned(struct vc_data *vc, struct fb_info *info, u8 *src; while (cnt--) { - src = vc->vc_font.data + (scr_readw(s++)& - charmask)*cellsize; -+ src = font_bits(vc,s++,cellsize,charmask); ++ src = font_bits(vc, s++, cellsize, charmask); if (attr) { update_attr(buf, src, attr, vc); - src = buf; - } -- - if (likely(idx == 1)) - __fb_pad_aligned_buffer(dst, d_pitch, src, idx, - image->height); -@@ -119,14 +161,11 @@ static inline void bit_putcs_unaligned(struct vc_data *vc, +@@ -119,8 +162,7 @@ static inline void bit_putcs_unaligned(struct vc_data *vc, u8 *src; while (cnt--) { - src = vc->vc_font.data + (scr_readw(s++)& - charmask)*cellsize; -- -+ src = font_bits(vc,s++,cellsize,charmask); ++ src = font_bits(vc, s++, cellsize, charmask); + if (attr) { update_attr(buf, src, attr, vc); - src = buf; - } -- - fb_pad_unaligned_buffer(dst, d_pitch, src, idx, - image->height, shift_high, - shift_low, mod); -@@ -245,6 +284,8 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode, +@@ -245,6 +287,8 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode, int err = 1; char *src; @@ -426,17 +380,17 @@ index ca935c0..840d374 100644 cursor.set = 0; if (softback_lines) { -@@ -258,7 +299,7 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode, +@@ -258,7 +302,7 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode, c = scr_readw((u16 *) vc->vc_pos); attribute = get_attribute(info, c); - src = vc->vc_font.data + ((c & charmask) * (w * vc->vc_font.height)); -+ src = font_bits(vc,(u16*)vc->vc_pos,cellsize,charmask); ++ src = font_bits(vc, (u16*)vc->vc_pos, cellsize, charmask); if (ops->cursor_state.image.data != src || ops->cursor_reset) { diff --git a/drivers/video/fbdev/core/fbcon.c b/drivers/video/fbdev/core/fbcon.c -index bb6ae99..d35a874 100644 +index 5eb3fc9..c1918cb 100644 --- a/drivers/video/fbdev/core/fbcon.c +++ b/drivers/video/fbdev/core/fbcon.c @@ -123,7 +123,8 @@ static int logo_lines; @@ -444,7 +398,7 @@ index bb6ae99..d35a874 100644 static int logo_shown = FBCON_LOGO_CANSHOW; /* Software scrollback */ -static int fbcon_softback_size = 32768; -+/*I need to use it out side fbcon.c */ ++/* I need to use it out side fbcon.c */ +int fbcon_softback_size = 32768; static unsigned long softback_buf, softback_curr; static unsigned long softback_in; @@ -502,7 +456,7 @@ index bb6ae99..d35a874 100644 } } -@@ -1364,10 +1375,7 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s, +@@ -1367,10 +1378,7 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s, static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) { @@ -514,7 +468,7 @@ index bb6ae99..d35a874 100644 } static void fbcon_clear_margins(struct vc_data *vc, int bottom_only) -@@ -1441,6 +1449,7 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var, +@@ -1444,6 +1452,7 @@ static void fbcon_set_disp(struct fb_info *info, struct fb_var_screeninfo *var, vc->vc_font.data = (void *)(p->fontdata = t->fontdata); vc->vc_font.width = (*default_mode)->vc_font.width; vc->vc_font.height = (*default_mode)->vc_font.height; @@ -522,7 +476,7 @@ index bb6ae99..d35a874 100644 p->userfont = t->userfont; if (p->userfont) REFCOUNT(p->fontdata)++; -@@ -1619,6 +1628,7 @@ static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int count) +@@ -1622,6 +1631,7 @@ static __inline__ void ypan_down_redraw(struct vc_data *vc, int t, int count) static void fbcon_redraw_softback(struct vc_data *vc, struct fbcon_display *p, long delta) { @@ -530,16 +484,18 @@ index bb6ae99..d35a874 100644 int count = vc->vc_rows; unsigned short *d, *s; unsigned long n; -@@ -1681,6 +1691,8 @@ static void fbcon_redraw_softback(struct vc_data *vc, struct fbcon_display *p, +@@ -1684,6 +1694,10 @@ static void fbcon_redraw_softback(struct vc_data *vc, struct fbcon_display *p, start = s; } } -+ if( ((scr_readw(s) & charmask) == 0xff || (scr_readw(s) & charmask) == 0xfe) && scr_readw(s + (vc->vc_screenbuf_size >> 1)) != 0){ -+ }else{ ++ if (((scr_readw(s) & charmask) == 0xff || ++ (scr_readw(s) & charmask) == 0xfe) && ++ scr_readw(s + (vc->vc_screenbuf_size >> 1)) != 0) { ++ } else { if (c == scr_readw(d)) { if (s > start) { fbcon_putcs(vc, start, s - start, -@@ -1692,6 +1704,7 @@ static void fbcon_redraw_softback(struct vc_data *vc, struct fbcon_display *p, +@@ -1695,6 +1709,7 @@ static void fbcon_redraw_softback(struct vc_data *vc, struct fbcon_display *p, start++; } } @@ -547,7 +503,7 @@ index bb6ae99..d35a874 100644 s++; d++; } while (s < le); -@@ -1774,6 +1787,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info, +@@ -1777,6 +1792,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info, } scr_writew(c, d); @@ -555,7 +511,7 @@ index bb6ae99..d35a874 100644 console_conditional_schedule(); s++; d++; -@@ -1796,6 +1810,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info, +@@ -1799,6 +1815,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info, static void fbcon_redraw(struct vc_data *vc, struct fbcon_display *p, int line, int count, int offset) { @@ -563,7 +519,7 @@ index bb6ae99..d35a874 100644 unsigned short *d = (unsigned short *) (vc->vc_origin + vc->vc_size_row * line); unsigned short *s = d + offset; -@@ -1818,18 +1833,22 @@ static void fbcon_redraw(struct vc_data *vc, struct fbcon_display *p, +@@ -1821,18 +1838,24 @@ static void fbcon_redraw(struct vc_data *vc, struct fbcon_display *p, start = s; } } @@ -576,8 +532,10 @@ index bb6ae99..d35a874 100644 - } else { - x++; - start++; -+ if( ((scr_readw(s) & charmask) == 0xff || (scr_readw(s) & charmask) == 0xfe) && scr_readw(s + (vc->vc_screenbuf_size >> 1)) != 0){ -+ }else{ ++ if (((scr_readw(s) & charmask) == 0xff || ++ (scr_readw(s) & charmask) == 0xfe) && ++ scr_readw(s + (vc->vc_screenbuf_size >> 1)) != 0) { ++ } else { + if (c == scr_readw(d)) { + if (s > start) { + fbcon_putcs(vc, start, s - start, @@ -595,7 +553,7 @@ index bb6ae99..d35a874 100644 console_conditional_schedule(); s++; d++; -@@ -1859,6 +1878,7 @@ static inline void fbcon_softback_note(struct vc_data *vc, int t, +@@ -1862,6 +1885,7 @@ static inline void fbcon_softback_note(struct vc_data *vc, int t, while (count) { scr_memcpyw((u16 *) softback_in, p, vc->vc_size_row); @@ -603,7 +561,7 @@ index bb6ae99..d35a874 100644 count--; p = advance_row(p, 1); softback_in += vc->vc_size_row; -@@ -2462,7 +2482,6 @@ static int fbcon_get_font(struct vc_data *vc, struct console_font *font) +@@ -2465,7 +2489,6 @@ static int fbcon_get_font(struct vc_data *vc, struct console_font *font) font->width = vc->vc_font.width; font->height = vc->vc_font.height; @@ -611,7 +569,7 @@ index bb6ae99..d35a874 100644 if (!font->data) return 0; -@@ -2767,6 +2786,19 @@ static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) +@@ -2770,6 +2793,19 @@ static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) unsigned long p; int line; @@ -631,7 +589,7 @@ index bb6ae99..d35a874 100644 if (vc->vc_num != fg_console || !softback_lines) return (u16 *) (vc->vc_origin + offset); line = offset / vc->vc_size_row; -@@ -2874,6 +2906,8 @@ static void fbcon_scrolldelta(struct vc_data *vc, int lines) +@@ -2877,6 +2913,8 @@ static void fbcon_scrolldelta(struct vc_data *vc, int lines) q -= vc->vc_size_row; scr_memcpyw((u16 *) q, (u16 *) p, vc->vc_size_row); @@ -659,7 +617,7 @@ index 20dea85..b34c419 100644 + #endif /* _VIDEO_FBCON_H */ diff --git a/drivers/video/fbdev/core/fbcon_ccw.c b/drivers/video/fbdev/core/fbcon_ccw.c -index dfa9a8a..beb33f5 100644 +index dfa9a8a..d093193 100644 --- a/drivers/video/fbdev/core/fbcon_ccw.c +++ b/drivers/video/fbdev/core/fbcon_ccw.c @@ -18,6 +18,8 @@ @@ -671,22 +629,20 @@ index dfa9a8a..beb33f5 100644 /* * Rotation 270 degrees */ -@@ -105,13 +107,23 @@ static inline void ccw_putcs_aligned(struct vc_data *vc, struct fb_info *info, - u32 idx = (vc->vc_font.height + 7) >> 3; +@@ -106,12 +108,22 @@ static inline void ccw_putcs_aligned(struct vc_data *vc, struct fb_info *info, u8 *src; -- while (cnt--) { + while (cnt--) { - src = ops->fontbuffer + (scr_readw(s--) & charmask)*cellsize; -+ while (cnt--) { -+ if(((scr_readw(s) & charmask) == 0xff || (scr_readw(s) & charmask) == 0xfe )){ ++ if (((scr_readw(s) & charmask) == 0xff || (scr_readw(s) & charmask) == 0xfe)) { + char dst[16]; + src = font_bits(vc,s,cellsize,charmask); + memset(dst, 0, 16); + rotate_ccw(src, dst, vc->vc_font.width, + vc->vc_font.height); + src = dst; -+ }else{ ++ } else { + src = ops->fontbuffer + (scr_readw(s) & charmask)*cellsize; + } if (attr) { @@ -705,30 +661,26 @@ index dfa9a8a..beb33f5 100644 if (!ops->fontbuffer) return; -@@ -245,9 +258,19 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode, - y += softback_lines; - } +@@ -247,7 +260,16 @@ static void ccw_cursor(struct vc_data *vc, struct fb_info *info, int mode, -- c = scr_readw((u16 *) vc->vc_pos); -+ c = scr_readw((u16 *) vc->vc_pos); + c = scr_readw((u16 *) vc->vc_pos); attribute = get_attribute(info, c); - src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); -+ -+ if(((c&charmask) == 0xff || (c & charmask) == 0xfe)){ ++ if (((c&charmask) == 0xff || (c & charmask) == 0xfe)) { + char dst[16]; + src = font_bits(vc,(const u16*)&c,cellsize,charmask); + memset(dst, 0, 16); + rotate_ccw(src, dst, vc->vc_font.width, + vc->vc_font.height); + src = dst; -+ }else{ ++ } else { + src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); + } if (ops->cursor_state.image.data != src || ops->cursor_reset) { diff --git a/drivers/video/fbdev/core/fbcon_cw.c b/drivers/video/fbdev/core/fbcon_cw.c -index ce08251..ad965d9 100644 +index ce08251..d62b8ef 100644 --- a/drivers/video/fbdev/core/fbcon_cw.c +++ b/drivers/video/fbdev/core/fbcon_cw.c @@ -18,6 +18,8 @@ @@ -740,22 +692,20 @@ index ce08251..ad965d9 100644 /* * Rotation 90 degrees */ -@@ -89,14 +91,23 @@ static inline void cw_putcs_aligned(struct vc_data *vc, struct fb_info *info, - u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; - u32 idx = (vc->vc_font.height + 7) >> 3; +@@ -91,12 +93,22 @@ static inline void cw_putcs_aligned(struct vc_data *vc, struct fb_info *info, u8 *src; -- + while (cnt--) { - src = ops->fontbuffer + (scr_readw(s++) & charmask)*cellsize; -+ if(((scr_readw(s) & charmask) == 0xff || (scr_readw(s) & charmask) == 0xfe )){ ++ if (((scr_readw(s) & charmask) == 0xff || (scr_readw(s) & charmask) == 0xfe)) { + char dst[16]; + src = font_bits(vc,s,cellsize,charmask); + memset(dst, 0, 16); + rotate_cw(src, dst, vc->vc_font.width, + vc->vc_font.height); + src = dst; -+ }else{ ++ } else { + src = ops->fontbuffer + (scr_readw(s) & charmask)*cellsize; + } if (attr) { @@ -766,7 +716,7 @@ index ce08251..ad965d9 100644 if (likely(idx == 1)) __fb_pad_aligned_buffer(dst, d_pitch, src, idx, -@@ -213,6 +224,7 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode, +@@ -213,6 +225,7 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode, int err = 1, dx, dy; char *src; u32 vxres = GETVXRES(ops->p->scrollmode, info); @@ -774,26 +724,26 @@ index ce08251..ad965d9 100644 if (!ops->fontbuffer) return; -@@ -230,7 +242,16 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode, +@@ -230,7 +243,16 @@ static void cw_cursor(struct vc_data *vc, struct fb_info *info, int mode, c = scr_readw((u16 *) vc->vc_pos); attribute = get_attribute(info, c); - src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); -+ if(((c&charmask) == 0xff || (c & charmask) == 0xfe)){ ++ if (((c&charmask) == 0xff || (c & charmask) == 0xfe)) { + char dst[16]; + src = font_bits(vc,(const u16*)&c,cellsize,charmask); + memset(dst, 0, 16); + rotate_cw(src, dst, vc->vc_font.width, + vc->vc_font.height); + src = dst; -+ }else{ ++ } else { + src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.width)); + } if (ops->cursor_state.image.data != src || ops->cursor_reset) { diff --git a/drivers/video/fbdev/core/fbcon_ud.c b/drivers/video/fbdev/core/fbcon_ud.c -index 1936afc..aa0c15b 100644 +index 1936afc..d2e4d3d 100644 --- a/drivers/video/fbdev/core/fbcon_ud.c +++ b/drivers/video/fbdev/core/fbcon_ud.c @@ -18,6 +18,8 @@ @@ -811,14 +761,14 @@ index 1936afc..aa0c15b 100644 while (cnt--) { - src = ops->fontbuffer + (scr_readw(s--) & charmask)*cellsize; -+ if(((scr_readw(s) & charmask) == 0xff || (scr_readw(s) & charmask) == 0xfe ) ){ ++ if (((scr_readw(s) & charmask) == 0xff || (scr_readw(s) & charmask) == 0xfe)) { + char dst[16]; + src = font_bits(vc,s,cellsize,charmask); + memset(dst, 0, 16); + rotate_ud(src, dst, vc->vc_font.width, + vc->vc_font.height); + src = dst; -+ }else{ ++ } else { + src = ops->fontbuffer + (scr_readw(s) & charmask)*cellsize; + } if (attr) { @@ -835,14 +785,14 @@ index 1936afc..aa0c15b 100644 while (cnt--) { - src = ops->fontbuffer + (scr_readw(s--) & charmask)*cellsize; - -+ if(((scr_readw(s) & charmask) == 0xff || (scr_readw(s) & charmask) == 0xfe )){ ++ if (((scr_readw(s) & charmask) == 0xff || (scr_readw(s) & charmask) == 0xfe)) { + char dst[16]; + src = font_bits(vc,s,cellsize,charmask); + memset(dst, 0, 16); + rotate_ud(src, dst, vc->vc_font.width, + vc->vc_font.height); + src = dst; -+ }else{ ++ } else { + src = ops->fontbuffer + (scr_readw(s) & charmask)*cellsize; + } if (attr) { @@ -861,21 +811,19 @@ index 1936afc..aa0c15b 100644 if (!ops->fontbuffer) return; -@@ -278,7 +300,18 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode, +@@ -278,7 +300,16 @@ static void ud_cursor(struct vc_data *vc, struct fb_info *info, int mode, c = scr_readw((u16 *) vc->vc_pos); attribute = get_attribute(info, c); - src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.height)); -+ if(((c&charmask) == 0xff || (c & charmask) == 0xfe) ){ ++ if (((c&charmask) == 0xff || (c & charmask) == 0xfe)) { + char dst[16]; -+ + src = font_bits(vc,(u16*)&c,cellsize,charmask); -+ + memset(dst, 0, 16); + rotate_ud(src, dst, vc->vc_font.width, + vc->vc_font.height); + src = dst; -+ }else{ ++ } else { + src = ops->fontbuffer + ((c & charmask) * (w * vc->vc_font.height)); + } @@ -140890,5 +140838,5 @@ index e7258d8..cf2cfcb 100644 #define num_fonts ARRAY_SIZE(fonts) -- -2.26.0 +2.26.2