diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-26 11:21:24 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2025-04-26 11:21:24 +0200 |
commit | d3e92076c1af713e65edac109499c25c37f38c16 (patch) | |
tree | f63c27ebdbae5a9514848d137b89a86f3c5b7c8e | |
parent | b1614dd1aef4bb5a37cf422fc6d7403d68a397c1 (diff) |
Revert "vt: properly support zero-width Unicode code points"
This reverts commit e88391f730e46d208b7fb37b02611d24137af1ef.
A new version of the series was submitted, so it's easier to revert the
old one and add the new one due to the changes invovled.
Cc: Nicolas Pitre <nico@fluxnic.net>
Cc: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/tty/vt/vt.c | 46 | ||||
-rw-r--r-- | include/linux/consolemap.h | 10 |
2 files changed, 2 insertions, 54 deletions
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c index 5d53feeb5d2b..bcb508bc15ab 100644 --- a/drivers/tty/vt/vt.c +++ b/drivers/tty/vt/vt.c @@ -443,15 +443,6 @@ static void vc_uniscr_scroll(struct vc_data *vc, unsigned int top, } } -static u32 vc_uniscr_getc(struct vc_data *vc, int relative_pos) -{ - int pos = vc->state.x + vc->vc_need_wrap + relative_pos; - - if (vc->vc_uni_lines && pos >= 0 && pos < vc->vc_cols) - return vc->vc_uni_lines[vc->state.y][pos]; - return 0; -} - static void vc_uniscr_copy_area(u32 **dst_lines, unsigned int dst_cols, unsigned int dst_rows, @@ -2914,49 +2905,18 @@ static bool vc_is_control(struct vc_data *vc, int tc, int c) return false; } -static void vc_con_rewind(struct vc_data *vc) -{ - if (vc->state.x && !vc->vc_need_wrap) { - vc->vc_pos -= 2; - vc->state.x--; - } - vc->vc_need_wrap = 0; -} - static int vc_con_write_normal(struct vc_data *vc, int tc, int c, struct vc_draw_region *draw) { - int next_c, prev_c; + int next_c; unsigned char vc_attr = vc->vc_attr; u16 himask = vc->vc_hi_font_mask, charmask = himask ? 0x1ff : 0xff; u8 width = 1; bool inverse = false; if (vc->vc_utf && !vc->vc_disp_ctrl) { - if (ucs_is_double_width(c)) { + if (ucs_is_double_width(c)) width = 2; - } else if (ucs_is_zero_width(c)) { - prev_c = vc_uniscr_getc(vc, -1); - if (prev_c == ' ' && - ucs_is_double_width(vc_uniscr_getc(vc, -2))) { - /* - * Let's merge this zero-width code point with - * the preceding double-width code point by - * replacing the existing whitespace padding. - */ - vc_con_rewind(vc); - } else if (c == 0xfe0f && prev_c != 0) { - /* - * VS16 (U+FE0F) is special. Let it have a - * width of 1 when preceded by a single-width - * code point effectively making the later - * double-width. - */ - } else { - /* Otherwise zero-width code points are ignored */ - goto out; - } - } } /* Now try to find out how to display it */ @@ -3035,8 +2995,6 @@ static int vc_con_write_normal(struct vc_data *vc, int tc, int c, tc = ' '; next_c = ' '; } - -out: notify_write(vc, c); if (inverse) diff --git a/include/linux/consolemap.h b/include/linux/consolemap.h index 7d778752dcef..caf079bcb8c9 100644 --- a/include/linux/consolemap.h +++ b/include/linux/consolemap.h @@ -29,11 +29,6 @@ u32 conv_8bit_to_uni(unsigned char c); int conv_uni_to_8bit(u32 uni); void console_map_init(void); bool ucs_is_double_width(uint32_t cp); -static inline bool ucs_is_zero_width(uint32_t cp) -{ - /* coming soon */ - return false; -} #else static inline u16 inverse_translate(const struct vc_data *conp, u16 glyph, bool use_unicode) @@ -68,11 +63,6 @@ static inline bool ucs_is_double_width(uint32_t cp) { return false; } - -static inline bool ucs_is_zero_width(uint32_t cp) -{ - return false; -} #endif /* CONFIG_CONSOLE_TRANSLATIONS */ #endif /* __LINUX_CONSOLEMAP_H__ */ |