Gentoo Archives: gentoo-commits

From: "Mike Pagano (mpagano)" <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] linux-patches r1535 - genpatches-2.6/trunk/2.6.29
Date: Tue, 24 Mar 2009 23:58:09
Message-Id: E1LmGVN-0006bN-HG@stork.gentoo.org
1 Author: mpagano
2 Date: 2009-03-24 23:58:01 +0000 (Tue, 24 Mar 2009)
3 New Revision: 1535
4
5 Added:
6 genpatches-2.6/trunk/2.6.29/4200_fbcondecor-0.9.5.patch
7 Removed:
8 genpatches-2.6/trunk/2.6.29/4200_fbcondecor-0.9.4.patch
9 Modified:
10 genpatches-2.6/trunk/2.6.29/0000_README
11 Log:
12 fbcondecor console decoration version bump
13
14 Modified: genpatches-2.6/trunk/2.6.29/0000_README
15 ===================================================================
16 --- genpatches-2.6/trunk/2.6.29/0000_README 2009-03-24 13:33:40 UTC (rev 1534)
17 +++ genpatches-2.6/trunk/2.6.29/0000_README 2009-03-24 23:58:01 UTC (rev 1535)
18 @@ -43,7 +43,7 @@
19 From: EVMS 2.5.2
20 Desc: Bad block relocation support for LiveCD users
21
22 -Patch: 4200_fbcondecor-0.9.4.patch
23 +Patch: 4200_fbcondecor-0.9.5.patch
24 From: http://dev.gentoo.org/~spock
25 Desc: Bootsplash successor by Michal Januszewski
26
27
28 Deleted: genpatches-2.6/trunk/2.6.29/4200_fbcondecor-0.9.4.patch
29 ===================================================================
30 --- genpatches-2.6/trunk/2.6.29/4200_fbcondecor-0.9.4.patch 2009-03-24 13:33:40 UTC (rev 1534)
31 +++ genpatches-2.6/trunk/2.6.29/4200_fbcondecor-0.9.4.patch 2009-03-24 23:58:01 UTC (rev 1535)
32 @@ -1,1777 +0,0 @@
33 -diff -Naurp -x .git /tmp/linux/Documentation/fb/00-INDEX ./Documentation/fb/00-INDEX
34 ---- /tmp/linux/Documentation/fb/00-INDEX 2008-03-25 07:24:16.000000000 +0100
35 -+++ ./Documentation/fb/00-INDEX 2008-03-25 23:04:10.000000000 +0100
36 -@@ -17,6 +17,8 @@ deferred_io.txt
37 - - an introduction to deferred IO.
38 - fbcon.txt
39 - - intro to and usage guide for the framebuffer console (fbcon).
40 -+fbcondecor.txt
41 -+ - info on the Framebuffer Console Decoration
42 - framebuffer.txt
43 - - introduction to frame buffer devices.
44 - imacfb.txt
45 -diff -Naurp -x .git /tmp/linux/Documentation/fb/fbcondecor.txt ./Documentation/fb/fbcondecor.txt
46 ---- /tmp/linux/Documentation/fb/fbcondecor.txt 1970-01-01 01:00:00.000000000 +0100
47 -+++ ./Documentation/fb/fbcondecor.txt 2008-03-25 23:04:10.000000000 +0100
48 -@@ -0,0 +1,207 @@
49 -+What is it?
50 -+-----------
51 -+
52 -+The framebuffer decorations are a kernel feature which allows displaying a
53 -+background picture on selected consoles.
54 -+
55 -+What do I need to get it to work?
56 -+---------------------------------
57 -+
58 -+To get fbcondecor up-and-running you will have to:
59 -+ 1) get a copy of splashutils [1] or a similar program
60 -+ 2) get some fbcondecor themes
61 -+ 3) build the kernel helper program
62 -+ 4) build your kernel with the FB_CON_DECOR option enabled.
63 -+
64 -+To get fbcondecor operational right after fbcon initialization is finished, you
65 -+will have to include a theme and the kernel helper into your initramfs image.
66 -+Please refer to splashutils documentation for instructions on how to do that.
67 -+
68 -+[1] The splashutils package can be downloaded from:
69 -+ http://dev.gentoo.org/~spock/projects/splashutils/
70 -+
71 -+The userspace helper
72 -+--------------------
73 -+
74 -+The userspace fbcondecor helper (by default: /sbin/fbcondecor_helper) is called by the
75 -+kernel whenever an important event occurs and the kernel needs some kind of
76 -+job to be carried out. Important events include console switches and video
77 -+mode switches (the kernel requests background images and configuration
78 -+parameters for the current console). The fbcondecor helper must be accessible at
79 -+all times. If it's not, fbcondecor will be switched off automatically.
80 -+
81 -+It's possible to set path to the fbcondecor helper by writing it to
82 -+/proc/sys/kernel/fbcondecor.
83 -+
84 -+*****************************************************************************
85 -+
86 -+The information below is mostly technical stuff. There's probably no need to
87 -+read it unless you plan to develop a userspace helper.
88 -+
89 -+The fbcondecor protocol
90 -+-----------------------
91 -+
92 -+The fbcondecor protocol defines a communication interface between the kernel and
93 -+the userspace fbcondecor helper.
94 -+
95 -+The kernel side is responsible for:
96 -+
97 -+ * rendering console text, using an image as a background (instead of a
98 -+ standard solid color fbcon uses),
99 -+ * accepting commands from the user via ioctls on the fbcondecor device,
100 -+ * calling the userspace helper to set things up as soon as the fb subsystem
101 -+ is initialized.
102 -+
103 -+The userspace helper is responsible for everything else, including parsing
104 -+configuration files, decompressing the image files whenever the kernel needs
105 -+it, and communicating with the kernel if necessary.
106 -+
107 -+The fbcondecor protocol specifies how communication is done in both ways:
108 -+kernel->userspace and userspace->helper.
109 -+
110 -+Kernel -> Userspace
111 -+-------------------
112 -+
113 -+The kernel communicates with the userspace helper by calling it and specifying
114 -+the task to be done in a series of arguments.
115 -+
116 -+The arguments follow the pattern:
117 -+<fbcondecor protocol version> <command> <parameters>
118 -+
119 -+All commands defined in fbcondecor protocol v2 have the following parameters:
120 -+ virtual console
121 -+ framebuffer number
122 -+ theme
123 -+
124 -+Fbcondecor protocol v1 specified an additional 'fbcondecor mode' after the
125 -+framebuffer number. Fbcondecor protocol v1 is deprecated and should not be used.
126 -+
127 -+Fbcondecor protocol v2 specifies the following commands:
128 -+
129 -+getpic
130 -+------
131 -+ The kernel issues this command to request image data. It's up to the
132 -+ userspace helper to find a background image appropriate for the specified
133 -+ theme and the current resolution. The userspace helper should respond by
134 -+ issuing the FBIOCONDECOR_SETPIC ioctl.
135 -+
136 -+init
137 -+----
138 -+ The kernel issues this command after the fbcondecor device is created and
139 -+ the fbcondecor interface is initialized. Upon receiving 'init', the userspace
140 -+ helper should parse the kernel command line (/proc/cmdline) or otherwise
141 -+ decide whether fbcondecor is to be activated.
142 -+
143 -+ To activate fbcondecor on the first console the helper should issue the
144 -+ FBIOCONDECOR_SETCFG, FBIOCONDECOR_SETPIC and FBIOCONDECOR_SETSTATE commands,
145 -+ in the above-mentioned order.
146 -+
147 -+ When the userspace helper is called in an early phase of the boot process
148 -+ (right after the initialization of fbcon), no filesystems will be mounted.
149 -+ The helper program should mount sysfs and then create the appropriate
150 -+ framebuffer, fbcondecor and tty0 devices (if they don't already exist) to get
151 -+ current display settings and to be able to communicate with the kernel side.
152 -+ It should probably also mount the procfs to be able to parse the kernel
153 -+ command line parameters.
154 -+
155 -+ Note that the console sem is not held when the kernel calls fbcondecor_helper
156 -+ with the 'init' command. The fbcondecor helper should perform all ioctls with
157 -+ origin set to FBCON_DECOR_IO_ORIG_USER.
158 -+
159 -+modechange
160 -+----------
161 -+ The kernel issues this command on a mode change. The helper's response should
162 -+ be similar to the response to the 'init' command. Note that this time the
163 -+ console sem is held and all ioctls must be performed with origin set to
164 -+ FBCON_DECOR_IO_ORIG_KERNEL.
165 -+
166 -+
167 -+Userspace -> Kernel
168 -+-------------------
169 -+
170 -+Userspace programs can communicate with fbcondecor via ioctls on the
171 -+fbcondecor device. These ioctls are to be used by both the userspace helper
172 -+(called only by the kernel) and userspace configuration tools (run by the users).
173 -+
174 -+The fbcondecor helper should set the origin field to FBCON_DECOR_IO_ORIG_KERNEL
175 -+when doing the appropriate ioctls. All userspace configuration tools should
176 -+use FBCON_DECOR_IO_ORIG_USER. Failure to set the appropriate value in the origin
177 -+field when performing ioctls from the kernel helper will most likely result
178 -+in a console deadlock.
179 -+
180 -+FBCON_DECOR_IO_ORIG_KERNEL instructs fbcondecor not to try to acquire the console
181 -+semaphore. Not surprisingly, FBCON_DECOR_IO_ORIG_USER instructs it to acquire
182 -+the console sem.
183 -+
184 -+The framebuffer console decoration provides the following ioctls (all defined in
185 -+linux/fb.h):
186 -+
187 -+FBIOCONDECOR_SETPIC
188 -+description: loads a background picture for a virtual console
189 -+argument: struct fbcon_decor_iowrapper*; data: struct fb_image*
190 -+notes:
191 -+If called for consoles other than the current foreground one, the picture data
192 -+will be ignored.
193 -+
194 -+If the current virtual console is running in a 8-bpp mode, the cmap substruct
195 -+of fb_image has to be filled appropriately: start should be set to 16 (first
196 -+16 colors are reserved for fbcon), len to a value <= 240 and red, green and
197 -+blue should point to valid cmap data. The transp field is ingored. The fields
198 -+dx, dy, bg_color, fg_color in fb_image are ignored as well.
199 -+
200 -+FBIOCONDECOR_SETCFG
201 -+description: sets the fbcondecor config for a virtual console
202 -+argument: struct fbcon_decor_iowrapper*; data: struct vc_decor*
203 -+notes: The structure has to be filled with valid data.
204 -+
205 -+FBIOCONDECOR_GETCFG
206 -+description: gets the fbcondecor config for a virtual console
207 -+argument: struct fbcon_decor_iowrapper*; data: struct vc_decor*
208 -+
209 -+FBIOCONDECOR_SETSTATE
210 -+description: sets the fbcondecor state for a virtual console
211 -+argument: struct fbcon_decor_iowrapper*; data: unsigned int*
212 -+ values: 0 = disabled, 1 = enabled.
213 -+
214 -+FBIOCONDECOR_GETSTATE
215 -+description: gets the fbcondecor state for a virtual console
216 -+argument: struct fbcon_decor_iowrapper*; data: unsigned int*
217 -+ values: as in FBIOCONDECOR_SETSTATE
218 -+
219 -+Info on used structures:
220 -+
221 -+Definition of struct vc_decor can be found in linux/console_decor.h. It's
222 -+heavily commented. Note that the 'theme' field should point to a string
223 -+no longer than FBCON_DECOR_THEME_LEN. When FBIOCONDECOR_GETCFG call is
224 -+performed, the theme field should point to a char buffer of length
225 -+FBCON_DECOR_THEME_LEN.
226 -+
227 -+Definition of struct fbcon_decor_iowrapper can be found in linux/fb.h.
228 -+The fields in this struct have the following meaning:
229 -+
230 -+vc:
231 -+Virtual console number.
232 -+
233 -+origin:
234 -+Specifies if the ioctl is performed as a response to a kernel request. The
235 -+fbcondecor helper should set this field to FBCON_DECOR_IO_ORIG_KERNEL, userspace
236 -+programs should set it to FBCON_DECOR_IO_ORIG_USER. This field is necessary to
237 -+avoid console semaphore deadlocks.
238 -+
239 -+data:
240 -+Pointer to a data structure appropriate for the performed ioctl. Type of
241 -+the data struct is specified in the ioctls description.
242 -+
243 -+*****************************************************************************
244 -+
245 -+Credit
246 -+------
247 -+
248 -+Original 'bootsplash' project & implementation by:
249 -+ Volker Poplawski <volker@×××××××××.de>, Stefan Reinauer <stepan@××××.de>,
250 -+ Steffen Winterfeldt <snwint@××××.de>, Michael Schroeder <mls@××××.de>,
251 -+ Ken Wimer <wimer@××××.de>.
252 -+
253 -+Fbcondecor, fbcondecor protocol design, current implementation & docs by:
254 -+ Michal Januszewski <spock@g.o>
255 -+
256 ---- a/drivers/Makefile 2008-10-12 13:30:08.000000000 -0400
257 -+++ b/drivers/Makefile 2008-10-12 13:30:51.000000000 -0400
258 -@@ -9,6 +9,9 @@ obj-y += gpio/
259 - obj-$(CONFIG_PCI) += pci/
260 - obj-$(CONFIG_PARISC) += parisc/
261 - obj-$(CONFIG_RAPIDIO) += rapidio/
262 -+# char/ comes before serial/ etc so that the VT console is the boot-time
263 -+# default.
264 -+obj-y += char/
265 - obj-y += video/
266 - obj-$(CONFIG_ACPI) += acpi/
267 - # PnP must come after ACPI since it will eventually need to check if acpi
268 -@@ -18,9 +21,6 @@ obj-$(CONFIG_ARM_AMBA) += amba/
269 -
270 - obj-$(CONFIG_XEN) += xen/
271 -
272 --# char/ comes before serial/ etc so that the VT console is the boot-time
273 --# default.
274 --obj-y += char/
275 -
276 - # gpu/ comes after char for AGP vs DRM startup
277 - obj-y += gpu/
278 -diff -Naurp -x .git /tmp/linux/drivers/video/console/bitblit.c ./drivers/video/console/bitblit.c
279 ---- /tmp/linux/drivers/video/console/bitblit.c 2008-03-25 07:24:16.000000000 +0100
280 -+++ ./drivers/video/console/bitblit.c 2008-03-25 23:04:10.000000000 +0100
281 -@@ -17,6 +17,7 @@
282 - #include <linux/console.h>
283 - #include <asm/types.h>
284 - #include "fbcon.h"
285 -+#include "fbcondecor.h"
286 -
287 - /*
288 - * Accelerated handlers.
289 -@@ -54,6 +55,13 @@ static void bit_bmove(struct vc_data *vc
290 - area.height = height * vc->vc_font.height;
291 - area.width = width * vc->vc_font.width;
292 -
293 -+ if (fbcon_decor_active(info, vc)) {
294 -+ area.sx += vc->vc_decor.tx;
295 -+ area.sy += vc->vc_decor.ty;
296 -+ area.dx += vc->vc_decor.tx;
297 -+ area.dy += vc->vc_decor.ty;
298 -+ }
299 -+
300 - info->fbops->fb_copyarea(info, &area);
301 - }
302 -
303 -@@ -379,11 +387,15 @@ static void bit_cursor(struct vc_data *v
304 - cursor.image.depth = 1;
305 - cursor.rop = ROP_XOR;
306 -
307 -- if (info->fbops->fb_cursor)
308 -- err = info->fbops->fb_cursor(info, &cursor);
309 -+ if (fbcon_decor_active(info, vc)) {
310 -+ fbcon_decor_cursor(info, &cursor);
311 -+ } else {
312 -+ if (info->fbops->fb_cursor)
313 -+ err = info->fbops->fb_cursor(info, &cursor);
314 -
315 -- if (err)
316 -- soft_cursor(info, &cursor);
317 -+ if (err)
318 -+ soft_cursor(info, &cursor);
319 -+ }
320 -
321 - ops->cursor_reset = 0;
322 - }
323 -diff -Naurp -x .git /tmp/linux/drivers/video/console/cfbcondecor.c ./drivers/video/console/cfbcondecor.c
324 ---- /tmp/linux/drivers/video/console/cfbcondecor.c 1970-01-01 01:00:00.000000000 +0100
325 -+++ ./drivers/video/console/cfbcondecor.c 2008-03-25 23:11:30.000000000 +0100
326 -@@ -0,0 +1,471 @@
327 -+/*
328 -+ * linux/drivers/video/cfbcon_decor.c -- Framebuffer decor render functions
329 -+ *
330 -+ * Copyright (C) 2004 Michal Januszewski <spock@g.o>
331 -+ *
332 -+ * Code based upon "Bootdecor" (C) 2001-2003
333 -+ * Volker Poplawski <volker@×××××××××.de>,
334 -+ * Stefan Reinauer <stepan@××××.de>,
335 -+ * Steffen Winterfeldt <snwint@××××.de>,
336 -+ * Michael Schroeder <mls@××××.de>,
337 -+ * Ken Wimer <wimer@××××.de>.
338 -+ *
339 -+ * This file is subject to the terms and conditions of the GNU General Public
340 -+ * License. See the file COPYING in the main directory of this archive for
341 -+ * more details.
342 -+ */
343 -+#include <linux/module.h>
344 -+#include <linux/types.h>
345 -+#include <linux/fb.h>
346 -+#include <linux/selection.h>
347 -+#include <linux/vt_kern.h>
348 -+#include <asm/irq.h>
349 -+#include <asm/system.h>
350 -+
351 -+#include "fbcon.h"
352 -+#include "fbcondecor.h"
353 -+
354 -+#define parse_pixel(shift,bpp,type) \
355 -+ do { \
356 -+ if (d & (0x80 >> (shift))) \
357 -+ dd2[(shift)] = fgx; \
358 -+ else \
359 -+ dd2[(shift)] = transparent ? *(type *)decor_src : bgx; \
360 -+ decor_src += (bpp); \
361 -+ } while (0) \
362 -+
363 -+extern int get_color(struct vc_data *vc, struct fb_info *info,
364 -+ u16 c, int is_fg);
365 -+
366 -+void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc)
367 -+{
368 -+ int i, j, k;
369 -+ int minlen = min(min(info->var.red.length, info->var.green.length),
370 -+ info->var.blue.length);
371 -+ u32 col;
372 -+
373 -+ for (j = i = 0; i < 16; i++) {
374 -+ k = color_table[i];
375 -+
376 -+ col = ((vc->vc_palette[j++] >> (8-minlen))
377 -+ << info->var.red.offset);
378 -+ col |= ((vc->vc_palette[j++] >> (8-minlen))
379 -+ << info->var.green.offset);
380 -+ col |= ((vc->vc_palette[j++] >> (8-minlen))
381 -+ << info->var.blue.offset);
382 -+ ((u32 *)info->pseudo_palette)[k] = col;
383 -+ }
384 -+}
385 -+
386 -+void fbcon_decor_renderc(struct fb_info *info, int ypos, int xpos, int height,
387 -+ int width, u8* src, u32 fgx, u32 bgx, u8 transparent)
388 -+{
389 -+ unsigned int x, y;
390 -+ u32 dd;
391 -+ int bytespp = ((info->var.bits_per_pixel + 7) >> 3);
392 -+ unsigned int d = ypos * info->fix.line_length + xpos * bytespp;
393 -+ unsigned int ds = (ypos * info->var.xres + xpos) * bytespp;
394 -+ u16 dd2[4];
395 -+
396 -+ u8* decor_src = (u8 *)(info->bgdecor.data + ds);
397 -+ u8* dst = (u8 *)(info->screen_base + d);
398 -+
399 -+ if ((ypos + height) > info->var.yres || (xpos + width) > info->var.xres)
400 -+ return;
401 -+
402 -+ for (y = 0; y < height; y++) {
403 -+ switch (info->var.bits_per_pixel) {
404 -+
405 -+ case 32:
406 -+ for (x = 0; x < width; x++) {
407 -+
408 -+ if ((x & 7) == 0)
409 -+ d = *src++;
410 -+ if (d & 0x80)
411 -+ dd = fgx;
412 -+ else
413 -+ dd = transparent ?
414 -+ *(u32 *)decor_src : bgx;
415 -+
416 -+ d <<= 1;
417 -+ decor_src += 4;
418 -+ fb_writel(dd, dst);
419 -+ dst += 4;
420 -+ }
421 -+ break;
422 -+ case 24:
423 -+ for (x = 0; x < width; x++) {
424 -+
425 -+ if ((x & 7) == 0)
426 -+ d = *src++;
427 -+ if (d & 0x80)
428 -+ dd = fgx;
429 -+ else
430 -+ dd = transparent ?
431 -+ (*(u32 *)decor_src & 0xffffff) : bgx;
432 -+
433 -+ d <<= 1;
434 -+ decor_src += 3;
435 -+#ifdef __LITTLE_ENDIAN
436 -+ fb_writew(dd & 0xffff, dst);
437 -+ dst += 2;
438 -+ fb_writeb((dd >> 16), dst);
439 -+#else
440 -+ fb_writew(dd >> 8, dst);
441 -+ dst += 2;
442 -+ fb_writeb(dd & 0xff, dst);
443 -+#endif
444 -+ dst++;
445 -+ }
446 -+ break;
447 -+ case 16:
448 -+ for (x = 0; x < width; x += 2) {
449 -+ if ((x & 7) == 0)
450 -+ d = *src++;
451 -+
452 -+ parse_pixel(0, 2, u16);
453 -+ parse_pixel(1, 2, u16);
454 -+#ifdef __LITTLE_ENDIAN
455 -+ dd = dd2[0] | (dd2[1] << 16);
456 -+#else
457 -+ dd = dd2[1] | (dd2[0] << 16);
458 -+#endif
459 -+ d <<= 2;
460 -+ fb_writel(dd, dst);
461 -+ dst += 4;
462 -+ }
463 -+ break;
464 -+
465 -+ case 8:
466 -+ for (x = 0; x < width; x += 4) {
467 -+ if ((x & 7) == 0)
468 -+ d = *src++;
469 -+
470 -+ parse_pixel(0, 1, u8);
471 -+ parse_pixel(1, 1, u8);
472 -+ parse_pixel(2, 1, u8);
473 -+ parse_pixel(3, 1, u8);
474 -+
475 -+#ifdef __LITTLE_ENDIAN
476 -+ dd = dd2[0] | (dd2[1] << 8) | (dd2[2] << 16) | (dd2[3] << 24);
477 -+#else
478 -+ dd = dd2[3] | (dd2[2] << 8) | (dd2[1] << 16) | (dd2[0] << 24);
479 -+#endif
480 -+ d <<= 4;
481 -+ fb_writel(dd, dst);
482 -+ dst += 4;
483 -+ }
484 -+ }
485 -+
486 -+ dst += info->fix.line_length - width * bytespp;
487 -+ decor_src += (info->var.xres - width) * bytespp;
488 -+ }
489 -+}
490 -+
491 -+#define cc2cx(a) \
492 -+ ((info->fix.visual == FB_VISUAL_TRUECOLOR || \
493 -+ info->fix.visual == FB_VISUAL_DIRECTCOLOR) ? \
494 -+ ((u32*)info->pseudo_palette)[a] : a)
495 -+
496 -+void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info,
497 -+ const unsigned short *s, int count, int yy, int xx)
498 -+{
499 -+ unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
500 -+ struct fbcon_ops *ops = info->fbcon_par;
501 -+ int fg_color, bg_color, transparent;
502 -+ u8 *src;
503 -+ u32 bgx, fgx;
504 -+ u16 c = scr_readw(s);
505 -+
506 -+ fg_color = get_color(vc, info, c, 1);
507 -+ bg_color = get_color(vc, info, c, 0);
508 -+
509 -+ /* Don't paint the background image if console is blanked */
510 -+ transparent = ops->blank_state ? 0 :
511 -+ (vc->vc_decor.bg_color == bg_color);
512 -+
513 -+ xx = xx * vc->vc_font.width + vc->vc_decor.tx;
514 -+ yy = yy * vc->vc_font.height + vc->vc_decor.ty;
515 -+
516 -+ fgx = cc2cx(fg_color);
517 -+ bgx = cc2cx(bg_color);
518 -+
519 -+ while (count--) {
520 -+ c = scr_readw(s++);
521 -+ src = vc->vc_font.data + (c & charmask) * vc->vc_font.height *
522 -+ ((vc->vc_font.width + 7) >> 3);
523 -+
524 -+ fbcon_decor_renderc(info, yy, xx, vc->vc_font.height,
525 -+ vc->vc_font.width, src, fgx, bgx, transparent);
526 -+ xx += vc->vc_font.width;
527 -+ }
528 -+}
529 -+
530 -+void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor)
531 -+{
532 -+ int i;
533 -+ unsigned int dsize, s_pitch;
534 -+ struct fbcon_ops *ops = info->fbcon_par;
535 -+ struct vc_data* vc;
536 -+ u8 *src;
537 -+
538 -+ /* we really don't need any cursors while the console is blanked */
539 -+ if (info->state != FBINFO_STATE_RUNNING || ops->blank_state)
540 -+ return;
541 -+
542 -+ vc = vc_cons[ops->currcon].d;
543 -+
544 -+ src = kmalloc(64 + sizeof(struct fb_image), GFP_ATOMIC);
545 -+ if (!src)
546 -+ return;
547 -+
548 -+ s_pitch = (cursor->image.width + 7) >> 3;
549 -+ dsize = s_pitch * cursor->image.height;
550 -+ if (cursor->enable) {
551 -+ switch (cursor->rop) {
552 -+ case ROP_XOR:
553 -+ for (i = 0; i < dsize; i++)
554 -+ src[i] = cursor->image.data[i] ^ cursor->mask[i];
555 -+ break;
556 -+ case ROP_COPY:
557 -+ default:
558 -+ for (i = 0; i < dsize; i++)
559 -+ src[i] = cursor->image.data[i] & cursor->mask[i];
560 -+ break;
561 -+ }
562 -+ } else
563 -+ memcpy(src, cursor->image.data, dsize);
564 -+
565 -+ fbcon_decor_renderc(info,
566 -+ cursor->image.dy + vc->vc_decor.ty,
567 -+ cursor->image.dx + vc->vc_decor.tx,
568 -+ cursor->image.height,
569 -+ cursor->image.width,
570 -+ (u8*)src,
571 -+ cc2cx(cursor->image.fg_color),
572 -+ cc2cx(cursor->image.bg_color),
573 -+ cursor->image.bg_color == vc->vc_decor.bg_color);
574 -+
575 -+ kfree(src);
576 -+}
577 -+
578 -+static void decorset(u8 *dst, int height, int width, int dstbytes,
579 -+ u32 bgx, int bpp)
580 -+{
581 -+ int i;
582 -+
583 -+ if (bpp == 8)
584 -+ bgx |= bgx << 8;
585 -+ if (bpp == 16 || bpp == 8)
586 -+ bgx |= bgx << 16;
587 -+
588 -+ while (height-- > 0) {
589 -+ u8 *p = dst;
590 -+
591 -+ switch (bpp) {
592 -+
593 -+ case 32:
594 -+ for (i=0; i < width; i++) {
595 -+ fb_writel(bgx, p); p += 4;
596 -+ }
597 -+ break;
598 -+ case 24:
599 -+ for (i=0; i < width; i++) {
600 -+#ifdef __LITTLE_ENDIAN
601 -+ fb_writew((bgx & 0xffff),(u16*)p); p += 2;
602 -+ fb_writeb((bgx >> 16),p++);
603 -+#else
604 -+ fb_writew((bgx >> 8),(u16*)p); p += 2;
605 -+ fb_writeb((bgx & 0xff),p++);
606 -+#endif
607 -+ }
608 -+ case 16:
609 -+ for (i=0; i < width/4; i++) {
610 -+ fb_writel(bgx,p); p += 4;
611 -+ fb_writel(bgx,p); p += 4;
612 -+ }
613 -+ if (width & 2) {
614 -+ fb_writel(bgx,p); p += 4;
615 -+ }
616 -+ if (width & 1)
617 -+ fb_writew(bgx,(u16*)p);
618 -+ break;
619 -+ case 8:
620 -+ for (i=0; i < width/4; i++) {
621 -+ fb_writel(bgx,p); p += 4;
622 -+ }
623 -+
624 -+ if (width & 2) {
625 -+ fb_writew(bgx,p); p += 2;
626 -+ }
627 -+ if (width & 1)
628 -+ fb_writeb(bgx,(u8*)p);
629 -+ break;
630 -+
631 -+ }
632 -+ dst += dstbytes;
633 -+ }
634 -+}
635 -+
636 -+void fbcon_decor_copy(u8 *dst, u8 *src, int height, int width, int linebytes,
637 -+ int srclinebytes, int bpp)
638 -+{
639 -+ int i;
640 -+
641 -+ while (height-- > 0) {
642 -+ u32 *p = (u32 *)dst;
643 -+ u32 *q = (u32 *)src;
644 -+
645 -+ switch (bpp) {
646 -+
647 -+ case 32:
648 -+ for (i=0; i < width; i++)
649 -+ fb_writel(*q++, p++);
650 -+ break;
651 -+ case 24:
652 -+ for (i=0; i < (width*3/4); i++)
653 -+ fb_writel(*q++, p++);
654 -+ if ((width*3) % 4) {
655 -+ if (width & 2) {
656 -+ fb_writeb(*(u8*)q, (u8*)p);
657 -+ } else if (width & 1) {
658 -+ fb_writew(*(u16*)q, (u16*)p);
659 -+ fb_writeb(*(u8*)((u16*)q+1),(u8*)((u16*)p+2));
660 -+ }
661 -+ }
662 -+ break;
663 -+ case 16:
664 -+ for (i=0; i < width/4; i++) {
665 -+ fb_writel(*q++, p++);
666 -+ fb_writel(*q++, p++);
667 -+ }
668 -+ if (width & 2)
669 -+ fb_writel(*q++, p++);
670 -+ if (width & 1)
671 -+ fb_writew(*(u16*)q, (u16*)p);
672 -+ break;
673 -+ case 8:
674 -+ for (i=0; i < width/4; i++)
675 -+ fb_writel(*q++, p++);
676 -+
677 -+ if (width & 2) {
678 -+ fb_writew(*(u16*)q, (u16*)p);
679 -+ q = (u32*) ((u16*)q + 1);
680 -+ p = (u32*) ((u16*)p + 1);
681 -+ }
682 -+ if (width & 1)
683 -+ fb_writeb(*(u8*)q, (u8*)p);
684 -+ break;
685 -+ }
686 -+
687 -+ dst += linebytes;
688 -+ src += srclinebytes;
689 -+ }
690 -+}
691 -+
692 -+static void decorfill(struct fb_info *info, int sy, int sx, int height,
693 -+ int width)
694 -+{
695 -+ int bytespp = ((info->var.bits_per_pixel + 7) >> 3);
696 -+ int d = sy * info->fix.line_length + sx * bytespp;
697 -+ int ds = (sy * info->var.xres + sx) * bytespp;
698 -+
699 -+ fbcon_decor_copy((u8 *)(info->screen_base + d), (u8 *)(info->bgdecor.data + ds),
700 -+ height, width, info->fix.line_length, info->var.xres * bytespp,
701 -+ info->var.bits_per_pixel);
702 -+}
703 -+
704 -+void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx,
705 -+ int height, int width)
706 -+{
707 -+ int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
708 -+ struct fbcon_ops *ops = info->fbcon_par;
709 -+ u8 *dst;
710 -+ int transparent, bg_color = attr_bgcol_ec(bgshift, vc, info);
711 -+
712 -+ transparent = (vc->vc_decor.bg_color == bg_color);
713 -+ sy = sy * vc->vc_font.height + vc->vc_decor.ty;
714 -+ sx = sx * vc->vc_font.width + vc->vc_decor.tx;
715 -+ height *= vc->vc_font.height;
716 -+ width *= vc->vc_font.width;
717 -+
718 -+ /* Don't paint the background image if console is blanked */
719 -+ if (transparent && !ops->blank_state) {
720 -+ decorfill(info, sy, sx, height, width);
721 -+ } else {
722 -+ dst = (u8 *)(info->screen_base + sy * info->fix.line_length +
723 -+ sx * ((info->var.bits_per_pixel + 7) >> 3));
724 -+ decorset(dst, height, width, info->fix.line_length, cc2cx(bg_color),
725 -+ info->var.bits_per_pixel);
726 -+ }
727 -+}
728 -+
729 -+void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info,
730 -+ int bottom_only)
731 -+{
732 -+ unsigned int tw = vc->vc_cols*vc->vc_font.width;
733 -+ unsigned int th = vc->vc_rows*vc->vc_font.height;
734 -+
735 -+ if (!bottom_only) {
736 -+ /* top margin */
737 -+ decorfill(info, 0, 0, vc->vc_decor.ty, info->var.xres);
738 -+ /* left margin */
739 -+ decorfill(info, vc->vc_decor.ty, 0, th, vc->vc_decor.tx);
740 -+ /* right margin */
741 -+ decorfill(info, vc->vc_decor.ty, vc->vc_decor.tx + tw, th,
742 -+ info->var.xres - vc->vc_decor.tx - tw);
743 -+ }
744 -+ decorfill(info, vc->vc_decor.ty + th, 0,
745 -+ info->var.yres - vc->vc_decor.ty - th, info->var.xres);
746 -+}
747 -+
748 -+void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y,
749 -+ int sx, int dx, int width)
750 -+{
751 -+ u16 *d = (u16 *) (vc->vc_origin + vc->vc_size_row * y + dx * 2);
752 -+ u16 *s = d + (dx - sx);
753 -+ u16 *start = d;
754 -+ u16 *ls = d;
755 -+ u16 *le = d + width;
756 -+ u16 c;
757 -+ int x = dx;
758 -+ u16 attr = 1;
759 -+
760 -+ do {
761 -+ c = scr_readw(d);
762 -+ if (attr != (c & 0xff00)) {
763 -+ attr = c & 0xff00;
764 -+ if (d > start) {
765 -+ fbcon_decor_putcs(vc, info, start, d - start, y, x);
766 -+ x += d - start;
767 -+ start = d;
768 -+ }
769 -+ }
770 -+ if (s >= ls && s < le && c == scr_readw(s)) {
771 -+ if (d > start) {
772 -+ fbcon_decor_putcs(vc, info, start, d - start, y, x);
773 -+ x += d - start + 1;
774 -+ start = d + 1;
775 -+ } else {
776 -+ x++;
777 -+ start++;
778 -+ }
779 -+ }
780 -+ s++;
781 -+ d++;
782 -+ } while (d < le);
783 -+ if (d > start)
784 -+ fbcon_decor_putcs(vc, info, start, d - start, y, x);
785 -+}
786 -+
787 -+void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank)
788 -+{
789 -+ if (blank) {
790 -+ decorset((u8 *)info->screen_base, info->var.yres, info->var.xres,
791 -+ info->fix.line_length, 0, info->var.bits_per_pixel);
792 -+ } else {
793 -+ update_screen(vc);
794 -+ fbcon_decor_clear_margins(vc, info, 0);
795 -+ }
796 -+}
797 -+
798 -diff -Naurp -x .git /tmp/linux/drivers/video/console/fbcon.c ./drivers/video/console/fbcon.c
799 ---- /tmp/linux/drivers/video/console/fbcon.c 2008-03-25 07:24:16.000000000 +0100
800 -+++ ./drivers/video/console/fbcon.c 2008-03-25 23:04:10.000000000 +0100
801 -@@ -90,6 +90,7 @@
802 - #endif
803 -
804 - #include "fbcon.h"
805 -+#include "fbcondecor.h"
806 -
807 - #ifdef FBCONDEBUG
808 - # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
809 -@@ -105,7 +106,7 @@ enum {
810 -
811 - static struct display fb_display[MAX_NR_CONSOLES];
812 -
813 --static signed char con2fb_map[MAX_NR_CONSOLES];
814 -+signed char con2fb_map[MAX_NR_CONSOLES];
815 - static signed char con2fb_map_boot[MAX_NR_CONSOLES];
816 - #ifndef MODULE
817 - static int logo_height;
818 -@@ -315,7 +316,7 @@ static inline int fbcon_is_inactive(stru
819 - vc->vc_mode != KD_TEXT || ops->graphics);
820 - }
821 -
822 --static inline int get_color(struct vc_data *vc, struct fb_info *info,
823 -+inline int get_color(struct vc_data *vc, struct fb_info *info,
824 - u16 c, int is_fg)
825 - {
826 - int depth = fb_get_color_depth(&info->var, &info->fix);
827 -@@ -420,6 +421,7 @@ static void fb_flashcursor(struct work_s
828 - CM_ERASE : CM_DRAW;
829 - ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1),
830 - get_color(vc, info, c, 0));
831 -+
832 - release_console_sem();
833 - }
834 -
835 -@@ -590,6 +592,8 @@ static int fbcon_takeover(int show_logo)
836 - info_idx = -1;
837 - }
838 -
839 -+ fbcon_decor_init();
840 -+
841 - return err;
842 - }
843 -
844 -@@ -1031,6 +1035,12 @@ static const char *fbcon_startup(void)
845 - rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
846 - cols /= vc->vc_font.width;
847 - rows /= vc->vc_font.height;
848 -+
849 -+ if (fbcon_decor_active(info, vc)) {
850 -+ cols = vc->vc_decor.twidth / vc->vc_font.width;
851 -+ rows = vc->vc_decor.theight / vc->vc_font.height;
852 -+ }
853 -+
854 - vc_resize(vc, cols, rows);
855 -
856 - DPRINTK("mode: %s\n", info->fix.id);
857 -@@ -1114,7 +1124,7 @@ static void fbcon_init(struct vc_data *v
858 - cap = info->flags;
859 -
860 - if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
861 -- (info->fix.type == FB_TYPE_TEXT))
862 -+ (info->fix.type == FB_TYPE_TEXT) || fbcon_decor_active(info, vc))
863 - logo = 0;
864 -
865 - if (var_to_display(p, &info->var, info))
866 -@@ -1313,6 +1323,11 @@ static void fbcon_clear(struct vc_data *
867 - if (!height || !width)
868 - return;
869 -
870 -+ if (fbcon_decor_active(info, vc)) {
871 -+ fbcon_decor_clear(vc, info, sy, sx, height, width);
872 -+ return;
873 -+ }
874 -+
875 - /* Split blits that cross physical y_wrap boundary */
876 -
877 - y_break = p->vrows - p->yscroll;
878 -@@ -1332,10 +1347,15 @@ static void fbcon_putcs(struct vc_data *
879 - struct display *p = &fb_display[vc->vc_num];
880 - struct fbcon_ops *ops = info->fbcon_par;
881 -
882 -- if (!fbcon_is_inactive(vc, info))
883 -- ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
884 -- get_color(vc, info, scr_readw(s), 1),
885 -- get_color(vc, info, scr_readw(s), 0));
886 -+ if (!fbcon_is_inactive(vc, info)) {
887 -+
888 -+ if (fbcon_decor_active(info, vc))
889 -+ fbcon_decor_putcs(vc, info, s, count, ypos, xpos);
890 -+ else
891 -+ ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
892 -+ get_color(vc, info, scr_readw(s), 1),
893 -+ get_color(vc, info, scr_readw(s), 0));
894 -+ }
895 - }
896 -
897 - static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos)
898 -@@ -1351,8 +1371,13 @@ static void fbcon_clear_margins(struct v
899 - struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
900 - struct fbcon_ops *ops = info->fbcon_par;
901 -
902 -- if (!fbcon_is_inactive(vc, info))
903 -- ops->clear_margins(vc, info, bottom_only);
904 -+ if (!fbcon_is_inactive(vc, info)) {
905 -+ if (fbcon_decor_active(info, vc)) {
906 -+ fbcon_decor_clear_margins(vc, info, bottom_only);
907 -+ } else {
908 -+ ops->clear_margins(vc, info, bottom_only);
909 -+ }
910 -+ }
911 - }
912 -
913 - static void fbcon_cursor(struct vc_data *vc, int mode)
914 -@@ -1872,7 +1897,7 @@ static int fbcon_scroll(struct vc_data *
915 - count = vc->vc_rows;
916 - if (softback_top)
917 - fbcon_softback_note(vc, t, count);
918 -- if (logo_shown >= 0)
919 -+ if (logo_shown >= 0 || fbcon_decor_active(info, vc))
920 - goto redraw_up;
921 - switch (p->scrollmode) {
922 - case SCROLL_MOVE:
923 -@@ -1965,6 +1990,8 @@ static int fbcon_scroll(struct vc_data *
924 - count = vc->vc_rows;
925 - if (logo_shown >= 0)
926 - goto redraw_down;
927 -+ if (fbcon_decor_active(info, vc))
928 -+ goto redraw_down;
929 - switch (p->scrollmode) {
930 - case SCROLL_MOVE:
931 - fbcon_redraw_blit(vc, info, p, b - 1, b - t - count,
932 -@@ -2113,6 +2140,13 @@ static void fbcon_bmove_rec(struct vc_da
933 - }
934 - return;
935 - }
936 -+
937 -+ if (fbcon_decor_active(info, vc) && sy == dy && height == 1) {
938 -+ /* must use slower redraw bmove to keep background pic intact */
939 -+ fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width);
940 -+ return;
941 -+ }
942 -+
943 - ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx,
944 - height, width);
945 - }
946 -@@ -2183,8 +2217,8 @@ static int fbcon_resize(struct vc_data *
947 - var.yres = virt_h * virt_fh;
948 - x_diff = info->var.xres - var.xres;
949 - y_diff = info->var.yres - var.yres;
950 -- if (x_diff < 0 || x_diff > virt_fw ||
951 -- y_diff < 0 || y_diff > virt_fh) {
952 -+ if ((x_diff < 0 || x_diff > virt_fw ||
953 -+ y_diff < 0 || y_diff > virt_fh) && !vc->vc_decor.state) {
954 - const struct fb_videomode *mode;
955 -
956 - DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
957 -@@ -2220,6 +2254,19 @@ static int fbcon_switch(struct vc_data *
958 -
959 - info = registered_fb[con2fb_map[vc->vc_num]];
960 - ops = info->fbcon_par;
961 -+ prev_console = ops->currcon;
962 -+ if (prev_console != -1)
963 -+ old_info = registered_fb[con2fb_map[prev_console]];
964 -+
965 -+ if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
966 -+ struct vc_data *vc_curr = vc_cons[prev_console].d;
967 -+ if (vc_curr && fbcon_decor_active_vc(vc_curr)) {
968 -+ /* Clear the screen to avoid displaying funky colors during
969 -+ * palette updates. */
970 -+ memset((u8*)info->screen_base + info->fix.line_length * info->var.yoffset,
971 -+ 0, info->var.yres * info->fix.line_length);
972 -+ }
973 -+ }
974 -
975 - if (softback_top) {
976 - if (softback_lines)
977 -@@ -2238,9 +2285,6 @@ static int fbcon_switch(struct vc_data *
978 - logo_shown = FBCON_LOGO_CANSHOW;
979 - }
980 -
981 -- prev_console = ops->currcon;
982 -- if (prev_console != -1)
983 -- old_info = registered_fb[con2fb_map[prev_console]];
984 - /*
985 - * FIXME: If we have multiple fbdev's loaded, we need to
986 - * update all info->currcon. Perhaps, we can place this
987 -@@ -2280,6 +2324,18 @@ static int fbcon_switch(struct vc_data *
988 - fbcon_del_cursor_timer(old_info);
989 - }
990 -
991 -+ if (fbcon_decor_active_vc(vc)) {
992 -+ struct vc_data *vc_curr = vc_cons[prev_console].d;
993 -+
994 -+ if (!vc_curr->vc_decor.theme ||
995 -+ strcmp(vc->vc_decor.theme, vc_curr->vc_decor.theme) ||
996 -+ (fbcon_decor_active_nores(info, vc_curr) &&
997 -+ !fbcon_decor_active(info, vc_curr))) {
998 -+ if (fbcon_decor_call_helper("modechange", vc->vc_num))
999 -+ fbcon_decor_disable(vc, 0);
1000 -+ }
1001 -+ }
1002 -+
1003 - if (fbcon_is_inactive(vc, info) ||
1004 - ops->blank_state != FB_BLANK_UNBLANK)
1005 - fbcon_del_cursor_timer(info);
1006 -@@ -2546,13 +2606,22 @@ static int fbcon_do_set_font(struct vc_d
1007 - }
1008 -
1009 - if (resize) {
1010 -+ /* reset wrap/pan */
1011 - int cols, rows;
1012 -
1013 - cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres);
1014 - rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
1015 -+
1016 -+ info->var.xoffset = info->var.yoffset = p->yscroll = 0;
1017 -+ if (fbcon_decor_active(info, vc)) {
1018 -+ cols = vc->vc_decor.twidth;
1019 -+ rows = vc->vc_decor.theight;
1020 -+ }
1021 - cols /= w;
1022 - rows /= h;
1023 -+
1024 - vc_resize(vc, cols, rows);
1025 -+
1026 - if (CON_IS_VISIBLE(vc) && softback_buf)
1027 - fbcon_update_softback(vc);
1028 - } else if (CON_IS_VISIBLE(vc)
1029 -@@ -2681,7 +2750,7 @@ static int fbcon_set_palette(struct vc_d
1030 - int i, j, k, depth;
1031 - u8 val;
1032 -
1033 -- if (fbcon_is_inactive(vc, info))
1034 -+ if (fbcon_is_inactive(vc, info) || vc->vc_num != fg_console)
1035 - return -EINVAL;
1036 -
1037 - if (!CON_IS_VISIBLE(vc))
1038 -@@ -2707,7 +2776,49 @@ static int fbcon_set_palette(struct vc_d
1039 - } else
1040 - fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap);
1041 -
1042 -- return fb_set_cmap(&palette_cmap, info);
1043 -+ if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
1044 -+ info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
1045 -+
1046 -+ u16 *red, *green, *blue;
1047 -+ int minlen = min(min(info->var.red.length, info->var.green.length),
1048 -+ info->var.blue.length);
1049 -+ int h;
1050 -+
1051 -+ struct fb_cmap cmap = {
1052 -+ .start = 0,
1053 -+ .len = (1 << minlen),
1054 -+ .red = NULL,
1055 -+ .green = NULL,
1056 -+ .blue = NULL,
1057 -+ .transp = NULL
1058 -+ };
1059 -+
1060 -+ red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL);
1061 -+
1062 -+ if (!red)
1063 -+ goto out;
1064 -+
1065 -+ green = red + 256;
1066 -+ blue = green + 256;
1067 -+ cmap.red = red;
1068 -+ cmap.green = green;
1069 -+ cmap.blue = blue;
1070 -+
1071 -+ for (i = 0; i < cmap.len; i++) {
1072 -+ red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1);
1073 -+ }
1074 -+
1075 -+ h = fb_set_cmap(&cmap, info);
1076 -+ fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d);
1077 -+ kfree(red);
1078 -+
1079 -+ return h;
1080 -+
1081 -+ } else if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
1082 -+ info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL)
1083 -+ fb_set_cmap(&info->bgdecor.cmap, info);
1084 -+
1085 -+out: return fb_set_cmap(&palette_cmap, info);
1086 - }
1087 -
1088 - static u16 *fbcon_screen_pos(struct vc_data *vc, int offset)
1089 -@@ -2933,7 +3044,14 @@ static void fbcon_modechanged(struct fb_
1090 - rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
1091 - cols /= vc->vc_font.width;
1092 - rows /= vc->vc_font.height;
1093 -- vc_resize(vc, cols, rows);
1094 -+
1095 -+ if (!fbcon_decor_active_nores(info, vc)) {
1096 -+ vc_resize(vc, cols, rows);
1097 -+ } else {
1098 -+ if (fbcon_decor_call_helper("modechange", vc->vc_num))
1099 -+ fbcon_decor_disable(vc, 0);
1100 -+ }
1101 -+
1102 - updatescrollmode(p, info, vc);
1103 - scrollback_max = 0;
1104 - scrollback_current = 0;
1105 -@@ -3561,6 +3679,7 @@ static void fbcon_exit(void)
1106 - }
1107 - }
1108 -
1109 -+ fbcon_decor_exit();
1110 - fbcon_has_exited = 1;
1111 - }
1112 -
1113 -diff -Naurp -x .git /tmp/linux/drivers/video/console/fbcondecor.c ./drivers/video/console/fbcondecor.c
1114 ---- /tmp/linux/drivers/video/console/fbcondecor.c 1970-01-01 01:00:00.000000000 +0100
1115 -+++ ./drivers/video/console/fbcondecor.c 2008-03-25 23:04:10.000000000 +0100
1116 -@@ -0,0 +1,420 @@
1117 -+/*
1118 -+ * linux/drivers/video/console/fbcondecor.c -- Framebuffer console decorations
1119 -+ *
1120 -+ * Copyright (C) 2004 Michal Januszewski <spock@g.o>
1121 -+ *
1122 -+ * Code based upon "Bootsplash" (C) 2001-2003
1123 -+ * Volker Poplawski <volker@×××××××××.de>,
1124 -+ * Stefan Reinauer <stepan@××××.de>,
1125 -+ * Steffen Winterfeldt <snwint@××××.de>,
1126 -+ * Michael Schroeder <mls@××××.de>,
1127 -+ * Ken Wimer <wimer@××××.de>.
1128 -+ *
1129 -+ * This file is subject to the terms and conditions of the GNU General Public
1130 -+ * License. See the file COPYING in the main directory of this archive for
1131 -+ * more details.
1132 -+ *
1133 -+ */
1134 -+#include <linux/module.h>
1135 -+#include <linux/kernel.h>
1136 -+#include <linux/string.h>
1137 -+#include <linux/types.h>
1138 -+#include <linux/fb.h>
1139 -+#include <linux/vt_kern.h>
1140 -+#include <linux/vmalloc.h>
1141 -+#include <linux/unistd.h>
1142 -+#include <linux/syscalls.h>
1143 -+#include <linux/init.h>
1144 -+#include <linux/proc_fs.h>
1145 -+#include <linux/workqueue.h>
1146 -+#include <linux/kmod.h>
1147 -+#include <linux/miscdevice.h>
1148 -+#include <linux/device.h>
1149 -+#include <linux/fs.h>
1150 -+
1151 -+#include <asm/uaccess.h>
1152 -+#include <asm/irq.h>
1153 -+#include <asm/system.h>
1154 -+
1155 -+#include "fbcon.h"
1156 -+#include "fbcondecor.h"
1157 -+
1158 -+extern signed char con2fb_map[];
1159 -+static int fbcon_decor_enable(struct vc_data *vc);
1160 -+char fbcon_decor_path[KMOD_PATH_LEN] = "/sbin/fbcondecor_helper";
1161 -+static int initialized = 0;
1162 -+
1163 -+int fbcon_decor_call_helper(char* cmd, unsigned short vc)
1164 -+{
1165 -+ char *envp[] = {
1166 -+ "HOME=/",
1167 -+ "PATH=/sbin:/bin",
1168 -+ NULL
1169 -+ };
1170 -+
1171 -+ char tfb[5];
1172 -+ char tcons[5];
1173 -+ unsigned char fb = (int) con2fb_map[vc];
1174 -+
1175 -+ char *argv[] = {
1176 -+ fbcon_decor_path,
1177 -+ "2",
1178 -+ cmd,
1179 -+ tcons,
1180 -+ tfb,
1181 -+ vc_cons[vc].d->vc_decor.theme,
1182 -+ NULL
1183 -+ };
1184 -+
1185 -+ snprintf(tfb,5,"%d",fb);
1186 -+ snprintf(tcons,5,"%d",vc);
1187 -+
1188 -+ return call_usermodehelper(fbcon_decor_path, argv, envp, 1);
1189 -+}
1190 -+
1191 -+/* Disables fbcondecor on a virtual console; called with console sem held. */
1192 -+int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw)
1193 -+{
1194 -+ struct fb_info* info;
1195 -+
1196 -+ if (!vc->vc_decor.state)
1197 -+ return -EINVAL;
1198 -+
1199 -+ info = registered_fb[(int) con2fb_map[vc->vc_num]];
1200 -+
1201 -+ if (info == NULL)
1202 -+ return -EINVAL;
1203 -+
1204 -+ vc->vc_decor.state = 0;
1205 -+ vc_resize(vc, info->var.xres / vc->vc_font.width,
1206 -+ info->var.yres / vc->vc_font.height);
1207 -+
1208 -+ if (fg_console == vc->vc_num && redraw) {
1209 -+ redraw_screen(vc, 0);
1210 -+ update_region(vc, vc->vc_origin +
1211 -+ vc->vc_size_row * vc->vc_top,
1212 -+ vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
1213 -+ }
1214 -+
1215 -+ printk(KERN_INFO "fbcondecor: switched decor state to 'off' on console %d\n",
1216 -+ vc->vc_num);
1217 -+
1218 -+ return 0;
1219 -+}
1220 -+
1221 -+/* Enables fbcondecor on a virtual console; called with console sem held. */
1222 -+static int fbcon_decor_enable(struct vc_data *vc)
1223 -+{
1224 -+ struct fb_info* info;
1225 -+
1226 -+ info = registered_fb[(int) con2fb_map[vc->vc_num]];
1227 -+
1228 -+ if (vc->vc_decor.twidth == 0 || vc->vc_decor.theight == 0 ||
1229 -+ info == NULL || vc->vc_decor.state || (!info->bgdecor.data &&
1230 -+ vc->vc_num == fg_console))
1231 -+ return -EINVAL;
1232 -+
1233 -+ vc->vc_decor.state = 1;
1234 -+ vc_resize(vc, vc->vc_decor.twidth / vc->vc_font.width,
1235 -+ vc->vc_decor.theight / vc->vc_font.height);
1236 -+
1237 -+ if (fg_console == vc->vc_num) {
1238 -+ redraw_screen(vc, 0);
1239 -+ update_region(vc, vc->vc_origin +
1240 -+ vc->vc_size_row * vc->vc_top,
1241 -+ vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
1242 -+ fbcon_decor_clear_margins(vc, info, 0);
1243 -+ }
1244 -+
1245 -+ printk(KERN_INFO "fbcondecor: switched decor state to 'on' on console %d\n",
1246 -+ vc->vc_num);
1247 -+
1248 -+ return 0;
1249 -+}
1250 -+
1251 -+static inline int fbcon_decor_ioctl_dosetstate(struct vc_data *vc, unsigned int __user* state, unsigned char origin)
1252 -+{
1253 -+ int tmp, ret;
1254 -+
1255 -+ if (get_user(tmp, state))
1256 -+ return -EFAULT;
1257 -+
1258 -+ if (origin == FBCON_DECOR_IO_ORIG_USER)
1259 -+ acquire_console_sem();
1260 -+ if (!tmp)
1261 -+ ret = fbcon_decor_disable(vc, 1);
1262 -+ else
1263 -+ ret = fbcon_decor_enable(vc);
1264 -+ if (origin == FBCON_DECOR_IO_ORIG_USER)
1265 -+ release_console_sem();
1266 -+
1267 -+ return ret;
1268 -+}
1269 -+
1270 -+static inline int fbcon_decor_ioctl_dogetstate(struct vc_data *vc, unsigned int __user *state)
1271 -+{
1272 -+ return put_user(vc->vc_decor.state, (unsigned int __user*) state);
1273 -+}
1274 -+
1275 -+static int fbcon_decor_ioctl_dosetcfg(struct vc_data *vc, struct vc_decor __user *arg, unsigned char origin)
1276 -+{
1277 -+ struct vc_decor cfg;
1278 -+ struct fb_info *info;
1279 -+ int len;
1280 -+ char *tmp;
1281 -+
1282 -+ info = registered_fb[(int) con2fb_map[vc->vc_num]];
1283 -+
1284 -+ if (copy_from_user(&cfg, arg, sizeof(struct vc_decor)))
1285 -+ return -EFAULT;
1286 -+ if (info == NULL || !cfg.twidth || !cfg.theight ||
1287 -+ cfg.tx + cfg.twidth > info->var.xres ||
1288 -+ cfg.ty + cfg.theight > info->var.yres)
1289 -+ return -EINVAL;
1290 -+
1291 -+ len = strlen_user(cfg.theme);
1292 -+ if (!len || len > FBCON_DECOR_THEME_LEN)
1293 -+ return -EINVAL;
1294 -+ tmp = kmalloc(len, GFP_KERNEL);
1295 -+ if (!tmp)
1296 -+ return -ENOMEM;
1297 -+ if (copy_from_user(tmp, (void __user *)cfg.theme, len))
1298 -+ return -EFAULT;
1299 -+ cfg.theme = tmp;
1300 -+ cfg.state = 0;
1301 -+
1302 -+ /* If this ioctl is a response to a request from kernel, the console sem
1303 -+ * is already held; we also don't need to disable decor because either the
1304 -+ * new config and background picture will be successfully loaded, and the
1305 -+ * decor will stay on, or in case of a failure it'll be turned off in fbcon. */
1306 -+ if (origin == FBCON_DECOR_IO_ORIG_USER) {
1307 -+ acquire_console_sem();
1308 -+ if (vc->vc_decor.state)
1309 -+ fbcon_decor_disable(vc, 1);
1310 -+ }
1311 -+
1312 -+ if (vc->vc_decor.theme)
1313 -+ kfree(vc->vc_decor.theme);
1314 -+
1315 -+ vc->vc_decor = cfg;
1316 -+
1317 -+ if (origin == FBCON_DECOR_IO_ORIG_USER)
1318 -+ release_console_sem();
1319 -+
1320 -+ printk(KERN_INFO "fbcondecor: console %d using theme '%s'\n",
1321 -+ vc->vc_num, vc->vc_decor.theme);
1322 -+ return 0;
1323 -+}
1324 -+
1325 -+static int fbcon_decor_ioctl_dogetcfg(struct vc_data *vc, struct vc_decor __user *arg)
1326 -+{
1327 -+ struct vc_decor decor;
1328 -+ char __user *tmp;
1329 -+
1330 -+ if (get_user(tmp, &arg->theme))
1331 -+ return -EFAULT;
1332 -+
1333 -+ decor = vc->vc_decor;
1334 -+ decor.theme = tmp;
1335 -+
1336 -+ if (vc->vc_decor.theme) {
1337 -+ if (copy_to_user(tmp, vc->vc_decor.theme, strlen(vc->vc_decor.theme) + 1))
1338 -+ return -EFAULT;
1339 -+ } else
1340 -+ if (put_user(0, tmp))
1341 -+ return -EFAULT;
1342 -+
1343 -+ if (copy_to_user(arg, &decor, sizeof(struct vc_decor)))
1344 -+ return -EFAULT;
1345 -+
1346 -+ return 0;
1347 -+}
1348 -+
1349 -+static int fbcon_decor_ioctl_dosetpic(struct vc_data *vc, struct fb_image __user *arg, unsigned char origin)
1350 -+{
1351 -+ struct fb_image img;
1352 -+ struct fb_info *info;
1353 -+ int len;
1354 -+ u8 *tmp;
1355 -+
1356 -+ if (vc->vc_num != fg_console)
1357 -+ return -EINVAL;
1358 -+
1359 -+ info = registered_fb[(int) con2fb_map[vc->vc_num]];
1360 -+
1361 -+ if (info == NULL)
1362 -+ return -EINVAL;
1363 -+
1364 -+ if (copy_from_user(&img, arg, sizeof(struct fb_image)))
1365 -+ return -EFAULT;
1366 -+
1367 -+ if (img.width != info->var.xres || img.height != info->var.yres) {
1368 -+ printk(KERN_ERR "fbcondecor: picture dimensions mismatch\n");
1369 -+ return -EINVAL;
1370 -+ }
1371 -+
1372 -+ if (img.depth != info->var.bits_per_pixel) {
1373 -+ printk(KERN_ERR "fbcondecor: picture depth mismatch\n");
1374 -+ return -EINVAL;
1375 -+ }
1376 -+
1377 -+ if (img.depth == 8) {
1378 -+ if (!img.cmap.len || !img.cmap.red || !img.cmap.green ||
1379 -+ !img.cmap.blue)
1380 -+ return -EINVAL;
1381 -+
1382 -+ tmp = vmalloc(img.cmap.len * 3 * 2);
1383 -+ if (!tmp)
1384 -+ return -ENOMEM;
1385 -+
1386 -+ if (copy_from_user(tmp, (void __user*)img.cmap.red, img.cmap.len * 2) ||
1387 -+ copy_from_user(tmp + (img.cmap.len << 1),
1388 -+ (void __user*)img.cmap.green, (img.cmap.len << 1)) ||
1389 -+ copy_from_user(tmp + (img.cmap.len << 2),
1390 -+ (void __user*)img.cmap.blue, (img.cmap.len << 1))) {
1391 -+ vfree(tmp);
1392 -+ return -EFAULT;
1393 -+ }
1394 -+
1395 -+ img.cmap.transp = NULL;
1396 -+ img.cmap.red = (u16*)tmp;
1397 -+ img.cmap.green = img.cmap.red + img.cmap.len;
1398 -+ img.cmap.blue = img.cmap.green + img.cmap.len;
1399 -+ } else {
1400 -+ img.cmap.red = NULL;
1401 -+ }
1402 -+
1403 -+ len = ((img.depth + 7) >> 3) * img.width * img.height;
1404 -+ tmp = vmalloc(len);
1405 -+
1406 -+ if (!tmp)
1407 -+ goto out;
1408 -+
1409 -+ if (copy_from_user(tmp, (void __user*)img.data, len))
1410 -+ goto out;
1411 -+
1412 -+ img.data = tmp;
1413 -+
1414 -+ /* If this ioctl is a response to a request from kernel, the console sem
1415 -+ * is already held. */
1416 -+ if (origin == FBCON_DECOR_IO_ORIG_USER)
1417 -+ acquire_console_sem();
1418 -+
1419 -+ if (info->bgdecor.data)
1420 -+ vfree((u8*)info->bgdecor.data);
1421 -+ if (info->bgdecor.cmap.red)
1422 -+ vfree(info->bgdecor.cmap.red);
1423 -+
1424 -+ info->bgdecor = img;
1425 -+
1426 -+ if (origin == FBCON_DECOR_IO_ORIG_USER)
1427 -+ release_console_sem();
1428 -+
1429 -+ return 0;
1430 -+
1431 -+out: if (img.cmap.red)
1432 -+ vfree(img.cmap.red);
1433 -+ if (tmp)
1434 -+ vfree(tmp);
1435 -+ return -ENOMEM;
1436 -+}
1437 -+
1438 -+static int fbcon_decor_ioctl(struct inode * inode, struct file *filp, u_int cmd,
1439 -+ u_long arg)
1440 -+{
1441 -+ struct fbcon_decor_iowrapper __user *wrapper = (void __user*) arg;
1442 -+ struct vc_data *vc = NULL;
1443 -+ unsigned short vc_num = 0;
1444 -+ unsigned char origin = 0;
1445 -+ void __user *data = NULL;
1446 -+
1447 -+ if (!access_ok(VERIFY_READ, wrapper,
1448 -+ sizeof(struct fbcon_decor_iowrapper)))
1449 -+ return -EFAULT;
1450 -+
1451 -+ __get_user(vc_num, &wrapper->vc);
1452 -+ __get_user(origin, &wrapper->origin);
1453 -+ __get_user(data, &wrapper->data);
1454 -+
1455 -+ if (!vc_cons_allocated(vc_num))
1456 -+ return -EINVAL;
1457 -+
1458 -+ vc = vc_cons[vc_num].d;
1459 -+
1460 -+ switch (cmd) {
1461 -+ case FBIOCONDECOR_SETPIC:
1462 -+ return fbcon_decor_ioctl_dosetpic(vc, (struct fb_image __user*)data, origin);
1463 -+ case FBIOCONDECOR_SETCFG:
1464 -+ return fbcon_decor_ioctl_dosetcfg(vc, (struct vc_decor*)data, origin);
1465 -+ case FBIOCONDECOR_GETCFG:
1466 -+ return fbcon_decor_ioctl_dogetcfg(vc, (struct vc_decor*)data);
1467 -+ case FBIOCONDECOR_SETSTATE:
1468 -+ return fbcon_decor_ioctl_dosetstate(vc, (unsigned int *)data, origin);
1469 -+ case FBIOCONDECOR_GETSTATE:
1470 -+ return fbcon_decor_ioctl_dogetstate(vc, (unsigned int *)data);
1471 -+ default:
1472 -+ return -ENOIOCTLCMD;
1473 -+ }
1474 -+}
1475 -+
1476 -+static struct file_operations fbcon_decor_ops = {
1477 -+ .owner = THIS_MODULE,
1478 -+ .ioctl = fbcon_decor_ioctl
1479 -+};
1480 -+
1481 -+static struct miscdevice fbcon_decor_dev = {
1482 -+ .minor = MISC_DYNAMIC_MINOR,
1483 -+ .name = "fbcondecor",
1484 -+ .fops = &fbcon_decor_ops
1485 -+};
1486 -+
1487 -+void fbcon_decor_reset(void)
1488 -+{
1489 -+ struct fb_info *info;
1490 -+ struct vc_data *vc;
1491 -+ int i;
1492 -+
1493 -+ vc = vc_cons[0].d;
1494 -+ info = registered_fb[0];
1495 -+
1496 -+ for (i = 0; i < num_registered_fb; i++) {
1497 -+ registered_fb[i]->bgdecor.data = NULL;
1498 -+ registered_fb[i]->bgdecor.cmap.red = NULL;
1499 -+ }
1500 -+
1501 -+ for (i = 0; i < MAX_NR_CONSOLES && vc_cons[i].d; i++) {
1502 -+ vc_cons[i].d->vc_decor.state = vc_cons[i].d->vc_decor.twidth =
1503 -+ vc_cons[i].d->vc_decor.theight = 0;
1504 -+ vc_cons[i].d->vc_decor.theme = NULL;
1505 -+ }
1506 -+
1507 -+ return;
1508 -+}
1509 -+
1510 -+int fbcon_decor_init(void)
1511 -+{
1512 -+ int i;
1513 -+
1514 -+ fbcon_decor_reset();
1515 -+
1516 -+ if (initialized)
1517 -+ return 0;
1518 -+
1519 -+ i = misc_register(&fbcon_decor_dev);
1520 -+ if (i) {
1521 -+ printk(KERN_ERR "fbcondecor: failed to register device\n");
1522 -+ return i;
1523 -+ }
1524 -+
1525 -+ fbcon_decor_call_helper("init", 0);
1526 -+ initialized = 1;
1527 -+ return 0;
1528 -+}
1529 -+
1530 -+int fbcon_decor_exit(void)
1531 -+{
1532 -+ fbcon_decor_reset();
1533 -+ return 0;
1534 -+}
1535 -+
1536 -+EXPORT_SYMBOL(fbcon_decor_path);
1537 -diff -Naurp -x .git /tmp/linux/drivers/video/console/fbcondecor.h ./drivers/video/console/fbcondecor.h
1538 ---- /tmp/linux/drivers/video/console/fbcondecor.h 1970-01-01 01:00:00.000000000 +0100
1539 -+++ ./drivers/video/console/fbcondecor.h 2008-03-25 23:04:10.000000000 +0100
1540 -@@ -0,0 +1,78 @@
1541 -+/*
1542 -+ * linux/drivers/video/console/fbcondecor.h -- Framebuffer Console Decoration headers
1543 -+ *
1544 -+ * Copyright (C) 2004 Michal Januszewski <spock@g.o>
1545 -+ *
1546 -+ */
1547 -+
1548 -+#ifndef __FBCON_DECOR_H
1549 -+#define __FBCON_DECOR_H
1550 -+
1551 -+#ifndef _LINUX_FB_H
1552 -+#include <linux/fb.h>
1553 -+#endif
1554 -+
1555 -+/* This is needed for vc_cons in fbcmap.c */
1556 -+#include <linux/vt_kern.h>
1557 -+
1558 -+struct fb_cursor;
1559 -+struct fb_info;
1560 -+struct vc_data;
1561 -+
1562 -+#ifdef CONFIG_FB_CON_DECOR
1563 -+/* fbcondecor.c */
1564 -+int fbcon_decor_init(void);
1565 -+int fbcon_decor_exit(void);
1566 -+int fbcon_decor_call_helper(char* cmd, unsigned short cons);
1567 -+int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw);
1568 -+
1569 -+/* cfbcondecor.c */
1570 -+void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info, const unsigned short *s, int count, int yy, int xx);
1571 -+void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor);
1572 -+void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width);
1573 -+void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info, int bottom_only);
1574 -+void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank);
1575 -+void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y, int sx, int dx, int width);
1576 -+void fbcon_decor_copy(u8 *dst, u8 *src, int height, int width, int linebytes, int srclinesbytes, int bpp);
1577 -+void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc);
1578 -+
1579 -+/* vt.c */
1580 -+void acquire_console_sem(void);
1581 -+void release_console_sem(void);
1582 -+void do_unblank_screen(int entering_gfx);
1583 -+
1584 -+/* struct vc_data *y */
1585 -+#define fbcon_decor_active_vc(y) (y->vc_decor.state && y->vc_decor.theme)
1586 -+
1587 -+/* struct fb_info *x, struct vc_data *y */
1588 -+#define fbcon_decor_active_nores(x,y) (x->bgdecor.data && fbcon_decor_active_vc(y))
1589 -+
1590 -+/* struct fb_info *x, struct vc_data *y */
1591 -+#define fbcon_decor_active(x,y) (fbcon_decor_active_nores(x,y) && \
1592 -+ x->bgdecor.width == x->var.xres && \
1593 -+ x->bgdecor.height == x->var.yres && \
1594 -+ x->bgdecor.depth == x->var.bits_per_pixel)
1595 -+
1596 -+
1597 -+#else /* CONFIG_FB_CON_DECOR */
1598 -+
1599 -+static inline void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info, const unsigned short *s, int count, int yy, int xx) {}
1600 -+static inline void fbcon_decor_putc(struct vc_data *vc, struct fb_info *info, int c, int ypos, int xpos) {}
1601 -+static inline void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor) {}
1602 -+static inline void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width) {}
1603 -+static inline void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info, int bottom_only) {}
1604 -+static inline void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank) {}
1605 -+static inline void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y, int sx, int dx, int width) {}
1606 -+static inline void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc) {}
1607 -+static inline int fbcon_decor_call_helper(char* cmd, unsigned short cons) { return 0; }
1608 -+static inline int fbcon_decor_init(void) { return 0; }
1609 -+static inline int fbcon_decor_exit(void) { return 0; }
1610 -+static inline int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw) { return 0; }
1611 -+
1612 -+#define fbcon_decor_active_vc(y) (0)
1613 -+#define fbcon_decor_active_nores(x,y) (0)
1614 -+#define fbcon_decor_active(x,y) (0)
1615 -+
1616 -+#endif /* CONFIG_FB_CON_DECOR */
1617 -+
1618 -+#endif /* __FBCON_DECOR_H */
1619 -diff -Naurp -x .git /tmp/linux/drivers/video/console/Kconfig ./drivers/video/console/Kconfig
1620 ---- /tmp/linux/drivers/video/console/Kconfig 2008-03-25 07:24:16.000000000 +0100
1621 -+++ ./drivers/video/console/Kconfig 2008-03-25 23:04:10.000000000 +0100
1622 -@@ -144,6 +144,19 @@ config FRAMEBUFFER_CONSOLE_ROTATION
1623 - such that other users of the framebuffer will remain normally
1624 - oriented.
1625 -
1626 -+config FB_CON_DECOR
1627 -+ bool "Support for the Framebuffer Console Decorations"
1628 -+ depends on FRAMEBUFFER_CONSOLE=y && !FB_TILEBLITTING
1629 -+ default n
1630 -+ ---help---
1631 -+ This option enables support for framebuffer console decorations which
1632 -+ makes it possible to display images in the background of the system
1633 -+ consoles. Note that userspace utilities are necessary in order to take
1634 -+ advantage of these features. Refer to Documentation/fb/fbcondecor.txt
1635 -+ for more information.
1636 -+
1637 -+ If unsure, say N.
1638 -+
1639 - config STI_CONSOLE
1640 - bool "STI text console"
1641 - depends on PARISC
1642 -diff -Naurp -x .git /tmp/linux/drivers/video/console/Makefile ./drivers/video/console/Makefile
1643 ---- /tmp/linux/drivers/video/console/Makefile 2008-03-25 07:24:16.000000000 +0100
1644 -+++ ./drivers/video/console/Makefile 2008-03-25 23:04:10.000000000 +0100
1645 -@@ -35,6 +35,7 @@ obj-$(CONFIG_FRAMEBUFFER_CONSOLE) +=
1646 - fbcon_ccw.o
1647 - endif
1648 -
1649 -+obj-$(CONFIG_FB_CON_DECOR) += fbcondecor.o cfbcondecor.o
1650 - obj-$(CONFIG_FB_STI) += sticore.o font.o
1651 -
1652 - ifeq ($(CONFIG_USB_SISUSBVGA_CON),y)
1653 -diff -Naurp -x .git /tmp/linux/drivers/video/fbcmap.c ./drivers/video/fbcmap.c
1654 ---- /tmp/linux/drivers/video/fbcmap.c 2008-03-25 07:24:16.000000000 +0100
1655 -+++ ./drivers/video/fbcmap.c 2008-03-25 23:04:10.000000000 +0100
1656 -@@ -17,6 +17,8 @@
1657 - #include <linux/slab.h>
1658 - #include <linux/uaccess.h>
1659 -
1660 -+#include "console/fbcondecor.h"
1661 -+
1662 - static u16 red2[] __read_mostly = {
1663 - 0x0000, 0xaaaa
1664 - };
1665 -@@ -234,14 +236,17 @@ int fb_set_cmap(struct fb_cmap *cmap, st
1666 - if (transp)
1667 - htransp = *transp++;
1668 - if (info->fbops->fb_setcolreg(start++,
1669 -- hred, hgreen, hblue,
1670 -+ hred, hgreen, hblue,
1671 - htransp, info))
1672 - break;
1673 - }
1674 - }
1675 -- if (rc == 0)
1676 -+ if (rc == 0) {
1677 - fb_copy_cmap(cmap, &info->cmap);
1678 --
1679 -+ if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
1680 -+ info->fix.visual == FB_VISUAL_DIRECTCOLOR)
1681 -+ fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d);
1682 -+ }
1683 - return rc;
1684 - }
1685 -
1686 -diff -Naurp -x .git /tmp/linux/drivers/video/Kconfig ./drivers/video/Kconfig
1687 ---- /tmp/linux/drivers/video/Kconfig 2008-03-25 07:24:16.000000000 +0100
1688 -+++ ./drivers/video/Kconfig 2008-03-25 23:04:10.000000000 +0100
1689 -@@ -1134,7 +1134,6 @@ config FB_MATROX
1690 - select FB_CFB_FILLRECT
1691 - select FB_CFB_COPYAREA
1692 - select FB_CFB_IMAGEBLIT
1693 -- select FB_TILEBLITTING
1694 - select FB_MACMODES if PPC_PMAC
1695 - ---help---
1696 - Say Y here if you have a Matrox Millennium, Matrox Millennium II,
1697 -diff -Naurp -x .git /tmp/linux/include/linux/console_decor.h ./include/linux/console_decor.h
1698 ---- /tmp/linux/include/linux/console_decor.h 1970-01-01 01:00:00.000000000 +0100
1699 -+++ ./include/linux/console_decor.h 2008-03-25 23:04:10.000000000 +0100
1700 -@@ -0,0 +1,13 @@
1701 -+#ifndef _LINUX_CONSOLE_DECOR_H_
1702 -+#define _LINUX_CONSOLE_DECOR_H_ 1
1703 -+
1704 -+/* A structure used by the framebuffer console decorations (drivers/video/console/fbcondecor.c) */
1705 -+struct vc_decor {
1706 -+ __u8 bg_color; /* The color that is to be treated as transparent */
1707 -+ __u8 state; /* Current decor state: 0 = off, 1 = on */
1708 -+ __u16 tx, ty; /* Top left corner coordinates of the text field */
1709 -+ __u16 twidth, theight; /* Width and height of the text field */
1710 -+ char* theme;
1711 -+};
1712 -+
1713 -+#endif
1714 -diff -Naurp -x .git /tmp/linux/include/linux/console_struct.h ./include/linux/console_struct.h
1715 ---- /tmp/linux/include/linux/console_struct.h 2008-03-25 07:24:16.000000000 +0100
1716 -+++ ./include/linux/console_struct.h 2008-03-25 23:04:10.000000000 +0100
1717 -@@ -19,6 +19,7 @@
1718 - struct vt_struct;
1719 -
1720 - #define NPAR 16
1721 -+#include <linux/console_decor.h>
1722 -
1723 - struct vc_data {
1724 - unsigned short vc_num; /* Console number */
1725 -@@ -106,6 +107,8 @@ struct vc_data {
1726 - struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
1727 - unsigned long vc_uni_pagedir;
1728 - unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
1729 -+
1730 -+ struct vc_decor vc_decor;
1731 - /* additional information is in vt_kern.h */
1732 - };
1733 -
1734 -diff -Naurp -x .git /tmp/linux/include/linux/fb.h ./include/linux/fb.h
1735 ---- /tmp/linux/include/linux/fb.h 2008-03-25 07:24:16.000000000 +0100
1736 -+++ ./include/linux/fb.h 2008-03-25 23:04:10.000000000 +0100
1737 -@@ -11,6 +11,13 @@ struct dentry;
1738 - #define FB_MAJOR 29
1739 - #define FB_MAX 32 /* sufficient for now */
1740 -
1741 -+struct fbcon_decor_iowrapper
1742 -+{
1743 -+ unsigned short vc; /* Virtual console */
1744 -+ unsigned char origin; /* Point of origin of the request */
1745 -+ void *data;
1746 -+};
1747 -+
1748 - /* ioctls
1749 - 0x46 is 'F' */
1750 - #define FBIOGET_VSCREENINFO 0x4600
1751 -@@ -38,7 +45,15 @@ struct dentry;
1752 - #define FBIOGET_HWCINFO 0x4616
1753 - #define FBIOPUT_MODEINFO 0x4617
1754 - #define FBIOGET_DISPINFO 0x4618
1755 --
1756 -+#define FBIOCONDECOR_SETCFG _IOWR('F', 0x19, struct fbcon_decor_iowrapper)
1757 -+#define FBIOCONDECOR_GETCFG _IOR('F', 0x1A, struct fbcon_decor_iowrapper)
1758 -+#define FBIOCONDECOR_SETSTATE _IOWR('F', 0x1B, struct fbcon_decor_iowrapper)
1759 -+#define FBIOCONDECOR_GETSTATE _IOR('F', 0x1C, struct fbcon_decor_iowrapper)
1760 -+#define FBIOCONDECOR_SETPIC _IOWR('F', 0x1D, struct fbcon_decor_iowrapper)
1761 -+
1762 -+#define FBCON_DECOR_THEME_LEN 128 /* Maximum lenght of a theme name */
1763 -+#define FBCON_DECOR_IO_ORIG_KERNEL 0 /* Kernel ioctl origin */
1764 -+#define FBCON_DECOR_IO_ORIG_USER 1 /* User ioctl origin */
1765 -
1766 - #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
1767 - #define FB_TYPE_PLANES 1 /* Non interleaved planes */
1768 -@@ -833,6 +848,9 @@ struct fb_info {
1769 - #define FBINFO_STATE_SUSPENDED 1
1770 - u32 state; /* Hardware state i.e suspend */
1771 - void *fbcon_par; /* fbcon use-only private area */
1772 -+
1773 -+ struct fb_image bgdecor;
1774 -+
1775 - /* From here on everything is device dependent */
1776 - void *par;
1777 - };
1778 -diff -Naurp -x .git /tmp/linux/kernel/sysctl.c ./kernel/sysctl.c
1779 ---- /tmp/linux/kernel/sysctl.c 2008-03-25 07:24:16.000000000 +0100
1780 -+++ ./kernel/sysctl.c 2008-03-25 23:04:10.000000000 +0100
1781 -@@ -107,6 +107,9 @@ static int ngroups_max = NGROUPS_MAX;
1782 - #ifdef CONFIG_KMOD
1783 - extern char modprobe_path[];
1784 - #endif
1785 -+#ifdef CONFIG_FB_CON_DECOR
1786 -+extern char fbcon_decor_path[];
1787 -+#endif
1788 - #ifdef CONFIG_CHR_DEV_SG
1789 - extern int sg_big_buff;
1790 - #endif
1791 -@@ -820,6 +823,18 @@ static struct ctl_table kern_table[] = {
1792 - .proc_handler = &proc_dostring,
1793 - .strategy = &sysctl_string,
1794 - },
1795 -+#ifdef CONFIG_FB_CON_DECOR
1796 -+ {
1797 -+ .ctl_name = CTL_UNNUMBERED,
1798 -+ .procname = "fbcondecor",
1799 -+ .data = &fbcon_decor_path,
1800 -+ .maxlen = KMOD_PATH_LEN,
1801 -+ .mode = 0644,
1802 -+ .proc_handler = &proc_dostring,
1803 -+ .strategy = &sysctl_string,
1804 -+ },
1805 -+#endif
1806 -+
1807 - /*
1808 - * NOTE: do not add new entries to this table unless you have read
1809 - * Documentation/sysctl/ctl_unnumbered.txt
1810
1811 Added: genpatches-2.6/trunk/2.6.29/4200_fbcondecor-0.9.5.patch
1812 ===================================================================
1813 --- genpatches-2.6/trunk/2.6.29/4200_fbcondecor-0.9.5.patch (rev 0)
1814 +++ genpatches-2.6/trunk/2.6.29/4200_fbcondecor-0.9.5.patch 2009-03-24 23:58:01 UTC (rev 1535)
1815 @@ -0,0 +1,1817 @@
1816 +diff -Naurp 2.6.28-orig/Documentation/fb/00-INDEX 2.6.28/Documentation/fb/00-INDEX
1817 +--- 2.6.28-orig/Documentation/fb/00-INDEX 2009-01-08 22:17:00.000000000 +0100
1818 ++++ 2.6.28/Documentation/fb/00-INDEX 2009-01-08 22:19:03.000000000 +0100
1819 +@@ -17,6 +17,8 @@ deferred_io.txt
1820 + - an introduction to deferred IO.
1821 + fbcon.txt
1822 + - intro to and usage guide for the framebuffer console (fbcon).
1823 ++fbcondecor.txt
1824 ++ - info on the Framebuffer Console Decoration
1825 + framebuffer.txt
1826 + - introduction to frame buffer devices.
1827 + imacfb.txt
1828 +diff -Naurp 2.6.28-orig/Documentation/fb/fbcondecor.txt 2.6.28/Documentation/fb/fbcondecor.txt
1829 +--- 2.6.28-orig/Documentation/fb/fbcondecor.txt 1970-01-01 01:00:00.000000000 +0100
1830 ++++ 2.6.28/Documentation/fb/fbcondecor.txt 2009-01-08 22:19:03.000000000 +0100
1831 +@@ -0,0 +1,207 @@
1832 ++What is it?
1833 ++-----------
1834 ++
1835 ++The framebuffer decorations are a kernel feature which allows displaying a
1836 ++background picture on selected consoles.
1837 ++
1838 ++What do I need to get it to work?
1839 ++---------------------------------
1840 ++
1841 ++To get fbcondecor up-and-running you will have to:
1842 ++ 1) get a copy of splashutils [1] or a similar program
1843 ++ 2) get some fbcondecor themes
1844 ++ 3) build the kernel helper program
1845 ++ 4) build your kernel with the FB_CON_DECOR option enabled.
1846 ++
1847 ++To get fbcondecor operational right after fbcon initialization is finished, you
1848 ++will have to include a theme and the kernel helper into your initramfs image.
1849 ++Please refer to splashutils documentation for instructions on how to do that.
1850 ++
1851 ++[1] The splashutils package can be downloaded from:
1852 ++ http://dev.gentoo.org/~spock/projects/splashutils/
1853 ++
1854 ++The userspace helper
1855 ++--------------------
1856 ++
1857 ++The userspace fbcondecor helper (by default: /sbin/fbcondecor_helper) is called by the
1858 ++kernel whenever an important event occurs and the kernel needs some kind of
1859 ++job to be carried out. Important events include console switches and video
1860 ++mode switches (the kernel requests background images and configuration
1861 ++parameters for the current console). The fbcondecor helper must be accessible at
1862 ++all times. If it's not, fbcondecor will be switched off automatically.
1863 ++
1864 ++It's possible to set path to the fbcondecor helper by writing it to
1865 ++/proc/sys/kernel/fbcondecor.
1866 ++
1867 ++*****************************************************************************
1868 ++
1869 ++The information below is mostly technical stuff. There's probably no need to
1870 ++read it unless you plan to develop a userspace helper.
1871 ++
1872 ++The fbcondecor protocol
1873 ++-----------------------
1874 ++
1875 ++The fbcondecor protocol defines a communication interface between the kernel and
1876 ++the userspace fbcondecor helper.
1877 ++
1878 ++The kernel side is responsible for:
1879 ++
1880 ++ * rendering console text, using an image as a background (instead of a
1881 ++ standard solid color fbcon uses),
1882 ++ * accepting commands from the user via ioctls on the fbcondecor device,
1883 ++ * calling the userspace helper to set things up as soon as the fb subsystem
1884 ++ is initialized.
1885 ++
1886 ++The userspace helper is responsible for everything else, including parsing
1887 ++configuration files, decompressing the image files whenever the kernel needs
1888 ++it, and communicating with the kernel if necessary.
1889 ++
1890 ++The fbcondecor protocol specifies how communication is done in both ways:
1891 ++kernel->userspace and userspace->helper.
1892 ++
1893 ++Kernel -> Userspace
1894 ++-------------------
1895 ++
1896 ++The kernel communicates with the userspace helper by calling it and specifying
1897 ++the task to be done in a series of arguments.
1898 ++
1899 ++The arguments follow the pattern:
1900 ++<fbcondecor protocol version> <command> <parameters>
1901 ++
1902 ++All commands defined in fbcondecor protocol v2 have the following parameters:
1903 ++ virtual console
1904 ++ framebuffer number
1905 ++ theme
1906 ++
1907 ++Fbcondecor protocol v1 specified an additional 'fbcondecor mode' after the
1908 ++framebuffer number. Fbcondecor protocol v1 is deprecated and should not be used.
1909 ++
1910 ++Fbcondecor protocol v2 specifies the following commands:
1911 ++
1912 ++getpic
1913 ++------
1914 ++ The kernel issues this command to request image data. It's up to the
1915 ++ userspace helper to find a background image appropriate for the specified
1916 ++ theme and the current resolution. The userspace helper should respond by
1917 ++ issuing the FBIOCONDECOR_SETPIC ioctl.
1918 ++
1919 ++init
1920 ++----
1921 ++ The kernel issues this command after the fbcondecor device is created and
1922 ++ the fbcondecor interface is initialized. Upon receiving 'init', the userspace
1923 ++ helper should parse the kernel command line (/proc/cmdline) or otherwise
1924 ++ decide whether fbcondecor is to be activated.
1925 ++
1926 ++ To activate fbcondecor on the first console the helper should issue the
1927 ++ FBIOCONDECOR_SETCFG, FBIOCONDECOR_SETPIC and FBIOCONDECOR_SETSTATE commands,
1928 ++ in the above-mentioned order.
1929 ++
1930 ++ When the userspace helper is called in an early phase of the boot process
1931 ++ (right after the initialization of fbcon), no filesystems will be mounted.
1932 ++ The helper program should mount sysfs and then create the appropriate
1933 ++ framebuffer, fbcondecor and tty0 devices (if they don't already exist) to get
1934 ++ current display settings and to be able to communicate with the kernel side.
1935 ++ It should probably also mount the procfs to be able to parse the kernel
1936 ++ command line parameters.
1937 ++
1938 ++ Note that the console sem is not held when the kernel calls fbcondecor_helper
1939 ++ with the 'init' command. The fbcondecor helper should perform all ioctls with
1940 ++ origin set to FBCON_DECOR_IO_ORIG_USER.
1941 ++
1942 ++modechange
1943 ++----------
1944 ++ The kernel issues this command on a mode change. The helper's response should
1945 ++ be similar to the response to the 'init' command. Note that this time the
1946 ++ console sem is held and all ioctls must be performed with origin set to
1947 ++ FBCON_DECOR_IO_ORIG_KERNEL.
1948 ++
1949 ++
1950 ++Userspace -> Kernel
1951 ++-------------------
1952 ++
1953 ++Userspace programs can communicate with fbcondecor via ioctls on the
1954 ++fbcondecor device. These ioctls are to be used by both the userspace helper
1955 ++(called only by the kernel) and userspace configuration tools (run by the users).
1956 ++
1957 ++The fbcondecor helper should set the origin field to FBCON_DECOR_IO_ORIG_KERNEL
1958 ++when doing the appropriate ioctls. All userspace configuration tools should
1959 ++use FBCON_DECOR_IO_ORIG_USER. Failure to set the appropriate value in the origin
1960 ++field when performing ioctls from the kernel helper will most likely result
1961 ++in a console deadlock.
1962 ++
1963 ++FBCON_DECOR_IO_ORIG_KERNEL instructs fbcondecor not to try to acquire the console
1964 ++semaphore. Not surprisingly, FBCON_DECOR_IO_ORIG_USER instructs it to acquire
1965 ++the console sem.
1966 ++
1967 ++The framebuffer console decoration provides the following ioctls (all defined in
1968 ++linux/fb.h):
1969 ++
1970 ++FBIOCONDECOR_SETPIC
1971 ++description: loads a background picture for a virtual console
1972 ++argument: struct fbcon_decor_iowrapper*; data: struct fb_image*
1973 ++notes:
1974 ++If called for consoles other than the current foreground one, the picture data
1975 ++will be ignored.
1976 ++
1977 ++If the current virtual console is running in a 8-bpp mode, the cmap substruct
1978 ++of fb_image has to be filled appropriately: start should be set to 16 (first
1979 ++16 colors are reserved for fbcon), len to a value <= 240 and red, green and
1980 ++blue should point to valid cmap data. The transp field is ingored. The fields
1981 ++dx, dy, bg_color, fg_color in fb_image are ignored as well.
1982 ++
1983 ++FBIOCONDECOR_SETCFG
1984 ++description: sets the fbcondecor config for a virtual console
1985 ++argument: struct fbcon_decor_iowrapper*; data: struct vc_decor*
1986 ++notes: The structure has to be filled with valid data.
1987 ++
1988 ++FBIOCONDECOR_GETCFG
1989 ++description: gets the fbcondecor config for a virtual console
1990 ++argument: struct fbcon_decor_iowrapper*; data: struct vc_decor*
1991 ++
1992 ++FBIOCONDECOR_SETSTATE
1993 ++description: sets the fbcondecor state for a virtual console
1994 ++argument: struct fbcon_decor_iowrapper*; data: unsigned int*
1995 ++ values: 0 = disabled, 1 = enabled.
1996 ++
1997 ++FBIOCONDECOR_GETSTATE
1998 ++description: gets the fbcondecor state for a virtual console
1999 ++argument: struct fbcon_decor_iowrapper*; data: unsigned int*
2000 ++ values: as in FBIOCONDECOR_SETSTATE
2001 ++
2002 ++Info on used structures:
2003 ++
2004 ++Definition of struct vc_decor can be found in linux/console_decor.h. It's
2005 ++heavily commented. Note that the 'theme' field should point to a string
2006 ++no longer than FBCON_DECOR_THEME_LEN. When FBIOCONDECOR_GETCFG call is
2007 ++performed, the theme field should point to a char buffer of length
2008 ++FBCON_DECOR_THEME_LEN.
2009 ++
2010 ++Definition of struct fbcon_decor_iowrapper can be found in linux/fb.h.
2011 ++The fields in this struct have the following meaning:
2012 ++
2013 ++vc:
2014 ++Virtual console number.
2015 ++
2016 ++origin:
2017 ++Specifies if the ioctl is performed as a response to a kernel request. The
2018 ++fbcondecor helper should set this field to FBCON_DECOR_IO_ORIG_KERNEL, userspace
2019 ++programs should set it to FBCON_DECOR_IO_ORIG_USER. This field is necessary to
2020 ++avoid console semaphore deadlocks.
2021 ++
2022 ++data:
2023 ++Pointer to a data structure appropriate for the performed ioctl. Type of
2024 ++the data struct is specified in the ioctls description.
2025 ++
2026 ++*****************************************************************************
2027 ++
2028 ++Credit
2029 ++------
2030 ++
2031 ++Original 'bootsplash' project & implementation by:
2032 ++ Volker Poplawski <volker@×××××××××.de>, Stefan Reinauer <stepan@××××.de>,
2033 ++ Steffen Winterfeldt <snwint@××××.de>, Michael Schroeder <mls@××××.de>,
2034 ++ Ken Wimer <wimer@××××.de>.
2035 ++
2036 ++Fbcondecor, fbcondecor protocol design, current implementation & docs by:
2037 ++ Michal Januszewski <spock@g.o>
2038 ++
2039 +diff -Naurp 2.6.28-orig/drivers/Makefile 2.6.28/drivers/Makefile
2040 +--- 2.6.28-orig/drivers/Makefile 2009-01-08 22:16:51.000000000 +0100
2041 ++++ 2.6.28/drivers/Makefile 2009-01-08 22:19:03.000000000 +0100
2042 +@@ -9,6 +9,9 @@ obj-y += gpio/
2043 + obj-$(CONFIG_PCI) += pci/
2044 + obj-$(CONFIG_PARISC) += parisc/
2045 + obj-$(CONFIG_RAPIDIO) += rapidio/
2046 ++# char/ comes before serial/ etc so that the VT console is the boot-time
2047 ++# default.
2048 ++obj-y += char/
2049 + obj-y += video/
2050 + obj-$(CONFIG_ACPI) += acpi/
2051 + # PnP must come after ACPI since it will eventually need to check if acpi
2052 +@@ -18,10 +21,6 @@ obj-$(CONFIG_ARM_AMBA) += amba/
2053 +
2054 + obj-$(CONFIG_XEN) += xen/
2055 +
2056 +-# char/ comes before serial/ etc so that the VT console is the boot-time
2057 +-# default.
2058 +-obj-y += char/
2059 +-
2060 + # gpu/ comes after char for AGP vs DRM startup
2061 + obj-y += gpu/
2062 +
2063 +diff -Naurp 2.6.28-orig/drivers/video/console/bitblit.c 2.6.28/drivers/video/console/bitblit.c
2064 +--- 2.6.28-orig/drivers/video/console/bitblit.c 2009-01-08 22:16:55.000000000 +0100
2065 ++++ 2.6.28/drivers/video/console/bitblit.c 2009-01-08 22:19:03.000000000 +0100
2066 +@@ -17,6 +17,7 @@
2067 + #include <linux/console.h>
2068 + #include <asm/types.h>
2069 + #include "fbcon.h"
2070 ++#include "fbcondecor.h"
2071 +
2072 + /*
2073 + * Accelerated handlers.
2074 +@@ -54,6 +55,13 @@ static void bit_bmove(struct vc_data *vc
2075 + area.height = height * vc->vc_font.height;
2076 + area.width = width * vc->vc_font.width;
2077 +
2078 ++ if (fbcon_decor_active(info, vc)) {
2079 ++ area.sx += vc->vc_decor.tx;
2080 ++ area.sy += vc->vc_decor.ty;
2081 ++ area.dx += vc->vc_decor.tx;
2082 ++ area.dy += vc->vc_decor.ty;
2083 ++ }
2084 ++
2085 + info->fbops->fb_copyarea(info, &area);
2086 + }
2087 +
2088 +@@ -379,11 +387,15 @@ static void bit_cursor(struct vc_data *v
2089 + cursor.image.depth = 1;
2090 + cursor.rop = ROP_XOR;
2091 +
2092 +- if (info->fbops->fb_cursor)
2093 +- err = info->fbops->fb_cursor(info, &cursor);
2094 ++ if (fbcon_decor_active(info, vc)) {
2095 ++ fbcon_decor_cursor(info, &cursor);
2096 ++ } else {
2097 ++ if (info->fbops->fb_cursor)
2098 ++ err = info->fbops->fb_cursor(info, &cursor);
2099 +
2100 +- if (err)
2101 +- soft_cursor(info, &cursor);
2102 ++ if (err)
2103 ++ soft_cursor(info, &cursor);
2104 ++ }
2105 +
2106 + ops->cursor_reset = 0;
2107 + }
2108 +diff -Naurp 2.6.28-orig/drivers/video/console/cfbcondecor.c 2.6.28/drivers/video/console/cfbcondecor.c
2109 +--- 2.6.28-orig/drivers/video/console/cfbcondecor.c 1970-01-01 01:00:00.000000000 +0100
2110 ++++ 2.6.28/drivers/video/console/cfbcondecor.c 2009-01-08 22:19:03.000000000 +0100
2111 +@@ -0,0 +1,471 @@
2112 ++/*
2113 ++ * linux/drivers/video/cfbcon_decor.c -- Framebuffer decor render functions
2114 ++ *
2115 ++ * Copyright (C) 2004 Michal Januszewski <spock@g.o>
2116 ++ *
2117 ++ * Code based upon "Bootdecor" (C) 2001-2003
2118 ++ * Volker Poplawski <volker@×××××××××.de>,
2119 ++ * Stefan Reinauer <stepan@××××.de>,
2120 ++ * Steffen Winterfeldt <snwint@××××.de>,
2121 ++ * Michael Schroeder <mls@××××.de>,
2122 ++ * Ken Wimer <wimer@××××.de>.
2123 ++ *
2124 ++ * This file is subject to the terms and conditions of the GNU General Public
2125 ++ * License. See the file COPYING in the main directory of this archive for
2126 ++ * more details.
2127 ++ */
2128 ++#include <linux/module.h>
2129 ++#include <linux/types.h>
2130 ++#include <linux/fb.h>
2131 ++#include <linux/selection.h>
2132 ++#include <linux/vt_kern.h>
2133 ++#include <asm/irq.h>
2134 ++#include <asm/system.h>
2135 ++
2136 ++#include "fbcon.h"
2137 ++#include "fbcondecor.h"
2138 ++
2139 ++#define parse_pixel(shift,bpp,type) \
2140 ++ do { \
2141 ++ if (d & (0x80 >> (shift))) \
2142 ++ dd2[(shift)] = fgx; \
2143 ++ else \
2144 ++ dd2[(shift)] = transparent ? *(type *)decor_src : bgx; \
2145 ++ decor_src += (bpp); \
2146 ++ } while (0) \
2147 ++
2148 ++extern int get_color(struct vc_data *vc, struct fb_info *info,
2149 ++ u16 c, int is_fg);
2150 ++
2151 ++void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc)
2152 ++{
2153 ++ int i, j, k;
2154 ++ int minlen = min(min(info->var.red.length, info->var.green.length),
2155 ++ info->var.blue.length);
2156 ++ u32 col;
2157 ++
2158 ++ for (j = i = 0; i < 16; i++) {
2159 ++ k = color_table[i];
2160 ++
2161 ++ col = ((vc->vc_palette[j++] >> (8-minlen))
2162 ++ << info->var.red.offset);
2163 ++ col |= ((vc->vc_palette[j++] >> (8-minlen))
2164 ++ << info->var.green.offset);
2165 ++ col |= ((vc->vc_palette[j++] >> (8-minlen))
2166 ++ << info->var.blue.offset);
2167 ++ ((u32 *)info->pseudo_palette)[k] = col;
2168 ++ }
2169 ++}
2170 ++
2171 ++void fbcon_decor_renderc(struct fb_info *info, int ypos, int xpos, int height,
2172 ++ int width, u8* src, u32 fgx, u32 bgx, u8 transparent)
2173 ++{
2174 ++ unsigned int x, y;
2175 ++ u32 dd;
2176 ++ int bytespp = ((info->var.bits_per_pixel + 7) >> 3);
2177 ++ unsigned int d = ypos * info->fix.line_length + xpos * bytespp;
2178 ++ unsigned int ds = (ypos * info->var.xres + xpos) * bytespp;
2179 ++ u16 dd2[4];
2180 ++
2181 ++ u8* decor_src = (u8 *)(info->bgdecor.data + ds);
2182 ++ u8* dst = (u8 *)(info->screen_base + d);
2183 ++
2184 ++ if ((ypos + height) > info->var.yres || (xpos + width) > info->var.xres)
2185 ++ return;
2186 ++
2187 ++ for (y = 0; y < height; y++) {
2188 ++ switch (info->var.bits_per_pixel) {
2189 ++
2190 ++ case 32:
2191 ++ for (x = 0; x < width; x++) {
2192 ++
2193 ++ if ((x & 7) == 0)
2194 ++ d = *src++;
2195 ++ if (d & 0x80)
2196 ++ dd = fgx;
2197 ++ else
2198 ++ dd = transparent ?
2199 ++ *(u32 *)decor_src : bgx;
2200 ++
2201 ++ d <<= 1;
2202 ++ decor_src += 4;
2203 ++ fb_writel(dd, dst);
2204 ++ dst += 4;
2205 ++ }
2206 ++ break;
2207 ++ case 24:
2208 ++ for (x = 0; x < width; x++) {
2209 ++
2210 ++ if ((x & 7) == 0)
2211 ++ d = *src++;
2212 ++ if (d & 0x80)
2213 ++ dd = fgx;
2214 ++ else
2215 ++ dd = transparent ?
2216 ++ (*(u32 *)decor_src & 0xffffff) : bgx;
2217 ++
2218 ++ d <<= 1;
2219 ++ decor_src += 3;
2220 ++#ifdef __LITTLE_ENDIAN
2221 ++ fb_writew(dd & 0xffff, dst);
2222 ++ dst += 2;
2223 ++ fb_writeb((dd >> 16), dst);
2224 ++#else
2225 ++ fb_writew(dd >> 8, dst);
2226 ++ dst += 2;
2227 ++ fb_writeb(dd & 0xff, dst);
2228 ++#endif
2229 ++ dst++;
2230 ++ }
2231 ++ break;
2232 ++ case 16:
2233 ++ for (x = 0; x < width; x += 2) {
2234 ++ if ((x & 7) == 0)
2235 ++ d = *src++;
2236 ++
2237 ++ parse_pixel(0, 2, u16);
2238 ++ parse_pixel(1, 2, u16);
2239 ++#ifdef __LITTLE_ENDIAN
2240 ++ dd = dd2[0] | (dd2[1] << 16);
2241 ++#else
2242 ++ dd = dd2[1] | (dd2[0] << 16);
2243 ++#endif
2244 ++ d <<= 2;
2245 ++ fb_writel(dd, dst);
2246 ++ dst += 4;
2247 ++ }
2248 ++ break;
2249 ++
2250 ++ case 8:
2251 ++ for (x = 0; x < width; x += 4) {
2252 ++ if ((x & 7) == 0)
2253 ++ d = *src++;
2254 ++
2255 ++ parse_pixel(0, 1, u8);
2256 ++ parse_pixel(1, 1, u8);
2257 ++ parse_pixel(2, 1, u8);
2258 ++ parse_pixel(3, 1, u8);
2259 ++
2260 ++#ifdef __LITTLE_ENDIAN
2261 ++ dd = dd2[0] | (dd2[1] << 8) | (dd2[2] << 16) | (dd2[3] << 24);
2262 ++#else
2263 ++ dd = dd2[3] | (dd2[2] << 8) | (dd2[1] << 16) | (dd2[0] << 24);
2264 ++#endif
2265 ++ d <<= 4;
2266 ++ fb_writel(dd, dst);
2267 ++ dst += 4;
2268 ++ }
2269 ++ }
2270 ++
2271 ++ dst += info->fix.line_length - width * bytespp;
2272 ++ decor_src += (info->var.xres - width) * bytespp;
2273 ++ }
2274 ++}
2275 ++
2276 ++#define cc2cx(a) \
2277 ++ ((info->fix.visual == FB_VISUAL_TRUECOLOR || \
2278 ++ info->fix.visual == FB_VISUAL_DIRECTCOLOR) ? \
2279 ++ ((u32*)info->pseudo_palette)[a] : a)
2280 ++
2281 ++void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info,
2282 ++ const unsigned short *s, int count, int yy, int xx)
2283 ++{
2284 ++ unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
2285 ++ struct fbcon_ops *ops = info->fbcon_par;
2286 ++ int fg_color, bg_color, transparent;
2287 ++ u8 *src;
2288 ++ u32 bgx, fgx;
2289 ++ u16 c = scr_readw(s);
2290 ++
2291 ++ fg_color = get_color(vc, info, c, 1);
2292 ++ bg_color = get_color(vc, info, c, 0);
2293 ++
2294 ++ /* Don't paint the background image if console is blanked */
2295 ++ transparent = ops->blank_state ? 0 :
2296 ++ (vc->vc_decor.bg_color == bg_color);
2297 ++
2298 ++ xx = xx * vc->vc_font.width + vc->vc_decor.tx;
2299 ++ yy = yy * vc->vc_font.height + vc->vc_decor.ty;
2300 ++
2301 ++ fgx = cc2cx(fg_color);
2302 ++ bgx = cc2cx(bg_color);
2303 ++
2304 ++ while (count--) {
2305 ++ c = scr_readw(s++);
2306 ++ src = vc->vc_font.data + (c & charmask) * vc->vc_font.height *
2307 ++ ((vc->vc_font.width + 7) >> 3);
2308 ++
2309 ++ fbcon_decor_renderc(info, yy, xx, vc->vc_font.height,
2310 ++ vc->vc_font.width, src, fgx, bgx, transparent);
2311 ++ xx += vc->vc_font.width;
2312 ++ }
2313 ++}
2314 ++
2315 ++void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor)
2316 ++{
2317 ++ int i;
2318 ++ unsigned int dsize, s_pitch;
2319 ++ struct fbcon_ops *ops = info->fbcon_par;
2320 ++ struct vc_data* vc;
2321 ++ u8 *src;
2322 ++
2323 ++ /* we really don't need any cursors while the console is blanked */
2324 ++ if (info->state != FBINFO_STATE_RUNNING || ops->blank_state)
2325 ++ return;
2326 ++
2327 ++ vc = vc_cons[ops->currcon].d;
2328 ++
2329 ++ src = kmalloc(64 + sizeof(struct fb_image), GFP_ATOMIC);
2330 ++ if (!src)
2331 ++ return;
2332 ++
2333 ++ s_pitch = (cursor->image.width + 7) >> 3;
2334 ++ dsize = s_pitch * cursor->image.height;
2335 ++ if (cursor->enable) {
2336 ++ switch (cursor->rop) {
2337 ++ case ROP_XOR:
2338 ++ for (i = 0; i < dsize; i++)
2339 ++ src[i] = cursor->image.data[i] ^ cursor->mask[i];
2340 ++ break;
2341 ++ case ROP_COPY:
2342 ++ default:
2343 ++ for (i = 0; i < dsize; i++)
2344 ++ src[i] = cursor->image.data[i] & cursor->mask[i];
2345 ++ break;
2346 ++ }
2347 ++ } else
2348 ++ memcpy(src, cursor->image.data, dsize);
2349 ++
2350 ++ fbcon_decor_renderc(info,
2351 ++ cursor->image.dy + vc->vc_decor.ty,
2352 ++ cursor->image.dx + vc->vc_decor.tx,
2353 ++ cursor->image.height,
2354 ++ cursor->image.width,
2355 ++ (u8*)src,
2356 ++ cc2cx(cursor->image.fg_color),
2357 ++ cc2cx(cursor->image.bg_color),
2358 ++ cursor->image.bg_color == vc->vc_decor.bg_color);
2359 ++
2360 ++ kfree(src);
2361 ++}
2362 ++
2363 ++static void decorset(u8 *dst, int height, int width, int dstbytes,
2364 ++ u32 bgx, int bpp)
2365 ++{
2366 ++ int i;
2367 ++
2368 ++ if (bpp == 8)
2369 ++ bgx |= bgx << 8;
2370 ++ if (bpp == 16 || bpp == 8)
2371 ++ bgx |= bgx << 16;
2372 ++
2373 ++ while (height-- > 0) {
2374 ++ u8 *p = dst;
2375 ++
2376 ++ switch (bpp) {
2377 ++
2378 ++ case 32:
2379 ++ for (i=0; i < width; i++) {
2380 ++ fb_writel(bgx, p); p += 4;
2381 ++ }
2382 ++ break;
2383 ++ case 24:
2384 ++ for (i=0; i < width; i++) {
2385 ++#ifdef __LITTLE_ENDIAN
2386 ++ fb_writew((bgx & 0xffff),(u16*)p); p += 2;
2387 ++ fb_writeb((bgx >> 16),p++);
2388 ++#else
2389 ++ fb_writew((bgx >> 8),(u16*)p); p += 2;
2390 ++ fb_writeb((bgx & 0xff),p++);
2391 ++#endif
2392 ++ }
2393 ++ case 16:
2394 ++ for (i=0; i < width/4; i++) {
2395 ++ fb_writel(bgx,p); p += 4;
2396 ++ fb_writel(bgx,p); p += 4;
2397 ++ }
2398 ++ if (width & 2) {
2399 ++ fb_writel(bgx,p); p += 4;
2400 ++ }
2401 ++ if (width & 1)
2402 ++ fb_writew(bgx,(u16*)p);
2403 ++ break;
2404 ++ case 8:
2405 ++ for (i=0; i < width/4; i++) {
2406 ++ fb_writel(bgx,p); p += 4;
2407 ++ }
2408 ++
2409 ++ if (width & 2) {
2410 ++ fb_writew(bgx,p); p += 2;
2411 ++ }
2412 ++ if (width & 1)
2413 ++ fb_writeb(bgx,(u8*)p);
2414 ++ break;
2415 ++
2416 ++ }
2417 ++ dst += dstbytes;
2418 ++ }
2419 ++}
2420 ++
2421 ++void fbcon_decor_copy(u8 *dst, u8 *src, int height, int width, int linebytes,
2422 ++ int srclinebytes, int bpp)
2423 ++{
2424 ++ int i;
2425 ++
2426 ++ while (height-- > 0) {
2427 ++ u32 *p = (u32 *)dst;
2428 ++ u32 *q = (u32 *)src;
2429 ++
2430 ++ switch (bpp) {
2431 ++
2432 ++ case 32:
2433 ++ for (i=0; i < width; i++)
2434 ++ fb_writel(*q++, p++);
2435 ++ break;
2436 ++ case 24:
2437 ++ for (i=0; i < (width*3/4); i++)
2438 ++ fb_writel(*q++, p++);
2439 ++ if ((width*3) % 4) {
2440 ++ if (width & 2) {
2441 ++ fb_writeb(*(u8*)q, (u8*)p);
2442 ++ } else if (width & 1) {
2443 ++ fb_writew(*(u16*)q, (u16*)p);
2444 ++ fb_writeb(*(u8*)((u16*)q+1),(u8*)((u16*)p+2));
2445 ++ }
2446 ++ }
2447 ++ break;
2448 ++ case 16:
2449 ++ for (i=0; i < width/4; i++) {
2450 ++ fb_writel(*q++, p++);
2451 ++ fb_writel(*q++, p++);
2452 ++ }
2453 ++ if (width & 2)
2454 ++ fb_writel(*q++, p++);
2455 ++ if (width & 1)
2456 ++ fb_writew(*(u16*)q, (u16*)p);
2457 ++ break;
2458 ++ case 8:
2459 ++ for (i=0; i < width/4; i++)
2460 ++ fb_writel(*q++, p++);
2461 ++
2462 ++ if (width & 2) {
2463 ++ fb_writew(*(u16*)q, (u16*)p);
2464 ++ q = (u32*) ((u16*)q + 1);
2465 ++ p = (u32*) ((u16*)p + 1);
2466 ++ }
2467 ++ if (width & 1)
2468 ++ fb_writeb(*(u8*)q, (u8*)p);
2469 ++ break;
2470 ++ }
2471 ++
2472 ++ dst += linebytes;
2473 ++ src += srclinebytes;
2474 ++ }
2475 ++}
2476 ++
2477 ++static void decorfill(struct fb_info *info, int sy, int sx, int height,
2478 ++ int width)
2479 ++{
2480 ++ int bytespp = ((info->var.bits_per_pixel + 7) >> 3);
2481 ++ int d = sy * info->fix.line_length + sx * bytespp;
2482 ++ int ds = (sy * info->var.xres + sx) * bytespp;
2483 ++
2484 ++ fbcon_decor_copy((u8 *)(info->screen_base + d), (u8 *)(info->bgdecor.data + ds),
2485 ++ height, width, info->fix.line_length, info->var.xres * bytespp,
2486 ++ info->var.bits_per_pixel);
2487 ++}
2488 ++
2489 ++void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx,
2490 ++ int height, int width)
2491 ++{
2492 ++ int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
2493 ++ struct fbcon_ops *ops = info->fbcon_par;
2494 ++ u8 *dst;
2495 ++ int transparent, bg_color = attr_bgcol_ec(bgshift, vc, info);
2496 ++
2497 ++ transparent = (vc->vc_decor.bg_color == bg_color);
2498 ++ sy = sy * vc->vc_font.height + vc->vc_decor.ty;
2499 ++ sx = sx * vc->vc_font.width + vc->vc_decor.tx;
2500 ++ height *= vc->vc_font.height;
2501 ++ width *= vc->vc_font.width;
2502 ++
2503 ++ /* Don't paint the background image if console is blanked */
2504 ++ if (transparent && !ops->blank_state) {
2505 ++ decorfill(info, sy, sx, height, width);
2506 ++ } else {
2507 ++ dst = (u8 *)(info->screen_base + sy * info->fix.line_length +
2508 ++ sx * ((info->var.bits_per_pixel + 7) >> 3));
2509 ++ decorset(dst, height, width, info->fix.line_length, cc2cx(bg_color),
2510 ++ info->var.bits_per_pixel);
2511 ++ }
2512 ++}
2513 ++
2514 ++void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info,
2515 ++ int bottom_only)
2516 ++{
2517 ++ unsigned int tw = vc->vc_cols*vc->vc_font.width;
2518 ++ unsigned int th = vc->vc_rows*vc->vc_font.height;
2519 ++
2520 ++ if (!bottom_only) {
2521 ++ /* top margin */
2522 ++ decorfill(info, 0, 0, vc->vc_decor.ty, info->var.xres);
2523 ++ /* left margin */
2524 ++ decorfill(info, vc->vc_decor.ty, 0, th, vc->vc_decor.tx);
2525 ++ /* right margin */
2526 ++ decorfill(info, vc->vc_decor.ty, vc->vc_decor.tx + tw, th,
2527 ++ info->var.xres - vc->vc_decor.tx - tw);
2528 ++ }
2529 ++ decorfill(info, vc->vc_decor.ty + th, 0,
2530 ++ info->var.yres - vc->vc_decor.ty - th, info->var.xres);
2531 ++}
2532 ++
2533 ++void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y,
2534 ++ int sx, int dx, int width)
2535 ++{
2536 ++ u16 *d = (u16 *) (vc->vc_origin + vc->vc_size_row * y + dx * 2);
2537 ++ u16 *s = d + (dx - sx);
2538 ++ u16 *start = d;
2539 ++ u16 *ls = d;
2540 ++ u16 *le = d + width;
2541 ++ u16 c;
2542 ++ int x = dx;
2543 ++ u16 attr = 1;
2544 ++
2545 ++ do {
2546 ++ c = scr_readw(d);
2547 ++ if (attr != (c & 0xff00)) {
2548 ++ attr = c & 0xff00;
2549 ++ if (d > start) {
2550 ++ fbcon_decor_putcs(vc, info, start, d - start, y, x);
2551 ++ x += d - start;
2552 ++ start = d;
2553 ++ }
2554 ++ }
2555 ++ if (s >= ls && s < le && c == scr_readw(s)) {
2556 ++ if (d > start) {
2557 ++ fbcon_decor_putcs(vc, info, start, d - start, y, x);
2558 ++ x += d - start + 1;
2559 ++ start = d + 1;
2560 ++ } else {
2561 ++ x++;
2562 ++ start++;
2563 ++ }
2564 ++ }
2565 ++ s++;
2566 ++ d++;
2567 ++ } while (d < le);
2568 ++ if (d > start)
2569 ++ fbcon_decor_putcs(vc, info, start, d - start, y, x);
2570 ++}
2571 ++
2572 ++void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank)
2573 ++{
2574 ++ if (blank) {
2575 ++ decorset((u8 *)info->screen_base, info->var.yres, info->var.xres,
2576 ++ info->fix.line_length, 0, info->var.bits_per_pixel);
2577 ++ } else {
2578 ++ update_screen(vc);
2579 ++ fbcon_decor_clear_margins(vc, info, 0);
2580 ++ }
2581 ++}
2582 ++
2583 +diff -Naurp 2.6.28-orig/drivers/video/console/fbcon.c 2.6.28/drivers/video/console/fbcon.c
2584 +--- 2.6.28-orig/drivers/video/console/fbcon.c 2009-01-08 22:16:55.000000000 +0100
2585 ++++ 2.6.28/drivers/video/console/fbcon.c 2009-01-08 22:19:03.000000000 +0100
2586 +@@ -90,6 +90,7 @@
2587 + #endif
2588 +
2589 + #include "fbcon.h"
2590 ++#include "fbcondecor.h"
2591 +
2592 + #ifdef FBCONDEBUG
2593 + # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args)
2594 +@@ -105,7 +106,7 @@ enum {
2595 +
2596 + static struct display fb_display[MAX_NR_CONSOLES];
2597 +
2598 +-static signed char con2fb_map[MAX_NR_CONSOLES];
2599 ++signed char con2fb_map[MAX_NR_CONSOLES];
2600 + static signed char con2fb_map_boot[MAX_NR_CONSOLES];
2601 +
2602 + static int logo_lines;
2603 +@@ -313,7 +314,7 @@ static inline int fbcon_is_inactive(stru
2604 + vc->vc_mode != KD_TEXT || ops->graphics);
2605 + }
2606 +
2607 +-static inline int get_color(struct vc_data *vc, struct fb_info *info,
2608 ++inline int get_color(struct vc_data *vc, struct fb_info *info,
2609 + u16 c, int is_fg)
2610 + {
2611 + int depth = fb_get_color_depth(&info->var, &info->fix);
2612 +@@ -418,6 +419,7 @@ static void fb_flashcursor(struct work_s
2613 + CM_ERASE : CM_DRAW;
2614 + ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1),
2615 + get_color(vc, info, c, 0));
2616 ++
2617 + release_console_sem();
2618 + }
2619 +
2620 +@@ -588,6 +590,8 @@ static int fbcon_takeover(int show_logo)
2621 + info_idx = -1;
2622 + }
2623 +
2624 ++ fbcon_decor_init();
2625 ++
2626 + return err;
2627 + }
2628 +
2629 +@@ -1029,6 +1033,12 @@ static const char *fbcon_startup(void)
2630 + rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
2631 + cols /= vc->vc_font.width;
2632 + rows /= vc->vc_font.height;
2633 ++
2634 ++ if (fbcon_decor_active(info, vc)) {
2635 ++ cols = vc->vc_decor.twidth / vc->vc_font.width;
2636 ++ rows = vc->vc_decor.theight / vc->vc_font.height;
2637 ++ }
2638 ++
2639 + vc_resize(vc, cols, rows);
2640 +
2641 + DPRINTK("mode: %s\n", info->fix.id);
2642 +@@ -1112,7 +1122,7 @@ static void fbcon_init(struct vc_data *v
2643 + cap = info->flags;
2644 +
2645 + if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
2646 +- (info->fix.type == FB_TYPE_TEXT))
2647 ++ (info->fix.type == FB_TYPE_TEXT) || fbcon_decor_active(info, vc))
2648 + logo = 0;
2649 +
2650 + if (var_to_display(p, &info->var, info))
2651 +@@ -1314,6 +1324,11 @@ static void fbcon_clear(struct vc_data *
2652 + if (sy < vc->vc_top && vc->vc_top == logo_lines)
2653 + vc->vc_top = 0;
2654 +
2655 ++ if (fbcon_decor_active(info, vc)) {
2656 ++ fbcon_decor_clear(vc, info, sy, sx, height, width);
2657 ++ return;
2658 ++ }
2659 ++
2660 + /* Split blits that cross physical y_wrap boundary */
2661 +
2662 + y_break = p->vrows - p->yscroll;
2663 +@@ -1333,10 +1348,15 @@ static void fbcon_putcs(struct vc_data *
2664 + struct display *p = &fb_display[vc->vc_num];
2665 + struct fbcon_ops *ops = info->fbcon_par;
2666 +
2667 +- if (!fbcon_is_inactive(vc, info))
2668 +- ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
2669 +- get_color(vc, info, scr_readw(s), 1),
2670 +- get_color(vc, info, scr_readw(s), 0));
2671 ++ if (!fbcon_is_inactive(vc, info)) {
2672 ++
2673 ++ if (fbcon_decor_active(info, vc))
2674 ++ fbcon_decor_putcs(vc, info, s, count, ypos, xpos);
2675 ++ else
2676 ++ ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
2677 ++ get_color(vc, info, scr_readw(s), 1),
2678 ++ get_color(vc, info, scr_readw(s), 0));
2679 ++ }
2680 + }
2681 +
2682 + static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos)
2683 +@@ -1352,8 +1372,13 @@ static void fbcon_clear_margins(struct v
2684 + struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
2685 + struct fbcon_ops *ops = info->fbcon_par;
2686 +
2687 +- if (!fbcon_is_inactive(vc, info))
2688 +- ops->clear_margins(vc, info, bottom_only);
2689 ++ if (!fbcon_is_inactive(vc, info)) {
2690 ++ if (fbcon_decor_active(info, vc)) {
2691 ++ fbcon_decor_clear_margins(vc, info, bottom_only);
2692 ++ } else {
2693 ++ ops->clear_margins(vc, info, bottom_only);
2694 ++ }
2695 ++ }
2696 + }
2697 +
2698 + static void fbcon_cursor(struct vc_data *vc, int mode)
2699 +@@ -1873,7 +1898,7 @@ static int fbcon_scroll(struct vc_data *
2700 + count = vc->vc_rows;
2701 + if (softback_top)
2702 + fbcon_softback_note(vc, t, count);
2703 +- if (logo_shown >= 0)
2704 ++ if (logo_shown >= 0 || fbcon_decor_active(info, vc))
2705 + goto redraw_up;
2706 + switch (p->scrollmode) {
2707 + case SCROLL_MOVE:
2708 +@@ -1966,6 +1991,8 @@ static int fbcon_scroll(struct vc_data *
2709 + count = vc->vc_rows;
2710 + if (logo_shown >= 0)
2711 + goto redraw_down;
2712 ++ if (fbcon_decor_active(info, vc))
2713 ++ goto redraw_down;
2714 + switch (p->scrollmode) {
2715 + case SCROLL_MOVE:
2716 + fbcon_redraw_blit(vc, info, p, b - 1, b - t - count,
2717 +@@ -2114,6 +2141,13 @@ static void fbcon_bmove_rec(struct vc_da
2718 + }
2719 + return;
2720 + }
2721 ++
2722 ++ if (fbcon_decor_active(info, vc) && sy == dy && height == 1) {
2723 ++ /* must use slower redraw bmove to keep background pic intact */
2724 ++ fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width);
2725 ++ return;
2726 ++ }
2727 ++
2728 + ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx,
2729 + height, width);
2730 + }
2731 +@@ -2184,8 +2218,8 @@ static int fbcon_resize(struct vc_data *
2732 + var.yres = virt_h * virt_fh;
2733 + x_diff = info->var.xres - var.xres;
2734 + y_diff = info->var.yres - var.yres;
2735 +- if (x_diff < 0 || x_diff > virt_fw ||
2736 +- y_diff < 0 || y_diff > virt_fh) {
2737 ++ if ((x_diff < 0 || x_diff > virt_fw ||
2738 ++ y_diff < 0 || y_diff > virt_fh) && !vc->vc_decor.state) {
2739 + const struct fb_videomode *mode;
2740 +
2741 + DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
2742 +@@ -2221,6 +2255,19 @@ static int fbcon_switch(struct vc_data *
2743 +
2744 + info = registered_fb[con2fb_map[vc->vc_num]];
2745 + ops = info->fbcon_par;
2746 ++ prev_console = ops->currcon;
2747 ++ if (prev_console != -1)
2748 ++ old_info = registered_fb[con2fb_map[prev_console]];
2749 ++
2750 ++ if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
2751 ++ struct vc_data *vc_curr = vc_cons[prev_console].d;
2752 ++ if (vc_curr && fbcon_decor_active_vc(vc_curr)) {
2753 ++ /* Clear the screen to avoid displaying funky colors during
2754 ++ * palette updates. */
2755 ++ memset((u8*)info->screen_base + info->fix.line_length * info->var.yoffset,
2756 ++ 0, info->var.yres * info->fix.line_length);
2757 ++ }
2758 ++ }
2759 +
2760 + if (softback_top) {
2761 + if (softback_lines)
2762 +@@ -2239,9 +2286,6 @@ static int fbcon_switch(struct vc_data *
2763 + logo_shown = FBCON_LOGO_CANSHOW;
2764 + }
2765 +
2766 +- prev_console = ops->currcon;
2767 +- if (prev_console != -1)
2768 +- old_info = registered_fb[con2fb_map[prev_console]];
2769 + /*
2770 + * FIXME: If we have multiple fbdev's loaded, we need to
2771 + * update all info->currcon. Perhaps, we can place this
2772 +@@ -2279,6 +2323,18 @@ static int fbcon_switch(struct vc_data *
2773 + fbcon_del_cursor_timer(old_info);
2774 + }
2775 +
2776 ++ if (fbcon_decor_active_vc(vc)) {
2777 ++ struct vc_data *vc_curr = vc_cons[prev_console].d;
2778 ++
2779 ++ if (!vc_curr->vc_decor.theme ||
2780 ++ strcmp(vc->vc_decor.theme, vc_curr->vc_decor.theme) ||
2781 ++ (fbcon_decor_active_nores(info, vc_curr) &&
2782 ++ !fbcon_decor_active(info, vc_curr))) {
2783 ++ if (fbcon_decor_call_helper("modechange", vc->vc_num))
2784 ++ fbcon_decor_disable(vc, 0);
2785 ++ }
2786 ++ }
2787 ++
2788 + if (fbcon_is_inactive(vc, info) ||
2789 + ops->blank_state != FB_BLANK_UNBLANK)
2790 + fbcon_del_cursor_timer(info);
2791 +@@ -2387,15 +2443,20 @@ static int fbcon_blank(struct vc_data *v
2792 + info->fbops->fb_restore_state(info);
2793 + }
2794 +
2795 +- if (!fbcon_is_inactive(vc, info)) {
2796 ++ if (!fbcon_is_inactive(vc, info)) {
2797 + if (ops->blank_state != blank) {
2798 + ops->blank_state = blank;
2799 + fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
2800 + ops->cursor_flash = (!blank);
2801 +
2802 +- if (!(info->flags & FBINFO_MISC_USEREVENT))
2803 +- if (fb_blank(info, blank))
2804 +- fbcon_generic_blank(vc, info, blank);
2805 ++ if (!(info->flags & FBINFO_MISC_USEREVENT)) {
2806 ++ if (fb_blank(info, blank)) {
2807 ++ if (fbcon_decor_active(info, vc))
2808 ++ fbcon_decor_blank(vc, info, blank);
2809 ++ else
2810 ++ fbcon_generic_blank(vc, info, blank);
2811 ++ }
2812 ++ }
2813 + }
2814 +
2815 + if (!blank)
2816 +@@ -2546,13 +2607,22 @@ static int fbcon_do_set_font(struct vc_d
2817 + }
2818 +
2819 + if (resize) {
2820 ++ /* reset wrap/pan */
2821 + int cols, rows;
2822 +
2823 + cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres);
2824 + rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
2825 ++
2826 ++ info->var.xoffset = info->var.yoffset = p->yscroll = 0;
2827 ++ if (fbcon_decor_active(info, vc)) {
2828 ++ cols = vc->vc_decor.twidth;
2829 ++ rows = vc->vc_decor.theight;
2830 ++ }
2831 + cols /= w;
2832 + rows /= h;
2833 ++
2834 + vc_resize(vc, cols, rows);
2835 ++
2836 + if (CON_IS_VISIBLE(vc) && softback_buf)
2837 + fbcon_update_softback(vc);
2838 + } else if (CON_IS_VISIBLE(vc)
2839 +@@ -2681,7 +2751,7 @@ static int fbcon_set_palette(struct vc_d
2840 + int i, j, k, depth;
2841 + u8 val;
2842 +
2843 +- if (fbcon_is_inactive(vc, info))
2844 ++ if (fbcon_is_inactive(vc, info) || vc->vc_num != fg_console)
2845 + return -EINVAL;
2846 +
2847 + if (!CON_IS_VISIBLE(vc))
2848 +@@ -2707,7 +2777,49 @@ static int fbcon_set_palette(struct vc_d
2849 + } else
2850 + fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap);
2851 +
2852 +- return fb_set_cmap(&palette_cmap, info);
2853 ++ if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
2854 ++ info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
2855 ++
2856 ++ u16 *red, *green, *blue;
2857 ++ int minlen = min(min(info->var.red.length, info->var.green.length),
2858 ++ info->var.blue.length);
2859 ++ int h;
2860 ++
2861 ++ struct fb_cmap cmap = {
2862 ++ .start = 0,
2863 ++ .len = (1 << minlen),
2864 ++ .red = NULL,
2865 ++ .green = NULL,
2866 ++ .blue = NULL,
2867 ++ .transp = NULL
2868 ++ };
2869 ++
2870 ++ red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL);
2871 ++
2872 ++ if (!red)
2873 ++ goto out;
2874 ++
2875 ++ green = red + 256;
2876 ++ blue = green + 256;
2877 ++ cmap.red = red;
2878 ++ cmap.green = green;
2879 ++ cmap.blue = blue;
2880 ++
2881 ++ for (i = 0; i < cmap.len; i++) {
2882 ++ red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1);
2883 ++ }
2884 ++
2885 ++ h = fb_set_cmap(&cmap, info);
2886 ++ fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d);
2887 ++ kfree(red);
2888 ++
2889 ++ return h;
2890 ++
2891 ++ } else if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
2892 ++ info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL)
2893 ++ fb_set_cmap(&info->bgdecor.cmap, info);
2894 ++
2895 ++out: return fb_set_cmap(&palette_cmap, info);
2896 + }
2897 +
2898 + static u16 *fbcon_screen_pos(struct vc_data *vc, int offset)
2899 +@@ -2933,7 +3045,14 @@ static void fbcon_modechanged(struct fb_
2900 + rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
2901 + cols /= vc->vc_font.width;
2902 + rows /= vc->vc_font.height;
2903 +- vc_resize(vc, cols, rows);
2904 ++
2905 ++ if (!fbcon_decor_active_nores(info, vc)) {
2906 ++ vc_resize(vc, cols, rows);
2907 ++ } else {
2908 ++ if (fbcon_decor_call_helper("modechange", vc->vc_num))
2909 ++ fbcon_decor_disable(vc, 0);
2910 ++ }
2911 ++
2912 + updatescrollmode(p, info, vc);
2913 + scrollback_max = 0;
2914 + scrollback_current = 0;
2915 +@@ -3567,6 +3686,7 @@ static void fbcon_exit(void)
2916 + }
2917 + }
2918 +
2919 ++ fbcon_decor_exit();
2920 + fbcon_has_exited = 1;
2921 + }
2922 +
2923 +diff -Naurp 2.6.28-orig/drivers/video/console/fbcondecor.c 2.6.28/drivers/video/console/fbcondecor.c
2924 +--- 2.6.28-orig/drivers/video/console/fbcondecor.c 1970-01-01 01:00:00.000000000 +0100
2925 ++++ 2.6.28/drivers/video/console/fbcondecor.c 2009-01-08 22:24:40.000000000 +0100
2926 +@@ -0,0 +1,433 @@
2927 ++/*
2928 ++ * linux/drivers/video/console/fbcondecor.c -- Framebuffer console decorations
2929 ++ *
2930 ++ * Copyright (C) 2004 Michal Januszewski <spock@g.o>
2931 ++ *
2932 ++ * Code based upon "Bootsplash" (C) 2001-2003
2933 ++ * Volker Poplawski <volker@×××××××××.de>,
2934 ++ * Stefan Reinauer <stepan@××××.de>,
2935 ++ * Steffen Winterfeldt <snwint@××××.de>,
2936 ++ * Michael Schroeder <mls@××××.de>,
2937 ++ * Ken Wimer <wimer@××××.de>.
2938 ++ *
2939 ++ * This file is subject to the terms and conditions of the GNU General Public
2940 ++ * License. See the file COPYING in the main directory of this archive for
2941 ++ * more details.
2942 ++ *
2943 ++ */
2944 ++#include <linux/module.h>
2945 ++#include <linux/kernel.h>
2946 ++#include <linux/string.h>
2947 ++#include <linux/types.h>
2948 ++#include <linux/fb.h>
2949 ++#include <linux/vt_kern.h>
2950 ++#include <linux/vmalloc.h>
2951 ++#include <linux/unistd.h>
2952 ++#include <linux/syscalls.h>
2953 ++#include <linux/init.h>
2954 ++#include <linux/proc_fs.h>
2955 ++#include <linux/workqueue.h>
2956 ++#include <linux/kmod.h>
2957 ++#include <linux/miscdevice.h>
2958 ++#include <linux/device.h>
2959 ++#include <linux/fs.h>
2960 ++
2961 ++#include <asm/uaccess.h>
2962 ++#include <asm/irq.h>
2963 ++#include <asm/system.h>
2964 ++
2965 ++#include "fbcon.h"
2966 ++#include "fbcondecor.h"
2967 ++
2968 ++extern signed char con2fb_map[];
2969 ++static int fbcon_decor_enable(struct vc_data *vc);
2970 ++char fbcon_decor_path[KMOD_PATH_LEN] = "/sbin/fbcondecor_helper";
2971 ++static int initialized = 0;
2972 ++
2973 ++int fbcon_decor_call_helper(char* cmd, unsigned short vc)
2974 ++{
2975 ++ char *envp[] = {
2976 ++ "HOME=/",
2977 ++ "PATH=/sbin:/bin",
2978 ++ NULL
2979 ++ };
2980 ++
2981 ++ char tfb[5];
2982 ++ char tcons[5];
2983 ++ unsigned char fb = (int) con2fb_map[vc];
2984 ++
2985 ++ char *argv[] = {
2986 ++ fbcon_decor_path,
2987 ++ "2",
2988 ++ cmd,
2989 ++ tcons,
2990 ++ tfb,
2991 ++ vc_cons[vc].d->vc_decor.theme,
2992 ++ NULL
2993 ++ };
2994 ++
2995 ++ snprintf(tfb,5,"%d",fb);
2996 ++ snprintf(tcons,5,"%d",vc);
2997 ++
2998 ++ return call_usermodehelper(fbcon_decor_path, argv, envp, 1);
2999 ++}
3000 ++
3001 ++/* Disables fbcondecor on a virtual console; called with console sem held. */
3002 ++int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw)
3003 ++{
3004 ++ struct fb_info* info;
3005 ++
3006 ++ if (!vc->vc_decor.state)
3007 ++ return -EINVAL;
3008 ++
3009 ++ info = registered_fb[(int) con2fb_map[vc->vc_num]];
3010 ++
3011 ++ if (info == NULL)
3012 ++ return -EINVAL;
3013 ++
3014 ++ vc->vc_decor.state = 0;
3015 ++ vc_resize(vc, info->var.xres / vc->vc_font.width,
3016 ++ info->var.yres / vc->vc_font.height);
3017 ++
3018 ++ if (fg_console == vc->vc_num && redraw) {
3019 ++ redraw_screen(vc, 0);
3020 ++ update_region(vc, vc->vc_origin +
3021 ++ vc->vc_size_row * vc->vc_top,
3022 ++ vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
3023 ++ }
3024 ++
3025 ++ printk(KERN_INFO "fbcondecor: switched decor state to 'off' on console %d\n",
3026 ++ vc->vc_num);
3027 ++
3028 ++ return 0;
3029 ++}
3030 ++
3031 ++/* Enables fbcondecor on a virtual console; called with console sem held. */
3032 ++static int fbcon_decor_enable(struct vc_data *vc)
3033 ++{
3034 ++ struct fb_info* info;
3035 ++
3036 ++ info = registered_fb[(int) con2fb_map[vc->vc_num]];
3037 ++
3038 ++ if (vc->vc_decor.twidth == 0 || vc->vc_decor.theight == 0 ||
3039 ++ info == NULL || vc->vc_decor.state || (!info->bgdecor.data &&
3040 ++ vc->vc_num == fg_console))
3041 ++ return -EINVAL;
3042 ++
3043 ++ vc->vc_decor.state = 1;
3044 ++ vc_resize(vc, vc->vc_decor.twidth / vc->vc_font.width,
3045 ++ vc->vc_decor.theight / vc->vc_font.height);
3046 ++
3047 ++ if (fg_console == vc->vc_num) {
3048 ++ redraw_screen(vc, 0);
3049 ++ update_region(vc, vc->vc_origin +
3050 ++ vc->vc_size_row * vc->vc_top,
3051 ++ vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
3052 ++ fbcon_decor_clear_margins(vc, info, 0);
3053 ++ }
3054 ++
3055 ++ printk(KERN_INFO "fbcondecor: switched decor state to 'on' on console %d\n",
3056 ++ vc->vc_num);
3057 ++
3058 ++ return 0;
3059 ++}
3060 ++
3061 ++static inline int fbcon_decor_ioctl_dosetstate(struct vc_data *vc, unsigned int __user* state, unsigned char origin)
3062 ++{
3063 ++ int tmp, ret;
3064 ++
3065 ++ if (get_user(tmp, state))
3066 ++ return -EFAULT;
3067 ++
3068 ++ if (origin == FBCON_DECOR_IO_ORIG_USER)
3069 ++ acquire_console_sem();
3070 ++ if (!tmp)
3071 ++ ret = fbcon_decor_disable(vc, 1);
3072 ++ else
3073 ++ ret = fbcon_decor_enable(vc);
3074 ++ if (origin == FBCON_DECOR_IO_ORIG_USER)
3075 ++ release_console_sem();
3076 ++
3077 ++ return ret;
3078 ++}
3079 ++
3080 ++static inline int fbcon_decor_ioctl_dogetstate(struct vc_data *vc, unsigned int __user *state)
3081 ++{
3082 ++ return put_user(vc->vc_decor.state, (unsigned int __user*) state);
3083 ++}
3084 ++
3085 ++static int fbcon_decor_ioctl_dosetcfg(struct vc_data *vc, struct vc_decor __user *arg, unsigned char origin)
3086 ++{
3087 ++ struct vc_decor cfg;
3088 ++ struct fb_info *info;
3089 ++ int len;
3090 ++ char *tmp;
3091 ++
3092 ++ info = registered_fb[(int) con2fb_map[vc->vc_num]];
3093 ++
3094 ++ if (copy_from_user(&cfg, arg, sizeof(struct vc_decor)))
3095 ++ return -EFAULT;
3096 ++ if (info == NULL || !cfg.twidth || !cfg.theight ||
3097 ++ cfg.tx + cfg.twidth > info->var.xres ||
3098 ++ cfg.ty + cfg.theight > info->var.yres)
3099 ++ return -EINVAL;
3100 ++
3101 ++ len = strlen_user(cfg.theme);
3102 ++ if (!len || len > FBCON_DECOR_THEME_LEN)
3103 ++ return -EINVAL;
3104 ++ tmp = kmalloc(len, GFP_KERNEL);
3105 ++ if (!tmp)
3106 ++ return -ENOMEM;
3107 ++ if (copy_from_user(tmp, (void __user *)cfg.theme, len))
3108 ++ return -EFAULT;
3109 ++ cfg.theme = tmp;
3110 ++ cfg.state = 0;
3111 ++
3112 ++ /* If this ioctl is a response to a request from kernel, the console sem
3113 ++ * is already held; we also don't need to disable decor because either the
3114 ++ * new config and background picture will be successfully loaded, and the
3115 ++ * decor will stay on, or in case of a failure it'll be turned off in fbcon. */
3116 ++ if (origin == FBCON_DECOR_IO_ORIG_USER) {
3117 ++ acquire_console_sem();
3118 ++ if (vc->vc_decor.state)
3119 ++ fbcon_decor_disable(vc, 1);
3120 ++ }
3121 ++
3122 ++ if (vc->vc_decor.theme)
3123 ++ kfree(vc->vc_decor.theme);
3124 ++
3125 ++ vc->vc_decor = cfg;
3126 ++
3127 ++ if (origin == FBCON_DECOR_IO_ORIG_USER)
3128 ++ release_console_sem();
3129 ++
3130 ++ printk(KERN_INFO "fbcondecor: console %d using theme '%s'\n",
3131 ++ vc->vc_num, vc->vc_decor.theme);
3132 ++ return 0;
3133 ++}
3134 ++
3135 ++static int fbcon_decor_ioctl_dogetcfg(struct vc_data *vc, struct vc_decor __user *arg)
3136 ++{
3137 ++ struct vc_decor decor;
3138 ++ char __user *tmp;
3139 ++
3140 ++ if (get_user(tmp, &arg->theme))
3141 ++ return -EFAULT;
3142 ++
3143 ++ decor = vc->vc_decor;
3144 ++ decor.theme = tmp;
3145 ++
3146 ++ if (vc->vc_decor.theme) {
3147 ++ if (copy_to_user(tmp, vc->vc_decor.theme, strlen(vc->vc_decor.theme) + 1))
3148 ++ return -EFAULT;
3149 ++ } else
3150 ++ if (put_user(0, tmp))
3151 ++ return -EFAULT;
3152 ++
3153 ++ if (copy_to_user(arg, &decor, sizeof(struct vc_decor)))
3154 ++ return -EFAULT;
3155 ++
3156 ++ return 0;
3157 ++}
3158 ++
3159 ++static int fbcon_decor_ioctl_dosetpic(struct vc_data *vc, struct fb_image __user *arg, unsigned char origin)
3160 ++{
3161 ++ struct fb_image img;
3162 ++ struct fb_info *info;
3163 ++ int len;
3164 ++ u8 *tmp;
3165 ++
3166 ++ if (vc->vc_num != fg_console)
3167 ++ return -EINVAL;
3168 ++
3169 ++ info = registered_fb[(int) con2fb_map[vc->vc_num]];
3170 ++
3171 ++ if (info == NULL)
3172 ++ return -EINVAL;
3173 ++
3174 ++ if (copy_from_user(&img, arg, sizeof(struct fb_image)))
3175 ++ return -EFAULT;
3176 ++
3177 ++ if (img.width != info->var.xres || img.height != info->var.yres) {
3178 ++ printk(KERN_ERR "fbcondecor: picture dimensions mismatch\n");
3179 ++ return -EINVAL;
3180 ++ }
3181 ++
3182 ++ if (img.depth != info->var.bits_per_pixel) {
3183 ++ printk(KERN_ERR "fbcondecor: picture depth mismatch\n");
3184 ++ return -EINVAL;
3185 ++ }
3186 ++
3187 ++ if (img.depth == 8) {
3188 ++ if (!img.cmap.len || !img.cmap.red || !img.cmap.green ||
3189 ++ !img.cmap.blue)
3190 ++ return -EINVAL;
3191 ++
3192 ++ tmp = vmalloc(img.cmap.len * 3 * 2);
3193 ++ if (!tmp)
3194 ++ return -ENOMEM;
3195 ++
3196 ++ if (copy_from_user(tmp, (void __user*)img.cmap.red, img.cmap.len * 2) ||
3197 ++ copy_from_user(tmp + (img.cmap.len << 1),
3198 ++ (void __user*)img.cmap.green, (img.cmap.len << 1)) ||
3199 ++ copy_from_user(tmp + (img.cmap.len << 2),
3200 ++ (void __user*)img.cmap.blue, (img.cmap.len << 1))) {
3201 ++ vfree(tmp);
3202 ++ return -EFAULT;
3203 ++ }
3204 ++
3205 ++ img.cmap.transp = NULL;
3206 ++ img.cmap.red = (u16*)tmp;
3207 ++ img.cmap.green = img.cmap.red + img.cmap.len;
3208 ++ img.cmap.blue = img.cmap.green + img.cmap.len;
3209 ++ } else {
3210 ++ img.cmap.red = NULL;
3211 ++ }
3212 ++
3213 ++ len = ((img.depth + 7) >> 3) * img.width * img.height;
3214 ++
3215 ++ /*
3216 ++ * Allocate an additional byte so that we never go outside of the
3217 ++ * buffer boundaries in the rendering functions in a 24 bpp mode.
3218 ++ */
3219 ++ tmp = vmalloc(len + 1);
3220 ++
3221 ++ if (!tmp)
3222 ++ goto out;
3223 ++
3224 ++ if (copy_from_user(tmp, (void __user*)img.data, len))
3225 ++ goto out;
3226 ++
3227 ++ img.data = tmp;
3228 ++
3229 ++ /* If this ioctl is a response to a request from kernel, the console sem
3230 ++ * is already held. */
3231 ++ if (origin == FBCON_DECOR_IO_ORIG_USER)
3232 ++ acquire_console_sem();
3233 ++
3234 ++ if (info->bgdecor.data)
3235 ++ vfree((u8*)info->bgdecor.data);
3236 ++ if (info->bgdecor.cmap.red)
3237 ++ vfree(info->bgdecor.cmap.red);
3238 ++
3239 ++ info->bgdecor = img;
3240 ++
3241 ++ if (fbcon_decor_active_vc(vc) && fg_console == vc->vc_num) {
3242 ++ redraw_screen(vc, 0);
3243 ++ update_region(vc, vc->vc_origin +
3244 ++ vc->vc_size_row * vc->vc_top,
3245 ++ vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
3246 ++ fbcon_decor_clear_margins(vc, info, 0);
3247 ++ }
3248 ++
3249 ++ if (origin == FBCON_DECOR_IO_ORIG_USER)
3250 ++ release_console_sem();
3251 ++
3252 ++ return 0;
3253 ++
3254 ++out: if (img.cmap.red)
3255 ++ vfree(img.cmap.red);
3256 ++ if (tmp)
3257 ++ vfree(tmp);
3258 ++ return -ENOMEM;
3259 ++}
3260 ++
3261 ++static int fbcon_decor_ioctl(struct inode * inode, struct file *filp, u_int cmd,
3262 ++ u_long arg)
3263 ++{
3264 ++ struct fbcon_decor_iowrapper __user *wrapper = (void __user*) arg;
3265 ++ struct vc_data *vc = NULL;
3266 ++ unsigned short vc_num = 0;
3267 ++ unsigned char origin = 0;
3268 ++ void __user *data = NULL;
3269 ++
3270 ++ if (!access_ok(VERIFY_READ, wrapper,
3271 ++ sizeof(struct fbcon_decor_iowrapper)))
3272 ++ return -EFAULT;
3273 ++
3274 ++ __get_user(vc_num, &wrapper->vc);
3275 ++ __get_user(origin, &wrapper->origin);
3276 ++ __get_user(data, &wrapper->data);
3277 ++
3278 ++ if (!vc_cons_allocated(vc_num))
3279 ++ return -EINVAL;
3280 ++
3281 ++ vc = vc_cons[vc_num].d;
3282 ++
3283 ++ switch (cmd) {
3284 ++ case FBIOCONDECOR_SETPIC:
3285 ++ return fbcon_decor_ioctl_dosetpic(vc, (struct fb_image __user*)data, origin);
3286 ++ case FBIOCONDECOR_SETCFG:
3287 ++ return fbcon_decor_ioctl_dosetcfg(vc, (struct vc_decor*)data, origin);
3288 ++ case FBIOCONDECOR_GETCFG:
3289 ++ return fbcon_decor_ioctl_dogetcfg(vc, (struct vc_decor*)data);
3290 ++ case FBIOCONDECOR_SETSTATE:
3291 ++ return fbcon_decor_ioctl_dosetstate(vc, (unsigned int *)data, origin);
3292 ++ case FBIOCONDECOR_GETSTATE:
3293 ++ return fbcon_decor_ioctl_dogetstate(vc, (unsigned int *)data);
3294 ++ default:
3295 ++ return -ENOIOCTLCMD;
3296 ++ }
3297 ++}
3298 ++
3299 ++static struct file_operations fbcon_decor_ops = {
3300 ++ .owner = THIS_MODULE,
3301 ++ .ioctl = fbcon_decor_ioctl
3302 ++};
3303 ++
3304 ++static struct miscdevice fbcon_decor_dev = {
3305 ++ .minor = MISC_DYNAMIC_MINOR,
3306 ++ .name = "fbcondecor",
3307 ++ .fops = &fbcon_decor_ops
3308 ++};
3309 ++
3310 ++void fbcon_decor_reset(void)
3311 ++{
3312 ++ struct fb_info *info;
3313 ++ struct vc_data *vc;
3314 ++ int i;
3315 ++
3316 ++ vc = vc_cons[0].d;
3317 ++ info = registered_fb[0];
3318 ++
3319 ++ for (i = 0; i < num_registered_fb; i++) {
3320 ++ registered_fb[i]->bgdecor.data = NULL;
3321 ++ registered_fb[i]->bgdecor.cmap.red = NULL;
3322 ++ }
3323 ++
3324 ++ for (i = 0; i < MAX_NR_CONSOLES && vc_cons[i].d; i++) {
3325 ++ vc_cons[i].d->vc_decor.state = vc_cons[i].d->vc_decor.twidth =
3326 ++ vc_cons[i].d->vc_decor.theight = 0;
3327 ++ vc_cons[i].d->vc_decor.theme = NULL;
3328 ++ }
3329 ++
3330 ++ return;
3331 ++}
3332 ++
3333 ++int fbcon_decor_init(void)
3334 ++{
3335 ++ int i;
3336 ++
3337 ++ fbcon_decor_reset();
3338 ++
3339 ++ if (initialized)
3340 ++ return 0;
3341 ++
3342 ++ i = misc_register(&fbcon_decor_dev);
3343 ++ if (i) {
3344 ++ printk(KERN_ERR "fbcondecor: failed to register device\n");
3345 ++ return i;
3346 ++ }
3347 ++
3348 ++ fbcon_decor_call_helper("init", 0);
3349 ++ initialized = 1;
3350 ++ return 0;
3351 ++}
3352 ++
3353 ++int fbcon_decor_exit(void)
3354 ++{
3355 ++ fbcon_decor_reset();
3356 ++ return 0;
3357 ++}
3358 ++
3359 ++EXPORT_SYMBOL(fbcon_decor_path);
3360 +diff -Naurp 2.6.28-orig/drivers/video/console/fbcondecor.h 2.6.28/drivers/video/console/fbcondecor.h
3361 +--- 2.6.28-orig/drivers/video/console/fbcondecor.h 1970-01-01 01:00:00.000000000 +0100
3362 ++++ 2.6.28/drivers/video/console/fbcondecor.h 2009-01-08 22:19:03.000000000 +0100
3363 +@@ -0,0 +1,78 @@
3364 ++/*
3365 ++ * linux/drivers/video/console/fbcondecor.h -- Framebuffer Console Decoration headers
3366 ++ *
3367 ++ * Copyright (C) 2004 Michal Januszewski <spock@g.o>
3368 ++ *
3369 ++ */
3370 ++
3371 ++#ifndef __FBCON_DECOR_H
3372 ++#define __FBCON_DECOR_H
3373 ++
3374 ++#ifndef _LINUX_FB_H
3375 ++#include <linux/fb.h>
3376 ++#endif
3377 ++
3378 ++/* This is needed for vc_cons in fbcmap.c */
3379 ++#include <linux/vt_kern.h>
3380 ++
3381 ++struct fb_cursor;
3382 ++struct fb_info;
3383 ++struct vc_data;
3384 ++
3385 ++#ifdef CONFIG_FB_CON_DECOR
3386 ++/* fbcondecor.c */
3387 ++int fbcon_decor_init(void);
3388 ++int fbcon_decor_exit(void);
3389 ++int fbcon_decor_call_helper(char* cmd, unsigned short cons);
3390 ++int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw);
3391 ++
3392 ++/* cfbcondecor.c */
3393 ++void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info, const unsigned short *s, int count, int yy, int xx);
3394 ++void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor);
3395 ++void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width);
3396 ++void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info, int bottom_only);
3397 ++void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank);
3398 ++void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y, int sx, int dx, int width);
3399 ++void fbcon_decor_copy(u8 *dst, u8 *src, int height, int width, int linebytes, int srclinesbytes, int bpp);
3400 ++void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc);
3401 ++
3402 ++/* vt.c */
3403 ++void acquire_console_sem(void);
3404 ++void release_console_sem(void);
3405 ++void do_unblank_screen(int entering_gfx);
3406 ++
3407 ++/* struct vc_data *y */
3408 ++#define fbcon_decor_active_vc(y) (y->vc_decor.state && y->vc_decor.theme)
3409 ++
3410 ++/* struct fb_info *x, struct vc_data *y */
3411 ++#define fbcon_decor_active_nores(x,y) (x->bgdecor.data && fbcon_decor_active_vc(y))
3412 ++
3413 ++/* struct fb_info *x, struct vc_data *y */
3414 ++#define fbcon_decor_active(x,y) (fbcon_decor_active_nores(x,y) && \
3415 ++ x->bgdecor.width == x->var.xres && \
3416 ++ x->bgdecor.height == x->var.yres && \
3417 ++ x->bgdecor.depth == x->var.bits_per_pixel)
3418 ++
3419 ++
3420 ++#else /* CONFIG_FB_CON_DECOR */
3421 ++
3422 ++static inline void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info, const unsigned short *s, int count, int yy, int xx) {}
3423 ++static inline void fbcon_decor_putc(struct vc_data *vc, struct fb_info *info, int c, int ypos, int xpos) {}
3424 ++static inline void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor) {}
3425 ++static inline void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width) {}
3426 ++static inline void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info, int bottom_only) {}
3427 ++static inline void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank) {}
3428 ++static inline void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y, int sx, int dx, int width) {}
3429 ++static inline void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc) {}
3430 ++static inline int fbcon_decor_call_helper(char* cmd, unsigned short cons) { return 0; }
3431 ++static inline int fbcon_decor_init(void) { return 0; }
3432 ++static inline int fbcon_decor_exit(void) { return 0; }
3433 ++static inline int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw) { return 0; }
3434 ++
3435 ++#define fbcon_decor_active_vc(y) (0)
3436 ++#define fbcon_decor_active_nores(x,y) (0)
3437 ++#define fbcon_decor_active(x,y) (0)
3438 ++
3439 ++#endif /* CONFIG_FB_CON_DECOR */
3440 ++
3441 ++#endif /* __FBCON_DECOR_H */
3442 +diff -Naurp 2.6.28-orig/drivers/video/console/Kconfig 2.6.28/drivers/video/console/Kconfig
3443 +--- 2.6.28-orig/drivers/video/console/Kconfig 2009-01-08 22:16:55.000000000 +0100
3444 ++++ 2.6.28/drivers/video/console/Kconfig 2009-01-08 22:19:03.000000000 +0100
3445 +@@ -128,6 +128,19 @@ config FRAMEBUFFER_CONSOLE_ROTATION
3446 + such that other users of the framebuffer will remain normally
3447 + oriented.
3448 +
3449 ++config FB_CON_DECOR
3450 ++ bool "Support for the Framebuffer Console Decorations"
3451 ++ depends on FRAMEBUFFER_CONSOLE=y && !FB_TILEBLITTING
3452 ++ default n
3453 ++ ---help---
3454 ++ This option enables support for framebuffer console decorations which
3455 ++ makes it possible to display images in the background of the system
3456 ++ consoles. Note that userspace utilities are necessary in order to take
3457 ++ advantage of these features. Refer to Documentation/fb/fbcondecor.txt
3458 ++ for more information.
3459 ++
3460 ++ If unsure, say N.
3461 ++
3462 + config STI_CONSOLE
3463 + bool "STI text console"
3464 + depends on PARISC
3465 +diff -Naurp 2.6.28-orig/drivers/video/console/Makefile 2.6.28/drivers/video/console/Makefile
3466 +--- 2.6.28-orig/drivers/video/console/Makefile 2009-01-08 22:16:55.000000000 +0100
3467 ++++ 2.6.28/drivers/video/console/Makefile 2009-01-08 22:19:03.000000000 +0100
3468 +@@ -35,6 +35,7 @@ obj-$(CONFIG_FRAMEBUFFER_CONSOLE) +=
3469 + fbcon_ccw.o
3470 + endif
3471 +
3472 ++obj-$(CONFIG_FB_CON_DECOR) += fbcondecor.o cfbcondecor.o
3473 + obj-$(CONFIG_FB_STI) += sticore.o font.o
3474 +
3475 + ifeq ($(CONFIG_USB_SISUSBVGA_CON),y)
3476 +diff -Naurp 2.6.28-orig/drivers/video/fbcmap.c 2.6.28/drivers/video/fbcmap.c
3477 +--- 2.6.28-orig/drivers/video/fbcmap.c 2009-01-08 22:16:55.000000000 +0100
3478 ++++ 2.6.28/drivers/video/fbcmap.c 2009-01-08 22:19:03.000000000 +0100
3479 +@@ -17,6 +17,8 @@
3480 + #include <linux/slab.h>
3481 + #include <linux/uaccess.h>
3482 +
3483 ++#include "console/fbcondecor.h"
3484 ++
3485 + static u16 red2[] __read_mostly = {
3486 + 0x0000, 0xaaaa
3487 + };
3488 +@@ -234,14 +236,17 @@ int fb_set_cmap(struct fb_cmap *cmap, st
3489 + if (transp)
3490 + htransp = *transp++;
3491 + if (info->fbops->fb_setcolreg(start++,
3492 +- hred, hgreen, hblue,
3493 ++ hred, hgreen, hblue,
3494 + htransp, info))
3495 + break;
3496 + }
3497 + }
3498 +- if (rc == 0)
3499 ++ if (rc == 0) {
3500 + fb_copy_cmap(cmap, &info->cmap);
3501 +-
3502 ++ if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
3503 ++ info->fix.visual == FB_VISUAL_DIRECTCOLOR)
3504 ++ fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d);
3505 ++ }
3506 + return rc;
3507 + }
3508 +
3509 +diff -Naurp 2.6.28-orig/drivers/video/Kconfig 2.6.28/drivers/video/Kconfig
3510 +--- 2.6.28-orig/drivers/video/Kconfig 2009-01-08 22:16:55.000000000 +0100
3511 ++++ 2.6.28/drivers/video/Kconfig 2009-01-08 22:19:03.000000000 +0100
3512 +@@ -1166,7 +1166,6 @@ config FB_MATROX
3513 + select FB_CFB_FILLRECT
3514 + select FB_CFB_COPYAREA
3515 + select FB_CFB_IMAGEBLIT
3516 +- select FB_TILEBLITTING
3517 + select FB_MACMODES if PPC_PMAC
3518 + ---help---
3519 + Say Y here if you have a Matrox Millennium, Matrox Millennium II,
3520 +diff -Naurp 2.6.28-orig/include/linux/console_decor.h 2.6.28/include/linux/console_decor.h
3521 +--- 2.6.28-orig/include/linux/console_decor.h 1970-01-01 01:00:00.000000000 +0100
3522 ++++ 2.6.28/include/linux/console_decor.h 2009-01-08 22:19:03.000000000 +0100
3523 +@@ -0,0 +1,13 @@
3524 ++#ifndef _LINUX_CONSOLE_DECOR_H_
3525 ++#define _LINUX_CONSOLE_DECOR_H_ 1
3526 ++
3527 ++/* A structure used by the framebuffer console decorations (drivers/video/console/fbcondecor.c) */
3528 ++struct vc_decor {
3529 ++ __u8 bg_color; /* The color that is to be treated as transparent */
3530 ++ __u8 state; /* Current decor state: 0 = off, 1 = on */
3531 ++ __u16 tx, ty; /* Top left corner coordinates of the text field */
3532 ++ __u16 twidth, theight; /* Width and height of the text field */
3533 ++ char* theme;
3534 ++};
3535 ++
3536 ++#endif
3537 +diff -Naurp 2.6.28-orig/include/linux/console_struct.h 2.6.28/include/linux/console_struct.h
3538 +--- 2.6.28-orig/include/linux/console_struct.h 2009-01-08 22:17:09.000000000 +0100
3539 ++++ 2.6.28/include/linux/console_struct.h 2009-01-08 22:19:03.000000000 +0100
3540 +@@ -19,6 +19,7 @@
3541 + struct vt_struct;
3542 +
3543 + #define NPAR 16
3544 ++#include <linux/console_decor.h>
3545 +
3546 + struct vc_data {
3547 + unsigned short vc_num; /* Console number */
3548 +@@ -106,6 +107,8 @@ struct vc_data {
3549 + struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
3550 + unsigned long vc_uni_pagedir;
3551 + unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
3552 ++
3553 ++ struct vc_decor vc_decor;
3554 + /* additional information is in vt_kern.h */
3555 + };
3556 +
3557 +diff -Naurp 2.6.28-orig/include/linux/fb.h 2.6.28/include/linux/fb.h
3558 +--- 2.6.28-orig/include/linux/fb.h 2009-01-08 22:17:09.000000000 +0100
3559 ++++ 2.6.28/include/linux/fb.h 2009-01-08 22:19:03.000000000 +0100
3560 +@@ -10,6 +10,13 @@ struct dentry;
3561 +
3562 + #define FB_MAX 32 /* sufficient for now */
3563 +
3564 ++struct fbcon_decor_iowrapper
3565 ++{
3566 ++ unsigned short vc; /* Virtual console */
3567 ++ unsigned char origin; /* Point of origin of the request */
3568 ++ void *data;
3569 ++};
3570 ++
3571 + /* ioctls
3572 + 0x46 is 'F' */
3573 + #define FBIOGET_VSCREENINFO 0x4600
3574 +@@ -37,7 +44,15 @@ struct dentry;
3575 + #define FBIOGET_HWCINFO 0x4616
3576 + #define FBIOPUT_MODEINFO 0x4617
3577 + #define FBIOGET_DISPINFO 0x4618
3578 +-
3579 ++#define FBIOCONDECOR_SETCFG _IOWR('F', 0x19, struct fbcon_decor_iowrapper)
3580 ++#define FBIOCONDECOR_GETCFG _IOR('F', 0x1A, struct fbcon_decor_iowrapper)
3581 ++#define FBIOCONDECOR_SETSTATE _IOWR('F', 0x1B, struct fbcon_decor_iowrapper)
3582 ++#define FBIOCONDECOR_GETSTATE _IOR('F', 0x1C, struct fbcon_decor_iowrapper)
3583 ++#define FBIOCONDECOR_SETPIC _IOWR('F', 0x1D, struct fbcon_decor_iowrapper)
3584 ++
3585 ++#define FBCON_DECOR_THEME_LEN 128 /* Maximum lenght of a theme name */
3586 ++#define FBCON_DECOR_IO_ORIG_KERNEL 0 /* Kernel ioctl origin */
3587 ++#define FBCON_DECOR_IO_ORIG_USER 1 /* User ioctl origin */
3588 +
3589 + #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
3590 + #define FB_TYPE_PLANES 1 /* Non interleaved planes */
3591 +@@ -848,6 +863,9 @@ struct fb_info {
3592 + #define FBINFO_STATE_SUSPENDED 1
3593 + u32 state; /* Hardware state i.e suspend */
3594 + void *fbcon_par; /* fbcon use-only private area */
3595 ++
3596 ++ struct fb_image bgdecor;
3597 ++
3598 + /* From here on everything is device dependent */
3599 + void *par;
3600 + };
3601 +diff -Naurp 2.6.28-orig/kernel/sysctl.c 2.6.28/kernel/sysctl.c
3602 +--- 2.6.28-orig/kernel/sysctl.c 2009-01-08 22:16:58.000000000 +0100
3603 ++++ 2.6.28/kernel/sysctl.c 2009-01-08 22:19:03.000000000 +0100
3604 +@@ -113,6 +113,9 @@ static int ngroups_max = NGROUPS_MAX;
3605 + #ifdef CONFIG_MODULES
3606 + extern char modprobe_path[];
3607 + #endif
3608 ++#ifdef CONFIG_FB_CON_DECOR
3609 ++extern char fbcon_decor_path[];
3610 ++#endif
3611 + #ifdef CONFIG_CHR_DEV_SG
3612 + extern int sg_big_buff;
3613 + #endif
3614 +@@ -220,6 +223,18 @@ static struct ctl_table root_table[] = {
3615 + .mode = 0555,
3616 + .child = dev_table,
3617 + },
3618 ++#ifdef CONFIG_FB_CON_DECOR
3619 ++ {
3620 ++ .ctl_name = CTL_UNNUMBERED,
3621 ++ .procname = "fbcondecor",
3622 ++ .data = &fbcon_decor_path,
3623 ++ .maxlen = KMOD_PATH_LEN,
3624 ++ .mode = 0644,
3625 ++ .proc_handler = &proc_dostring,
3626 ++ .strategy = &sysctl_string,
3627 ++ },
3628 ++#endif
3629 ++
3630 + /*
3631 + * NOTE: do not add new entries to this table unless you have read
3632 + * Documentation/sysctl/ctl_unnumbered.txt