summarylogtreecommitdiffstats
path: root/cjktty-12-patch-for-5.4.66+.patch
blob: 17f35c1a6f74a8cd44056436033db66e9e971a1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
--- cjktty-10-fix-255-glyph-limit-prepare-for-CJK-font-support.patch	2020-09-18 00:19:07.610052000 +0800
+++ cjktty-10-fix-255-glyph-limit-prepare-for-CJK-font-support-5.4.66.patch	2020-09-18 19:03:23.870884705 +0800
@@ -284,7 +284,7 @@
  #include <linux/module.h>
  #include <linux/slab.h>
  #include <linux/string.h>
-@@ -43,6 +44,21 @@ static void update_attr(u8 *dst, u8 *src, int attribute,
+@@ -43,6 +44,19 @@ static void update_attr(u8 *dst, u8 *src, int attribute,
  	}
  }
  
@@ -293,8 +293,6 @@
 +	unsigned long p = (long)utf8;
 +	if (p >= vc->vc_origin && p < vc->vc_scr_end) {
 +		return scr_readw((unsigned short *)(p + vc->vc_screenbuf_size));
-+	} else if (vc->vc_num == fg_console && fbcon_is_softback(utf8)){
-+		return scr_readw((unsigned short *)(p + fbcon_softback_size));
 +	} else {
 +		u16 extra_c;
 +		int c = *(int*)utf8;
@@ -381,7 +379,7 @@
 +
  	cursor.set = 0;
  
- 	if (softback_lines) {
+ 	c = scr_readw((u16 *) vc->vc_pos);
 @@ -258,7 +299,7 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode,
  
   	c = scr_readw((u16 *) vc->vc_pos);
@@ -395,43 +393,7 @@
 index c9235a2f42f89..7ed69f292db9b 100644
 --- a/drivers/video/fbdev/core/fbcon.c
 +++ b/drivers/video/fbdev/core/fbcon.c
-@@ -123,7 +123,8 @@ static int logo_lines;
-    enums.  */
- static int logo_shown = FBCON_LOGO_CANSHOW;
- /* Software scrollback */
--static int fbcon_softback_size = 32768;
-+/*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;
- static unsigned long softback_top, softback_end;
-@@ -216,6 +217,14 @@ static void fbcon_start(void);
- static void fbcon_exit(void);
- static struct device *fbcon_device;
- 
-+int fbcon_is_softback(const unsigned short *str)
-+{
-+	unsigned long p = (long)str;
-+	if(p >= softback_buf && p <softback_end)
-+		return 1;
-+	return 0;
-+}
-+
- #ifdef CONFIG_FRAMEBUFFER_CONSOLE_ROTATION
- static inline void fbcon_set_rotation(struct fb_info *info)
- {
-@@ -1019,10 +1028,7 @@ static const char *fbcon_startup(void)
- 	if (info->fix.type != FB_TYPE_TEXT) {
- 		if (fbcon_softback_size) {
- 			if (!softback_buf) {
--				softback_buf =
--				    (unsigned long)
--				    kvmalloc(fbcon_softback_size,
--					    GFP_KERNEL);
-+				softback_buf = (unsigned long) kmalloc(fbcon_softback_size * 2, GFP_KERNEL);
- 				if (!softback_buf) {
- 					fbcon_softback_size = 0;
- 					softback_top = 0;
+
 @@ -1051,7 +1057,8 @@ static const char *fbcon_startup(void)
  		vc->vc_font.width = font->width;
  		vc->vc_font.height = font->height;
@@ -481,31 +443,6 @@
  		p->userfont = t->userfont;
  		if (p->userfont)
  			REFCOUNT(p->fontdata)++;
-@@ -1612,6 +1618,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)
- {
-+	u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
- 	int count = vc->vc_rows;
- 	unsigned short *d, *s;
- 	unsigned long n;
-@@ -1674,6 +1681,8 @@ 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 (c == scr_readw(d)) {
- 				if (s > start) {
- 					fbcon_putcs(vc, start, s - start,
-@@ -1685,6 +1694,7 @@ static void fbcon_redraw_softback(struct vc_data *vc, struct fbcon_display *p,
- 					start++;
- 				}
- 			}
-+			}
- 			s++;
- 			d++;
- 		} while (s < le);
 @@ -1767,6 +1777,7 @@ static void fbcon_redraw_blit(struct vc_data *vc, struct fb_info *info,
  			}
  
@@ -554,14 +491,6 @@
  			console_conditional_schedule();
  			s++;
  			d++;
-@@ -1852,6 +1868,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);
-+		scr_memcpyw((u16 *) softback_in + (fbcon_softback_size >> 1), p + (vc->vc_screenbuf_size >> 1), vc->vc_size_row);
- 		count--;
- 		p = advance_row(p, 1);
- 		softback_in += vc->vc_size_row;
 @@ -2455,7 +2472,6 @@ static int fbcon_get_font(struct vc_data *vc, struct console_font *font)
  
  	font->width = vc->vc_font.width;
@@ -570,40 +499,22 @@
  	if (!font->data)
  		return 0;
  
-@@ -2760,6 +2776,19 @@ static u16 *fbcon_screen_pos(struct vc_data *vc, int offset)
- 	unsigned long p;
- 	int line;
- 	
+@@ -2593,6 +2593,10 @@ static void fbcon_set_palette(struct vc_
+ 
+ static u16 *fbcon_screen_pos(struct vc_data *vc, int offset)
+ {
 +	if (offset < 0) {
 +		offset = -offset - 1;
-+		if (vc->vc_num != fg_console || !softback_lines)
-+			return (u16 *)(vc->vc_origin + offset + (vc->vc_screenbuf_size));
-+		line = offset / vc->vc_size_row;
-+		if (line >= softback_lines)
-+			return (u16 *) (vc->vc_origin + offset - softback_lines * vc->vc_size_row + (vc->vc_screenbuf_size));
-+		p = softback_curr + offset;
-+		if (p >= softback_end)
-+			p += softback_buf - softback_end;
-+		return (u16 *) (p + (fbcon_softback_size));
-+	}
-+
- 	if (vc->vc_num != fg_console || !softback_lines)
- 		return (u16 *) (vc->vc_origin + offset);
- 	line = offset / vc->vc_size_row;
-@@ -2867,6 +2896,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);
-+					scr_memcpyw((u16 *) (q + (vc->vc_screenbuf_size >> 1)), (u16 *) (p + (fbcon_softback_size >> 1)),
-+						    vc->vc_size_row);
- 				}
- 				softback_in = softback_curr = p;
- 				update_region(vc, vc->vc_origin,
++		return (u16 *)(vc->vc_origin + offset + (vc->vc_screenbuf_size));
++	}    
+ 	return (u16 *) (vc->vc_origin + offset);
+ }
+ 
 diff --git a/drivers/video/fbdev/core/fbcon.h b/drivers/video/fbdev/core/fbcon.h
 index 20dea853765f5..b34c419dd1eb2 100644
 --- a/drivers/video/fbdev/core/fbcon.h
 +++ b/drivers/video/fbdev/core/fbcon.h
-@@ -262,4 +262,13 @@ extern void fbcon_set_rotate(struct fbcon_ops *ops);
+@@ -262,4 +262,10 @@ extern void fbcon_set_rotate(struct fbcon_ops *ops);
  #define fbcon_set_rotate(x) do {} while(0)
  #endif /* CONFIG_FRAMEBUFFER_CONSOLE_ROTATION */
  
@@ -613,9 +524,6 @@
 +#define fbcon_platform_get_rotate(i) FB_ROTATE_UR
 +#endif /* CONFIG_DMI */
 +
-+extern int fbcon_softback_size;
-+extern int fbcon_is_softback(const unsigned short *str);
-+
  #endif /* _VIDEO_FBCON_H */
 diff --git a/drivers/video/fbdev/core/fbcon_ccw.c b/drivers/video/fbdev/core/fbcon_ccw.c
 index dfa9a8aa4509c..beb33f5795061 100644
@@ -665,8 +573,8 @@
  	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;
- 	}
+ 
+ 	cursor.set = 0;
  
 - 	c = scr_readw((u16 *) vc->vc_pos);
 +	c = scr_readw((u16 *) vc->vc_pos);