1 |
Author: mpagano |
2 |
Date: 2013-08-26 23:21:13 +0000 (Mon, 26 Aug 2013) |
3 |
New Revision: 2495 |
4 |
|
5 |
Modified: |
6 |
genpatches-2.6/trunk/3.11/4200_fbcondecor-0.9.6.patch |
7 |
Log: |
8 |
Start porting of patch for 3.11 kernel |
9 |
|
10 |
Modified: genpatches-2.6/trunk/3.11/4200_fbcondecor-0.9.6.patch |
11 |
=================================================================== |
12 |
--- genpatches-2.6/trunk/3.11/4200_fbcondecor-0.9.6.patch 2013-08-24 15:55:48 UTC (rev 2494) |
13 |
+++ genpatches-2.6/trunk/3.11/4200_fbcondecor-0.9.6.patch 2013-08-26 23:21:13 UTC (rev 2495) |
14 |
@@ -285,18 +285,14 @@ |
15 |
config STI_CONSOLE |
16 |
bool "STI text console" |
17 |
depends on PARISC |
18 |
-diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile |
19 |
-index a862e91..86bfcff 100644 |
20 |
---- a/drivers/video/console/Makefile |
21 |
-+++ b/drivers/video/console/Makefile |
22 |
-@@ -34,6 +34,7 @@ obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon_rotate.o fbcon_cw.o fbcon_ud.o \ |
23 |
+--- a/drivers/video/console/Makefile 2013-08-26 14:02:39.905817618 -0400 |
24 |
++++ b/drivers/video/console/Makefile 2013-08-26 14:05:06.258848595 -0400 |
25 |
+@@ -16,4 +16,5 @@ obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += |
26 |
fbcon_ccw.o |
27 |
endif |
28 |
- |
29 |
-+obj-$(CONFIG_FB_CON_DECOR) += fbcondecor.o cfbcondecor.o |
30 |
- obj-$(CONFIG_FB_STI) += sticore.o font.o |
31 |
- |
32 |
- ifeq ($(CONFIG_USB_SISUSBVGA_CON),y) |
33 |
+ |
34 |
++obj-$(CONFIG_FB_CON_DECOR) += fbcondecor.o cfbcondecor.o |
35 |
+ obj-$(CONFIG_FB_STI) += sticore.o |
36 |
diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c |
37 |
index 28b1a83..33712c0 100644 |
38 |
--- a/drivers/video/console/bitblit.c |
39 |
@@ -821,18 +817,9 @@ |
40 |
+} |
41 |
+ |
42 |
diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c |
43 |
-index 2e471c2..b9679a7e 100644 |
44 |
+index cd8a802..a0382da 100644 |
45 |
--- a/drivers/video/console/fbcon.c |
46 |
+++ b/drivers/video/console/fbcon.c |
47 |
-@@ -26,7 +26,7 @@ |
48 |
- * |
49 |
- * Hardware cursor support added by Emmanuel Marty (core@×××××××××××.org) |
50 |
- * Smart redraw scrolling, arbitrary font width support, 512char font support |
51 |
-- * and software scrollback added by |
52 |
-+ * and software scrollback added by |
53 |
- * Jakub Jelinek (jj@×××××××××××.cz) |
54 |
- * |
55 |
- * Random hacking by Martin Mares <mj@×××.cz> |
56 |
@@ -79,6 +79,7 @@ |
57 |
#include <asm/irq.h> |
58 |
|
59 |
@@ -850,16 +837,15 @@ |
60 |
static signed char con2fb_map_boot[MAX_NR_CONSOLES]; |
61 |
|
62 |
static int logo_lines; |
63 |
-@@ -110,7 +111,7 @@ static int softback_lines; |
64 |
+@@ -109,7 +110,6 @@ static unsigned long softback_top, softback_end; |
65 |
+ static int softback_lines; |
66 |
/* console mappings */ |
67 |
static int first_fb_vc; |
68 |
- static int last_fb_vc = MAX_NR_CONSOLES - 1; |
69 |
--static int fbcon_is_default = 1; |
70 |
-+static int fbcon_is_default = 1; |
71 |
+-static int last_fb_vc = MAX_NR_CONSOLES - 1; |
72 |
+ static int fbcon_is_default = 1; |
73 |
static int fbcon_has_exited; |
74 |
static int primary_device = -1; |
75 |
- static int fbcon_has_console_bind; |
76 |
-@@ -286,7 +287,7 @@ static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info) |
77 |
+@@ -286,7 +286,7 @@ static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info) |
78 |
!vt_force_oops_output(vc); |
79 |
} |
80 |
|
81 |
@@ -868,27 +854,7 @@ |
82 |
u16 c, int is_fg) |
83 |
{ |
84 |
int depth = fb_get_color_depth(&info->var, &info->fix); |
85 |
-@@ -465,7 +466,7 @@ static int __init fb_console_setup(char *this_opt) |
86 |
- } else |
87 |
- return 1; |
88 |
- } |
89 |
-- |
90 |
-+ |
91 |
- if (!strncmp(options, "map:", 4)) { |
92 |
- options += 4; |
93 |
- if (*options) { |
94 |
-@@ -490,8 +491,8 @@ static int __init fb_console_setup(char *this_opt) |
95 |
- first_fb_vc = 0; |
96 |
- if (*options++ == '-') |
97 |
- last_fb_vc = simple_strtoul(options, &options, 10) - 1; |
98 |
-- fbcon_is_default = 0; |
99 |
-- } |
100 |
-+ fbcon_is_default = 0; |
101 |
-+ } |
102 |
- |
103 |
- if (!strncmp(options, "rotate:", 7)) { |
104 |
- options += 7; |
105 |
-@@ -552,6 +553,9 @@ static int fbcon_takeover(int show_logo) |
106 |
+@@ -551,6 +551,9 @@ static int do_fbcon_takeover(int show_logo) |
107 |
info_idx = -1; |
108 |
} else { |
109 |
fbcon_has_console_bind = 1; |
110 |
@@ -898,16 +864,7 @@ |
111 |
} |
112 |
|
113 |
return err; |
114 |
-@@ -942,7 +946,7 @@ static const char *fbcon_startup(void) |
115 |
- info = registered_fb[info_idx]; |
116 |
- if (!info) |
117 |
- return NULL; |
118 |
-- |
119 |
-+ |
120 |
- owner = info->fbops->owner; |
121 |
- if (!try_module_get(owner)) |
122 |
- return NULL; |
123 |
-@@ -1006,6 +1010,12 @@ static const char *fbcon_startup(void) |
124 |
+@@ -1007,6 +1010,12 @@ static const char *fbcon_startup(void) |
125 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
126 |
cols /= vc->vc_font.width; |
127 |
rows /= vc->vc_font.height; |
128 |
@@ -920,7 +877,7 @@ |
129 |
vc_resize(vc, cols, rows); |
130 |
|
131 |
DPRINTK("mode: %s\n", info->fix.id); |
132 |
-@@ -1035,7 +1045,7 @@ static void fbcon_init(struct vc_data *vc, int init) |
133 |
+@@ -1036,7 +1045,7 @@ static void fbcon_init(struct vc_data *vc, int init) |
134 |
cap = info->flags; |
135 |
|
136 |
if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW || |
137 |
@@ -929,19 +886,19 @@ |
138 |
logo = 0; |
139 |
|
140 |
if (var_to_display(p, &info->var, info)) |
141 |
-@@ -1245,6 +1255,11 @@ static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height, |
142 |
- if (sy < vc->vc_top && vc->vc_top == logo_lines) |
143 |
- vc->vc_top = 0; |
144 |
+@@ -1260,6 +1269,11 @@ static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height, |
145 |
+ fbcon_clear_margins(vc, 0); |
146 |
+ } |
147 |
|
148 |
-+ if (fbcon_decor_active(info, vc)) { |
149 |
-+ fbcon_decor_clear(vc, info, sy, sx, height, width); |
150 |
-+ return; |
151 |
-+ } |
152 |
++ if (fbcon_decor_active(info, vc)) { |
153 |
++ fbcon_decor_clear(vc, info, sy, sx, height, width); |
154 |
++ return; |
155 |
++ } |
156 |
+ |
157 |
/* Split blits that cross physical y_wrap boundary */ |
158 |
|
159 |
y_break = p->vrows - p->yscroll; |
160 |
-@@ -1264,10 +1279,15 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s, |
161 |
+@@ -1279,10 +1293,15 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s, |
162 |
struct display *p = &fb_display[vc->vc_num]; |
163 |
struct fbcon_ops *ops = info->fbcon_par; |
164 |
|
165 |
@@ -955,56 +912,23 @@ |
166 |
+ fbcon_decor_putcs(vc, info, s, count, ypos, xpos); |
167 |
+ else |
168 |
+ ops->putcs(vc, info, s, count, real_y(p, ypos), xpos, |
169 |
-+ get_color(vc, info, scr_readw(s), 1), |
170 |
-+ get_color(vc, info, scr_readw(s), 0)); |
171 |
++ get_color(vc, info, scr_readw(s), 1), |
172 |
++ get_color(vc, info, scr_readw(s), 0)); |
173 |
+ } |
174 |
} |
175 |
|
176 |
static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos) |
177 |
-@@ -1283,8 +1303,13 @@ static void fbcon_clear_margins(struct vc_data *vc, int bottom_only) |
178 |
+@@ -1297,9 +1316,6 @@ static void fbcon_clear_margins(struct vc_data *vc, int bottom_only) |
179 |
+ { |
180 |
struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
181 |
struct fbcon_ops *ops = info->fbcon_par; |
182 |
- |
183 |
+- |
184 |
- if (!fbcon_is_inactive(vc, info)) |
185 |
- ops->clear_margins(vc, info, bottom_only); |
186 |
-+ if (!fbcon_is_inactive(vc, info)) { |
187 |
-+ if (fbcon_decor_active(info, vc)) { |
188 |
-+ fbcon_decor_clear_margins(vc, info, bottom_only); |
189 |
-+ } else { |
190 |
-+ ops->clear_margins(vc, info, bottom_only); |
191 |
-+ } |
192 |
-+ } |
193 |
} |
194 |
|
195 |
static void fbcon_cursor(struct vc_data *vc, int mode) |
196 |
-@@ -1394,7 +1419,7 @@ static __inline__ void ywrap_up(struct vc_data *vc, int count) |
197 |
- struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
198 |
- struct fbcon_ops *ops = info->fbcon_par; |
199 |
- struct display *p = &fb_display[vc->vc_num]; |
200 |
-- |
201 |
-+ |
202 |
- p->yscroll += count; |
203 |
- if (p->yscroll >= p->vrows) /* Deal with wrap */ |
204 |
- p->yscroll -= p->vrows; |
205 |
-@@ -1413,7 +1438,7 @@ static __inline__ void ywrap_down(struct vc_data *vc, int count) |
206 |
- struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
207 |
- struct fbcon_ops *ops = info->fbcon_par; |
208 |
- struct display *p = &fb_display[vc->vc_num]; |
209 |
-- |
210 |
-+ |
211 |
- p->yscroll -= count; |
212 |
- if (p->yscroll < 0) /* Deal with wrap */ |
213 |
- p->yscroll += p->vrows; |
214 |
-@@ -1480,7 +1505,7 @@ static __inline__ void ypan_down(struct vc_data *vc, int count) |
215 |
- struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
216 |
- struct display *p = &fb_display[vc->vc_num]; |
217 |
- struct fbcon_ops *ops = info->fbcon_par; |
218 |
-- |
219 |
-+ |
220 |
- p->yscroll -= count; |
221 |
- if (p->yscroll < 0) { |
222 |
- ops->bmove(vc, info, 0, 0, p->vrows - vc->vc_rows, |
223 |
-@@ -1804,7 +1829,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, |
224 |
+@@ -1819,7 +1835,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, |
225 |
count = vc->vc_rows; |
226 |
if (softback_top) |
227 |
fbcon_softback_note(vc, t, count); |
228 |
@@ -1013,7 +937,7 @@ |
229 |
goto redraw_up; |
230 |
switch (p->scrollmode) { |
231 |
case SCROLL_MOVE: |
232 |
-@@ -1897,6 +1922,8 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, |
233 |
+@@ -1912,6 +1928,8 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir, |
234 |
count = vc->vc_rows; |
235 |
if (logo_shown >= 0) |
236 |
goto redraw_down; |
237 |
@@ -1022,48 +946,21 @@ |
238 |
switch (p->scrollmode) { |
239 |
case SCROLL_MOVE: |
240 |
fbcon_redraw_blit(vc, info, p, b - 1, b - t - count, |
241 |
-@@ -1989,7 +2016,7 @@ static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx, |
242 |
- { |
243 |
- struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
244 |
- struct display *p = &fb_display[vc->vc_num]; |
245 |
-- |
246 |
-+ |
247 |
- if (fbcon_is_inactive(vc, info)) |
248 |
- return; |
249 |
- |
250 |
-@@ -2007,7 +2034,7 @@ static void fbcon_bmove(struct vc_data *vc, int sy, int sx, int dy, int dx, |
251 |
- p->vrows - p->yscroll); |
252 |
- } |
253 |
- |
254 |
--static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, |
255 |
-+static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int sx, |
256 |
- int dy, int dx, int height, int width, u_int y_break) |
257 |
- { |
258 |
- struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
259 |
-@@ -2045,6 +2072,13 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s |
260 |
+@@ -2060,6 +2078,13 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s |
261 |
} |
262 |
return; |
263 |
} |
264 |
+ |
265 |
+ if (fbcon_decor_active(info, vc) && sy == dy && height == 1) { |
266 |
-+ /* must use slower redraw bmove to keep background pic intact */ |
267 |
-+ fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width); |
268 |
-+ return; |
269 |
-+ } |
270 |
++ /* must use slower redraw bmove to keep background pic intact */ |
271 |
++ fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width); |
272 |
++ return; |
273 |
++ } |
274 |
+ |
275 |
ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx, |
276 |
height, width); |
277 |
} |
278 |
-@@ -2096,7 +2130,7 @@ static void updatescrollmode(struct display *p, |
279 |
- } |
280 |
- } |
281 |
- |
282 |
--static int fbcon_resize(struct vc_data *vc, unsigned int width, |
283 |
-+static int fbcon_resize(struct vc_data *vc, unsigned int width, |
284 |
- unsigned int height, unsigned int user) |
285 |
- { |
286 |
- struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]]; |
287 |
-@@ -2115,8 +2149,8 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width, |
288 |
+@@ -2130,8 +2155,8 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width, |
289 |
var.yres = virt_h * virt_fh; |
290 |
x_diff = info->var.xres - var.xres; |
291 |
y_diff = info->var.yres - var.yres; |
292 |
@@ -1074,29 +971,30 @@ |
293 |
const struct fb_videomode *mode; |
294 |
|
295 |
DPRINTK("attempting resize %ix%i\n", var.xres, var.yres); |
296 |
-@@ -2152,6 +2186,21 @@ static int fbcon_switch(struct vc_data *vc) |
297 |
- |
298 |
+@@ -2168,6 +2193,22 @@ static int fbcon_switch(struct vc_data *vc) |
299 |
info = registered_fb[con2fb_map[vc->vc_num]]; |
300 |
ops = info->fbcon_par; |
301 |
+ |
302 |
+ prev_console = ops->currcon; |
303 |
+ if (prev_console != -1) |
304 |
+ old_info = registered_fb[con2fb_map[prev_console]]; |
305 |
+ |
306 |
+#ifdef CONFIG_FB_CON_DECOR |
307 |
-+ if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
308 |
-+ struct vc_data *vc_curr = vc_cons[prev_console].d; |
309 |
-+ if (vc_curr && fbcon_decor_active_vc(vc_curr)) { |
310 |
-+ /* Clear the screen to avoid displaying funky colors during |
311 |
-+ * palette updates. */ |
312 |
-+ memset((u8*)info->screen_base + info->fix.line_length * info->var.yoffset, |
313 |
-+ 0, info->var.yres * info->fix.line_length); |
314 |
++ if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
315 |
++ struct vc_data *vc_curr = vc_cons[prev_console].d; |
316 |
++ if (vc_curr && fbcon_decor_active_vc(vc_curr)) { |
317 |
++ /* Clear the screen to avoid displaying funky colors during |
318 |
++ * * palette updates. */ |
319 |
++ memset((u8*)info->screen_base + info->fix.line_length * info->var.yoffset, |
320 |
++ 0, info->var.yres * info->fix.line_length); |
321 |
++ } |
322 |
+ } |
323 |
-+ } |
324 |
+#endif |
325 |
- |
326 |
++ |
327 |
if (softback_top) { |
328 |
if (softback_lines) |
329 |
-@@ -2170,9 +2219,6 @@ static int fbcon_switch(struct vc_data *vc) |
330 |
+ fbcon_set_origin(vc); |
331 |
+@@ -2185,9 +2226,6 @@ static int fbcon_switch(struct vc_data *vc) |
332 |
logo_shown = FBCON_LOGO_CANSHOW; |
333 |
} |
334 |
|
335 |
@@ -1106,53 +1004,34 @@ |
336 |
/* |
337 |
* FIXME: If we have multiple fbdev's loaded, we need to |
338 |
* update all info->currcon. Perhaps, we can place this |
339 |
-@@ -2216,6 +2262,18 @@ static int fbcon_switch(struct vc_data *vc) |
340 |
+@@ -2231,6 +2269,18 @@ static int fbcon_switch(struct vc_data *vc) |
341 |
fbcon_del_cursor_timer(old_info); |
342 |
} |
343 |
|
344 |
-+ if (fbcon_decor_active_vc(vc)) { |
345 |
++ if (fbcon_decor_active_vc(vc)) { |
346 |
+ struct vc_data *vc_curr = vc_cons[prev_console].d; |
347 |
+ |
348 |
+ if (!vc_curr->vc_decor.theme || |
349 |
+ strcmp(vc->vc_decor.theme, vc_curr->vc_decor.theme) || |
350 |
+ (fbcon_decor_active_nores(info, vc_curr) && |
351 |
-+ !fbcon_decor_active(info, vc_curr))) { |
352 |
-+ fbcon_decor_disable(vc, 0); |
353 |
-+ fbcon_decor_call_helper("modechange", vc->vc_num); |
354 |
++ !fbcon_decor_active(info, vc_curr))) { |
355 |
++ fbcon_decor_disable(vc, 0); |
356 |
++ fbcon_decor_call_helper("modechange", vc->vc_num); |
357 |
+ } |
358 |
+ } |
359 |
+ |
360 |
if (fbcon_is_inactive(vc, info) || |
361 |
ops->blank_state != FB_BLANK_UNBLANK) |
362 |
fbcon_del_cursor_timer(info); |
363 |
-@@ -2264,11 +2322,10 @@ static int fbcon_switch(struct vc_data *vc) |
364 |
- ops->update_start(info); |
365 |
- } |
366 |
- |
367 |
-- fbcon_set_palette(vc, color_table); |
368 |
-+ fbcon_set_palette(vc, color_table); |
369 |
- fbcon_clear_margins(vc, 0); |
370 |
- |
371 |
- if (logo_shown == FBCON_LOGO_DRAW) { |
372 |
-- |
373 |
- logo_shown = fg_console; |
374 |
- /* This is protected above by initmem_freed */ |
375 |
- fb_show_logo(info, ops->rotate); |
376 |
-@@ -2324,15 +2381,20 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) |
377 |
- } |
378 |
- } |
379 |
- |
380 |
-- if (!fbcon_is_inactive(vc, info)) { |
381 |
-+ if (!fbcon_is_inactive(vc, info)) { |
382 |
- if (ops->blank_state != blank) { |
383 |
+@@ -2344,10 +2394,14 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch) |
384 |
ops->blank_state = blank; |
385 |
fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW); |
386 |
ops->cursor_flash = (!blank); |
387 |
- |
388 |
+- |
389 |
- if (!(info->flags & FBINFO_MISC_USEREVENT)) |
390 |
- if (fb_blank(info, blank)) |
391 |
- fbcon_generic_blank(vc, info, blank); |
392 |
-+ if (!(info->flags & FBINFO_MISC_USEREVENT)) { |
393 |
++ if (!(info->flags & FBINFO_MISC_USEREVENT)) { |
394 |
+ if (fb_blank(info, blank)) { |
395 |
+ if (fbcon_decor_active(info, vc)) |
396 |
+ fbcon_decor_blank(vc, info, blank); |
397 |
@@ -1163,25 +1042,7 @@ |
398 |
} |
399 |
|
400 |
if (!blank) |
401 |
-@@ -2454,7 +2516,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, |
402 |
- vc->vc_complement_mask >>= 1; |
403 |
- vc->vc_s_complement_mask >>= 1; |
404 |
- } |
405 |
-- |
406 |
-+ |
407 |
- /* ++Edmund: reorder the attribute bits */ |
408 |
- if (vc->vc_can_do_color) { |
409 |
- unsigned short *cp = |
410 |
-@@ -2477,7 +2539,7 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, |
411 |
- vc->vc_complement_mask <<= 1; |
412 |
- vc->vc_s_complement_mask <<= 1; |
413 |
- } |
414 |
-- |
415 |
-+ |
416 |
- /* ++Edmund: reorder the attribute bits */ |
417 |
- { |
418 |
- unsigned short *cp = |
419 |
-@@ -2507,13 +2569,22 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, |
420 |
+@@ -2522,10 +2576,18 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h, |
421 |
} |
422 |
|
423 |
if (resize) { |
424 |
@@ -1196,123 +1057,102 @@ |
425 |
+ cols = vc->vc_decor.twidth; |
426 |
+ rows = vc->vc_decor.theight; |
427 |
+ } |
428 |
++ |
429 |
cols /= w; |
430 |
rows /= h; |
431 |
-+ |
432 |
vc_resize(vc, cols, rows); |
433 |
-+ |
434 |
- if (CON_IS_VISIBLE(vc) && softback_buf) |
435 |
- fbcon_update_softback(vc); |
436 |
- } else if (CON_IS_VISIBLE(vc) |
437 |
-@@ -2597,7 +2661,7 @@ static int fbcon_set_font(struct vc_data *vc, struct console_font *font, unsigne |
438 |
- /* Check if the same font is on some other console already */ |
439 |
- for (i = first_fb_vc; i <= last_fb_vc; i++) { |
440 |
- struct vc_data *tmp = vc_cons[i].d; |
441 |
-- |
442 |
-+ |
443 |
- if (fb_display[i].userfont && |
444 |
- fb_display[i].fontdata && |
445 |
- FNTSUM(fb_display[i].fontdata) == csum && |
446 |
-@@ -2642,7 +2713,11 @@ static int fbcon_set_palette(struct vc_data *vc, unsigned char *table) |
447 |
+@@ -2657,7 +2719,11 @@ static int fbcon_set_palette(struct vc_data *vc, unsigned char *table) |
448 |
int i, j, k, depth; |
449 |
u8 val; |
450 |
|
451 |
- if (fbcon_is_inactive(vc, info)) |
452 |
+ if (fbcon_is_inactive(vc, info) |
453 |
+#ifdef CONFIG_FB_CON_DECOR |
454 |
-+ || vc->vc_num != fg_console |
455 |
++ || vc->vc_num != fg_console |
456 |
+#endif |
457 |
-+ ) |
458 |
++ ) |
459 |
return -EINVAL; |
460 |
|
461 |
if (!CON_IS_VISIBLE(vc)) |
462 |
-@@ -2668,14 +2743,56 @@ static int fbcon_set_palette(struct vc_data *vc, unsigned char *table) |
463 |
+@@ -2683,7 +2749,49 @@ static int fbcon_set_palette(struct vc_data *vc, unsigned char *table) |
464 |
} else |
465 |
fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap); |
466 |
|
467 |
- return fb_set_cmap(&palette_cmap, info); |
468 |
+ if (fbcon_decor_active(info, vc_cons[fg_console].d) && |
469 |
-+ info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
470 |
++ info->fix.visual == FB_VISUAL_DIRECTCOLOR) { |
471 |
+ |
472 |
-+ u16 *red, *green, *blue; |
473 |
-+ int minlen = min(min(info->var.red.length, info->var.green.length), |
474 |
-+ info->var.blue.length); |
475 |
-+ int h; |
476 |
++ u16 *red, *green, *blue; |
477 |
++ int minlen = min(min(info->var.red.length, info->var.green.length), |
478 |
++ info->var.blue.length); |
479 |
++ int h; |
480 |
+ |
481 |
-+ struct fb_cmap cmap = { |
482 |
-+ .start = 0, |
483 |
-+ .len = (1 << minlen), |
484 |
-+ .red = NULL, |
485 |
-+ .green = NULL, |
486 |
-+ .blue = NULL, |
487 |
-+ .transp = NULL |
488 |
-+ }; |
489 |
++ struct fb_cmap cmap = { |
490 |
++ .start = 0, |
491 |
++ .len = (1 << minlen), |
492 |
++ .red = NULL, |
493 |
++ .green = NULL, |
494 |
++ .blue = NULL, |
495 |
++ .transp = NULL |
496 |
++ }; |
497 |
+ |
498 |
-+ red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL); |
499 |
++ red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL); |
500 |
+ |
501 |
-+ if (!red) |
502 |
-+ goto out; |
503 |
++ if (!red) |
504 |
++ goto out; |
505 |
+ |
506 |
-+ green = red + 256; |
507 |
-+ blue = green + 256; |
508 |
-+ cmap.red = red; |
509 |
-+ cmap.green = green; |
510 |
-+ cmap.blue = blue; |
511 |
++ green = red + 256; |
512 |
++ blue = green + 256; |
513 |
++ cmap.red = red; |
514 |
++ cmap.green = green; |
515 |
++ cmap.blue = blue; |
516 |
+ |
517 |
-+ for (i = 0; i < cmap.len; i++) { |
518 |
-+ red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1); |
519 |
-+ } |
520 |
++ for (i = 0; i < cmap.len; i++) { |
521 |
++ red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1); |
522 |
++ } |
523 |
+ |
524 |
-+ h = fb_set_cmap(&cmap, info); |
525 |
-+ fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d); |
526 |
-+ kfree(red); |
527 |
++ h = fb_set_cmap(&cmap, info); |
528 |
++ fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d); |
529 |
++ kfree(red); |
530 |
+ |
531 |
-+ return h; |
532 |
++ return h; |
533 |
+ |
534 |
-+ } else if (fbcon_decor_active(info, vc_cons[fg_console].d) && |
535 |
-+ info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL) |
536 |
-+ fb_set_cmap(&info->bgdecor.cmap, info); |
537 |
++ } else if (fbcon_decor_active(info, vc_cons[fg_console].d) && |
538 |
++ info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL) |
539 |
++ fb_set_cmap(&info->bgdecor.cmap, info); |
540 |
+ |
541 |
-+out: return fb_set_cmap(&palette_cmap, info); |
542 |
++out: return fb_set_cmap(&palette_cmap, info); |
543 |
} |
544 |
|
545 |
static u16 *fbcon_screen_pos(struct vc_data *vc, int offset) |
546 |
- { |
547 |
- unsigned long p; |
548 |
- int line; |
549 |
-- |
550 |
-+ |
551 |
- if (vc->vc_num != fg_console || !softback_lines) |
552 |
- return (u16 *) (vc->vc_origin + offset); |
553 |
- line = offset / vc->vc_size_row; |
554 |
-@@ -2894,7 +3011,14 @@ static void fbcon_modechanged(struct fb_info *info) |
555 |
+@@ -2909,7 +3017,13 @@ static void fbcon_modechanged(struct fb_info *info) |
556 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
557 |
cols /= vc->vc_font.width; |
558 |
rows /= vc->vc_font.height; |
559 |
- vc_resize(vc, cols, rows); |
560 |
-+ |
561 |
-+ if (!fbcon_decor_active_nores(info, vc)) { |
562 |
-+ vc_resize(vc, cols, rows); |
563 |
++ if (!fbcon_decor_active_nores(info, vc)) { |
564 |
++ vc_resize(vc, cols, rows); |
565 |
+ } else { |
566 |
-+ fbcon_decor_disable(vc, 0); |
567 |
-+ fbcon_decor_call_helper("modechange", vc->vc_num); |
568 |
-+ } |
569 |
++ fbcon_decor_disable(vc, 0); |
570 |
++ fbcon_decor_call_helper("modechange", vc->vc_num); |
571 |
++ } |
572 |
+ |
573 |
updatescrollmode(p, info, vc); |
574 |
scrollback_max = 0; |
575 |
scrollback_current = 0; |
576 |
-@@ -2939,7 +3063,9 @@ static void fbcon_set_all_vcs(struct fb_info *info) |
577 |
+@@ -2954,7 +3068,10 @@ static void fbcon_set_all_vcs(struct fb_info *info) |
578 |
rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres); |
579 |
cols /= vc->vc_font.width; |
580 |
rows /= vc->vc_font.height; |
581 |
- vc_resize(vc, cols, rows); |
582 |
+ if (!fbcon_decor_active_nores(info, vc)) { |
583 |
-+ vc_resize(vc, cols, rows); |
584 |
++ vc_resize(vc, cols, rows); |
585 |
+ } |
586 |
++ |
587 |
} |
588 |
|
589 |
if (fg != -1) |
590 |
-@@ -3549,6 +3675,7 @@ static void fbcon_exit(void) |
591 |
+@@ -3570,6 +3687,7 @@ static void fbcon_exit(void) |
592 |
} |
593 |
} |
594 |
|
595 |
@@ -1320,15 +1160,9 @@ |
596 |
fbcon_has_exited = 1; |
597 |
} |
598 |
|
599 |
-@@ -3602,7 +3729,7 @@ static void __exit fb_console_exit(void) |
600 |
- fbcon_exit(); |
601 |
- console_unlock(); |
602 |
- unregister_con_driver(&fb_con); |
603 |
--} |
604 |
-+} |
605 |
- |
606 |
- module_exit(fb_console_exit); |
607 |
- |
608 |
+-- |
609 |
+1.8.1.5 |
610 |
+ |
611 |
diff --git a/drivers/video/console/fbcondecor.c b/drivers/video/console/fbcondecor.c |
612 |
new file mode 100644 |
613 |
index 0000000..7189ce6 |