Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:3.15 commit in: /
Date: Fri, 20 Jun 2014 12:41:53
Message-Id: 1403268103.6f16cce99331f47372082f2a1400f9f0641058ee.mpagano@gentoo
1 commit: 6f16cce99331f47372082f2a1400f9f0641058ee
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Fri Jun 20 12:41:43 2014 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 20 12:41:43 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/linux-patches.git;a=commit;h=6f16cce9
7
8 Adding fbcondecor patch, thanks to Uladzimir Bely. See bug #513334.
9
10 ---
11 0000_README | 4 +
12 4200_fbcondecor-3.15.patch | 2119 ++++++++++++++++++++++++++++++++++++++++++++
13 2 files changed, 2123 insertions(+)
14
15 diff --git a/0000_README b/0000_README
16 index e7a078b..5737a82 100644
17 --- a/0000_README
18 +++ b/0000_README
19 @@ -67,6 +67,10 @@ Patch: 2905_s2disk-resume-image-fix.patch
20 From: Al Viro <viro <at> ZenIV.linux.org.uk>
21 Desc: Do not lock when UMH is waiting on current thread spawned by linuxrc. (bug #481344)
22
23 +Patch: 4200_fbcondecor-3.15.patch
24 +From: http://www.mepiscommunity.org/fbcondecor
25 +Desc: Bootsplash ported by Uladzimir Bely (bug #513334)
26 +
27 Patch: 4500_support-for-pogoplug-e02.patch
28 From: Cristoph Junghans <ottxor@g.o>
29 Desc: Support for Pogoplug e02 (bug #460350), adjusted to be opt-in by TomWij.
30
31 diff --git a/4200_fbcondecor-3.15.patch b/4200_fbcondecor-3.15.patch
32 new file mode 100644
33 index 0000000..c96e5dc
34 --- /dev/null
35 +++ b/4200_fbcondecor-3.15.patch
36 @@ -0,0 +1,2119 @@
37 +diff --git a/Documentation/fb/00-INDEX b/Documentation/fb/00-INDEX
38 +index fe85e7c..2230930 100644
39 +--- a/Documentation/fb/00-INDEX
40 ++++ b/Documentation/fb/00-INDEX
41 +@@ -23,6 +23,8 @@ ep93xx-fb.txt
42 + - info on the driver for EP93xx LCD controller.
43 + fbcon.txt
44 + - intro to and usage guide for the framebuffer console (fbcon).
45 ++fbcondecor.txt
46 ++ - info on the Framebuffer Console Decoration
47 + framebuffer.txt
48 + - introduction to frame buffer devices.
49 + gxfb.txt
50 +diff --git a/Documentation/fb/fbcondecor.txt b/Documentation/fb/fbcondecor.txt
51 +new file mode 100644
52 +index 0000000..3388c61
53 +--- /dev/null
54 ++++ b/Documentation/fb/fbcondecor.txt
55 +@@ -0,0 +1,207 @@
56 ++What is it?
57 ++-----------
58 ++
59 ++The framebuffer decorations are a kernel feature which allows displaying a
60 ++background picture on selected consoles.
61 ++
62 ++What do I need to get it to work?
63 ++---------------------------------
64 ++
65 ++To get fbcondecor up-and-running you will have to:
66 ++ 1) get a copy of splashutils [1] or a similar program
67 ++ 2) get some fbcondecor themes
68 ++ 3) build the kernel helper program
69 ++ 4) build your kernel with the FB_CON_DECOR option enabled.
70 ++
71 ++To get fbcondecor operational right after fbcon initialization is finished, you
72 ++will have to include a theme and the kernel helper into your initramfs image.
73 ++Please refer to splashutils documentation for instructions on how to do that.
74 ++
75 ++[1] The splashutils package can be downloaded from:
76 ++ http://github.com/alanhaggai/fbsplash
77 ++
78 ++The userspace helper
79 ++--------------------
80 ++
81 ++The userspace fbcondecor helper (by default: /sbin/fbcondecor_helper) is called by the
82 ++kernel whenever an important event occurs and the kernel needs some kind of
83 ++job to be carried out. Important events include console switches and video
84 ++mode switches (the kernel requests background images and configuration
85 ++parameters for the current console). The fbcondecor helper must be accessible at
86 ++all times. If it's not, fbcondecor will be switched off automatically.
87 ++
88 ++It's possible to set path to the fbcondecor helper by writing it to
89 ++/proc/sys/kernel/fbcondecor.
90 ++
91 ++*****************************************************************************
92 ++
93 ++The information below is mostly technical stuff. There's probably no need to
94 ++read it unless you plan to develop a userspace helper.
95 ++
96 ++The fbcondecor protocol
97 ++-----------------------
98 ++
99 ++The fbcondecor protocol defines a communication interface between the kernel and
100 ++the userspace fbcondecor helper.
101 ++
102 ++The kernel side is responsible for:
103 ++
104 ++ * rendering console text, using an image as a background (instead of a
105 ++ standard solid color fbcon uses),
106 ++ * accepting commands from the user via ioctls on the fbcondecor device,
107 ++ * calling the userspace helper to set things up as soon as the fb subsystem
108 ++ is initialized.
109 ++
110 ++The userspace helper is responsible for everything else, including parsing
111 ++configuration files, decompressing the image files whenever the kernel needs
112 ++it, and communicating with the kernel if necessary.
113 ++
114 ++The fbcondecor protocol specifies how communication is done in both ways:
115 ++kernel->userspace and userspace->helper.
116 ++
117 ++Kernel -> Userspace
118 ++-------------------
119 ++
120 ++The kernel communicates with the userspace helper by calling it and specifying
121 ++the task to be done in a series of arguments.
122 ++
123 ++The arguments follow the pattern:
124 ++<fbcondecor protocol version> <command> <parameters>
125 ++
126 ++All commands defined in fbcondecor protocol v2 have the following parameters:
127 ++ virtual console
128 ++ framebuffer number
129 ++ theme
130 ++
131 ++Fbcondecor protocol v1 specified an additional 'fbcondecor mode' after the
132 ++framebuffer number. Fbcondecor protocol v1 is deprecated and should not be used.
133 ++
134 ++Fbcondecor protocol v2 specifies the following commands:
135 ++
136 ++getpic
137 ++------
138 ++ The kernel issues this command to request image data. It's up to the
139 ++ userspace helper to find a background image appropriate for the specified
140 ++ theme and the current resolution. The userspace helper should respond by
141 ++ issuing the FBIOCONDECOR_SETPIC ioctl.
142 ++
143 ++init
144 ++----
145 ++ The kernel issues this command after the fbcondecor device is created and
146 ++ the fbcondecor interface is initialized. Upon receiving 'init', the userspace
147 ++ helper should parse the kernel command line (/proc/cmdline) or otherwise
148 ++ decide whether fbcondecor is to be activated.
149 ++
150 ++ To activate fbcondecor on the first console the helper should issue the
151 ++ FBIOCONDECOR_SETCFG, FBIOCONDECOR_SETPIC and FBIOCONDECOR_SETSTATE commands,
152 ++ in the above-mentioned order.
153 ++
154 ++ When the userspace helper is called in an early phase of the boot process
155 ++ (right after the initialization of fbcon), no filesystems will be mounted.
156 ++ The helper program should mount sysfs and then create the appropriate
157 ++ framebuffer, fbcondecor and tty0 devices (if they don't already exist) to get
158 ++ current display settings and to be able to communicate with the kernel side.
159 ++ It should probably also mount the procfs to be able to parse the kernel
160 ++ command line parameters.
161 ++
162 ++ Note that the console sem is not held when the kernel calls fbcondecor_helper
163 ++ with the 'init' command. The fbcondecor helper should perform all ioctls with
164 ++ origin set to FBCON_DECOR_IO_ORIG_USER.
165 ++
166 ++modechange
167 ++----------
168 ++ The kernel issues this command on a mode change. The helper's response should
169 ++ be similar to the response to the 'init' command. Note that this time the
170 ++ console sem is held and all ioctls must be performed with origin set to
171 ++ FBCON_DECOR_IO_ORIG_KERNEL.
172 ++
173 ++
174 ++Userspace -> Kernel
175 ++-------------------
176 ++
177 ++Userspace programs can communicate with fbcondecor via ioctls on the
178 ++fbcondecor device. These ioctls are to be used by both the userspace helper
179 ++(called only by the kernel) and userspace configuration tools (run by the users).
180 ++
181 ++The fbcondecor helper should set the origin field to FBCON_DECOR_IO_ORIG_KERNEL
182 ++when doing the appropriate ioctls. All userspace configuration tools should
183 ++use FBCON_DECOR_IO_ORIG_USER. Failure to set the appropriate value in the origin
184 ++field when performing ioctls from the kernel helper will most likely result
185 ++in a console deadlock.
186 ++
187 ++FBCON_DECOR_IO_ORIG_KERNEL instructs fbcondecor not to try to acquire the console
188 ++semaphore. Not surprisingly, FBCON_DECOR_IO_ORIG_USER instructs it to acquire
189 ++the console sem.
190 ++
191 ++The framebuffer console decoration provides the following ioctls (all defined in
192 ++linux/fb.h):
193 ++
194 ++FBIOCONDECOR_SETPIC
195 ++description: loads a background picture for a virtual console
196 ++argument: struct fbcon_decor_iowrapper*; data: struct fb_image*
197 ++notes:
198 ++If called for consoles other than the current foreground one, the picture data
199 ++will be ignored.
200 ++
201 ++If the current virtual console is running in a 8-bpp mode, the cmap substruct
202 ++of fb_image has to be filled appropriately: start should be set to 16 (first
203 ++16 colors are reserved for fbcon), len to a value <= 240 and red, green and
204 ++blue should point to valid cmap data. The transp field is ingored. The fields
205 ++dx, dy, bg_color, fg_color in fb_image are ignored as well.
206 ++
207 ++FBIOCONDECOR_SETCFG
208 ++description: sets the fbcondecor config for a virtual console
209 ++argument: struct fbcon_decor_iowrapper*; data: struct vc_decor*
210 ++notes: The structure has to be filled with valid data.
211 ++
212 ++FBIOCONDECOR_GETCFG
213 ++description: gets the fbcondecor config for a virtual console
214 ++argument: struct fbcon_decor_iowrapper*; data: struct vc_decor*
215 ++
216 ++FBIOCONDECOR_SETSTATE
217 ++description: sets the fbcondecor state for a virtual console
218 ++argument: struct fbcon_decor_iowrapper*; data: unsigned int*
219 ++ values: 0 = disabled, 1 = enabled.
220 ++
221 ++FBIOCONDECOR_GETSTATE
222 ++description: gets the fbcondecor state for a virtual console
223 ++argument: struct fbcon_decor_iowrapper*; data: unsigned int*
224 ++ values: as in FBIOCONDECOR_SETSTATE
225 ++
226 ++Info on used structures:
227 ++
228 ++Definition of struct vc_decor can be found in linux/console_decor.h. It's
229 ++heavily commented. Note that the 'theme' field should point to a string
230 ++no longer than FBCON_DECOR_THEME_LEN. When FBIOCONDECOR_GETCFG call is
231 ++performed, the theme field should point to a char buffer of length
232 ++FBCON_DECOR_THEME_LEN.
233 ++
234 ++Definition of struct fbcon_decor_iowrapper can be found in linux/fb.h.
235 ++The fields in this struct have the following meaning:
236 ++
237 ++vc:
238 ++Virtual console number.
239 ++
240 ++origin:
241 ++Specifies if the ioctl is performed as a response to a kernel request. The
242 ++fbcondecor helper should set this field to FBCON_DECOR_IO_ORIG_KERNEL, userspace
243 ++programs should set it to FBCON_DECOR_IO_ORIG_USER. This field is necessary to
244 ++avoid console semaphore deadlocks.
245 ++
246 ++data:
247 ++Pointer to a data structure appropriate for the performed ioctl. Type of
248 ++the data struct is specified in the ioctls description.
249 ++
250 ++*****************************************************************************
251 ++
252 ++Credit
253 ++------
254 ++
255 ++Original 'bootsplash' project & implementation by:
256 ++ Volker Poplawski <volker@×××××××××.de>, Stefan Reinauer <stepan@××××.de>,
257 ++ Steffen Winterfeldt <snwint@××××.de>, Michael Schroeder <mls@××××.de>,
258 ++ Ken Wimer <wimer@××××.de>.
259 ++
260 ++Fbcondecor, fbcondecor protocol design, current implementation & docs by:
261 ++ Michal Januszewski <michalj+fbcondecor@×××××.com>
262 ++
263 +diff --git a/drivers/Makefile b/drivers/Makefile
264 +index 7183b6a..d576148 100644
265 +--- a/drivers/Makefile
266 ++++ b/drivers/Makefile
267 +@@ -17,6 +17,10 @@ obj-y += pwm/
268 + obj-$(CONFIG_PCI) += pci/
269 + obj-$(CONFIG_PARISC) += parisc/
270 + obj-$(CONFIG_RAPIDIO) += rapidio/
271 ++# tty/ comes before char/ so that the VT console is the boot-time
272 ++# default.
273 ++obj-y += tty/
274 ++obj-y += char/
275 + obj-y += video/
276 + obj-y += idle/
277 +
278 +@@ -42,11 +46,6 @@ obj-$(CONFIG_REGULATOR) += regulator/
279 + # reset controllers early, since gpu drivers might rely on them to initialize
280 + obj-$(CONFIG_RESET_CONTROLLER) += reset/
281 +
282 +-# tty/ comes before char/ so that the VT console is the boot-time
283 +-# default.
284 +-obj-y += tty/
285 +-obj-y += char/
286 +-
287 + # gpu/ comes after char for AGP vs DRM startup
288 + obj-y += gpu/
289 +
290 +diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
291 +index fe1cd01..6d2e87a 100644
292 +--- a/drivers/video/console/Kconfig
293 ++++ b/drivers/video/console/Kconfig
294 +@@ -126,6 +126,19 @@ config FRAMEBUFFER_CONSOLE_ROTATION
295 + such that other users of the framebuffer will remain normally
296 + oriented.
297 +
298 ++config FB_CON_DECOR
299 ++ bool "Support for the Framebuffer Console Decorations"
300 ++ depends on FRAMEBUFFER_CONSOLE=y && !FB_TILEBLITTING
301 ++ default n
302 ++ ---help---
303 ++ This option enables support for framebuffer console decorations which
304 ++ makes it possible to display images in the background of the system
305 ++ consoles. Note that userspace utilities are necessary in order to take
306 ++ advantage of these features. Refer to Documentation/fb/fbcondecor.txt
307 ++ for more information.
308 ++
309 ++ If unsure, say N.
310 ++
311 + config STI_CONSOLE
312 + bool "STI text console"
313 + depends on PARISC
314 +diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile
315 +index 43bfa48..cc104b6 100644
316 +--- a/drivers/video/console/Makefile
317 ++++ b/drivers/video/console/Makefile
318 +@@ -16,4 +16,5 @@ obj-$(CONFIG_FRAMEBUFFER_CONSOLE) += fbcon_rotate.o fbcon_cw.o fbcon_ud.o \
319 + fbcon_ccw.o
320 + endif
321 +
322 ++obj-$(CONFIG_FB_CON_DECOR) += fbcondecor.o cfbcondecor.o
323 + obj-$(CONFIG_FB_STI) += sticore.o
324 +diff --git a/drivers/video/console/bitblit.c b/drivers/video/console/bitblit.c
325 +index 61b182b..984384b 100644
326 +--- a/drivers/video/console/bitblit.c
327 ++++ b/drivers/video/console/bitblit.c
328 +@@ -18,6 +18,7 @@
329 + #include <linux/console.h>
330 + #include <asm/types.h>
331 + #include "fbcon.h"
332 ++#include "fbcondecor.h"
333 +
334 + /*
335 + * Accelerated handlers.
336 +@@ -55,6 +56,13 @@ static void bit_bmove(struct vc_data *vc, struct fb_info *info, int sy,
337 + area.height = height * vc->vc_font.height;
338 + area.width = width * vc->vc_font.width;
339 +
340 ++ if (fbcon_decor_active(info, vc)) {
341 ++ area.sx += vc->vc_decor.tx;
342 ++ area.sy += vc->vc_decor.ty;
343 ++ area.dx += vc->vc_decor.tx;
344 ++ area.dy += vc->vc_decor.ty;
345 ++ }
346 ++
347 + info->fbops->fb_copyarea(info, &area);
348 + }
349 +
350 +@@ -380,11 +388,15 @@ static void bit_cursor(struct vc_data *vc, struct fb_info *info, int mode,
351 + cursor.image.depth = 1;
352 + cursor.rop = ROP_XOR;
353 +
354 +- if (info->fbops->fb_cursor)
355 +- err = info->fbops->fb_cursor(info, &cursor);
356 ++ if (fbcon_decor_active(info, vc)) {
357 ++ fbcon_decor_cursor(info, &cursor);
358 ++ } else {
359 ++ if (info->fbops->fb_cursor)
360 ++ err = info->fbops->fb_cursor(info, &cursor);
361 +
362 +- if (err)
363 +- soft_cursor(info, &cursor);
364 ++ if (err)
365 ++ soft_cursor(info, &cursor);
366 ++ }
367 +
368 + ops->cursor_reset = 0;
369 + }
370 +diff --git a/drivers/video/console/cfbcondecor.c b/drivers/video/console/cfbcondecor.c
371 +new file mode 100644
372 +index 0000000..a2b4497
373 +--- /dev/null
374 ++++ b/drivers/video/console/cfbcondecor.c
375 +@@ -0,0 +1,471 @@
376 ++/*
377 ++ * linux/drivers/video/cfbcon_decor.c -- Framebuffer decor render functions
378 ++ *
379 ++ * Copyright (C) 2004 Michal Januszewski <michalj+fbcondecor@×××××.com>
380 ++ *
381 ++ * Code based upon "Bootdecor" (C) 2001-2003
382 ++ * Volker Poplawski <volker@×××××××××.de>,
383 ++ * Stefan Reinauer <stepan@××××.de>,
384 ++ * Steffen Winterfeldt <snwint@××××.de>,
385 ++ * Michael Schroeder <mls@××××.de>,
386 ++ * Ken Wimer <wimer@××××.de>.
387 ++ *
388 ++ * This file is subject to the terms and conditions of the GNU General Public
389 ++ * License. See the file COPYING in the main directory of this archive for
390 ++ * more details.
391 ++ */
392 ++#include <linux/module.h>
393 ++#include <linux/types.h>
394 ++#include <linux/fb.h>
395 ++#include <linux/selection.h>
396 ++#include <linux/slab.h>
397 ++#include <linux/vt_kern.h>
398 ++#include <asm/irq.h>
399 ++
400 ++#include "fbcon.h"
401 ++#include "fbcondecor.h"
402 ++
403 ++#define parse_pixel(shift,bpp,type) \
404 ++ do { \
405 ++ if (d & (0x80 >> (shift))) \
406 ++ dd2[(shift)] = fgx; \
407 ++ else \
408 ++ dd2[(shift)] = transparent ? *(type *)decor_src : bgx; \
409 ++ decor_src += (bpp); \
410 ++ } while (0) \
411 ++
412 ++extern int get_color(struct vc_data *vc, struct fb_info *info,
413 ++ u16 c, int is_fg);
414 ++
415 ++void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc)
416 ++{
417 ++ int i, j, k;
418 ++ int minlen = min(min(info->var.red.length, info->var.green.length),
419 ++ info->var.blue.length);
420 ++ u32 col;
421 ++
422 ++ for (j = i = 0; i < 16; i++) {
423 ++ k = color_table[i];
424 ++
425 ++ col = ((vc->vc_palette[j++] >> (8-minlen))
426 ++ << info->var.red.offset);
427 ++ col |= ((vc->vc_palette[j++] >> (8-minlen))
428 ++ << info->var.green.offset);
429 ++ col |= ((vc->vc_palette[j++] >> (8-minlen))
430 ++ << info->var.blue.offset);
431 ++ ((u32 *)info->pseudo_palette)[k] = col;
432 ++ }
433 ++}
434 ++
435 ++void fbcon_decor_renderc(struct fb_info *info, int ypos, int xpos, int height,
436 ++ int width, u8* src, u32 fgx, u32 bgx, u8 transparent)
437 ++{
438 ++ unsigned int x, y;
439 ++ u32 dd;
440 ++ int bytespp = ((info->var.bits_per_pixel + 7) >> 3);
441 ++ unsigned int d = ypos * info->fix.line_length + xpos * bytespp;
442 ++ unsigned int ds = (ypos * info->var.xres + xpos) * bytespp;
443 ++ u16 dd2[4];
444 ++
445 ++ u8* decor_src = (u8 *)(info->bgdecor.data + ds);
446 ++ u8* dst = (u8 *)(info->screen_base + d);
447 ++
448 ++ if ((ypos + height) > info->var.yres || (xpos + width) > info->var.xres)
449 ++ return;
450 ++
451 ++ for (y = 0; y < height; y++) {
452 ++ switch (info->var.bits_per_pixel) {
453 ++
454 ++ case 32:
455 ++ for (x = 0; x < width; x++) {
456 ++
457 ++ if ((x & 7) == 0)
458 ++ d = *src++;
459 ++ if (d & 0x80)
460 ++ dd = fgx;
461 ++ else
462 ++ dd = transparent ?
463 ++ *(u32 *)decor_src : bgx;
464 ++
465 ++ d <<= 1;
466 ++ decor_src += 4;
467 ++ fb_writel(dd, dst);
468 ++ dst += 4;
469 ++ }
470 ++ break;
471 ++ case 24:
472 ++ for (x = 0; x < width; x++) {
473 ++
474 ++ if ((x & 7) == 0)
475 ++ d = *src++;
476 ++ if (d & 0x80)
477 ++ dd = fgx;
478 ++ else
479 ++ dd = transparent ?
480 ++ (*(u32 *)decor_src & 0xffffff) : bgx;
481 ++
482 ++ d <<= 1;
483 ++ decor_src += 3;
484 ++#ifdef __LITTLE_ENDIAN
485 ++ fb_writew(dd & 0xffff, dst);
486 ++ dst += 2;
487 ++ fb_writeb((dd >> 16), dst);
488 ++#else
489 ++ fb_writew(dd >> 8, dst);
490 ++ dst += 2;
491 ++ fb_writeb(dd & 0xff, dst);
492 ++#endif
493 ++ dst++;
494 ++ }
495 ++ break;
496 ++ case 16:
497 ++ for (x = 0; x < width; x += 2) {
498 ++ if ((x & 7) == 0)
499 ++ d = *src++;
500 ++
501 ++ parse_pixel(0, 2, u16);
502 ++ parse_pixel(1, 2, u16);
503 ++#ifdef __LITTLE_ENDIAN
504 ++ dd = dd2[0] | (dd2[1] << 16);
505 ++#else
506 ++ dd = dd2[1] | (dd2[0] << 16);
507 ++#endif
508 ++ d <<= 2;
509 ++ fb_writel(dd, dst);
510 ++ dst += 4;
511 ++ }
512 ++ break;
513 ++
514 ++ case 8:
515 ++ for (x = 0; x < width; x += 4) {
516 ++ if ((x & 7) == 0)
517 ++ d = *src++;
518 ++
519 ++ parse_pixel(0, 1, u8);
520 ++ parse_pixel(1, 1, u8);
521 ++ parse_pixel(2, 1, u8);
522 ++ parse_pixel(3, 1, u8);
523 ++
524 ++#ifdef __LITTLE_ENDIAN
525 ++ dd = dd2[0] | (dd2[1] << 8) | (dd2[2] << 16) | (dd2[3] << 24);
526 ++#else
527 ++ dd = dd2[3] | (dd2[2] << 8) | (dd2[1] << 16) | (dd2[0] << 24);
528 ++#endif
529 ++ d <<= 4;
530 ++ fb_writel(dd, dst);
531 ++ dst += 4;
532 ++ }
533 ++ }
534 ++
535 ++ dst += info->fix.line_length - width * bytespp;
536 ++ decor_src += (info->var.xres - width) * bytespp;
537 ++ }
538 ++}
539 ++
540 ++#define cc2cx(a) \
541 ++ ((info->fix.visual == FB_VISUAL_TRUECOLOR || \
542 ++ info->fix.visual == FB_VISUAL_DIRECTCOLOR) ? \
543 ++ ((u32*)info->pseudo_palette)[a] : a)
544 ++
545 ++void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info,
546 ++ const unsigned short *s, int count, int yy, int xx)
547 ++{
548 ++ unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
549 ++ struct fbcon_ops *ops = info->fbcon_par;
550 ++ int fg_color, bg_color, transparent;
551 ++ u8 *src;
552 ++ u32 bgx, fgx;
553 ++ u16 c = scr_readw(s);
554 ++
555 ++ fg_color = get_color(vc, info, c, 1);
556 ++ bg_color = get_color(vc, info, c, 0);
557 ++
558 ++ /* Don't paint the background image if console is blanked */
559 ++ transparent = ops->blank_state ? 0 :
560 ++ (vc->vc_decor.bg_color == bg_color);
561 ++
562 ++ xx = xx * vc->vc_font.width + vc->vc_decor.tx;
563 ++ yy = yy * vc->vc_font.height + vc->vc_decor.ty;
564 ++
565 ++ fgx = cc2cx(fg_color);
566 ++ bgx = cc2cx(bg_color);
567 ++
568 ++ while (count--) {
569 ++ c = scr_readw(s++);
570 ++ src = vc->vc_font.data + (c & charmask) * vc->vc_font.height *
571 ++ ((vc->vc_font.width + 7) >> 3);
572 ++
573 ++ fbcon_decor_renderc(info, yy, xx, vc->vc_font.height,
574 ++ vc->vc_font.width, src, fgx, bgx, transparent);
575 ++ xx += vc->vc_font.width;
576 ++ }
577 ++}
578 ++
579 ++void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor)
580 ++{
581 ++ int i;
582 ++ unsigned int dsize, s_pitch;
583 ++ struct fbcon_ops *ops = info->fbcon_par;
584 ++ struct vc_data* vc;
585 ++ u8 *src;
586 ++
587 ++ /* we really don't need any cursors while the console is blanked */
588 ++ if (info->state != FBINFO_STATE_RUNNING || ops->blank_state)
589 ++ return;
590 ++
591 ++ vc = vc_cons[ops->currcon].d;
592 ++
593 ++ src = kmalloc(64 + sizeof(struct fb_image), GFP_ATOMIC);
594 ++ if (!src)
595 ++ return;
596 ++
597 ++ s_pitch = (cursor->image.width + 7) >> 3;
598 ++ dsize = s_pitch * cursor->image.height;
599 ++ if (cursor->enable) {
600 ++ switch (cursor->rop) {
601 ++ case ROP_XOR:
602 ++ for (i = 0; i < dsize; i++)
603 ++ src[i] = cursor->image.data[i] ^ cursor->mask[i];
604 ++ break;
605 ++ case ROP_COPY:
606 ++ default:
607 ++ for (i = 0; i < dsize; i++)
608 ++ src[i] = cursor->image.data[i] & cursor->mask[i];
609 ++ break;
610 ++ }
611 ++ } else
612 ++ memcpy(src, cursor->image.data, dsize);
613 ++
614 ++ fbcon_decor_renderc(info,
615 ++ cursor->image.dy + vc->vc_decor.ty,
616 ++ cursor->image.dx + vc->vc_decor.tx,
617 ++ cursor->image.height,
618 ++ cursor->image.width,
619 ++ (u8*)src,
620 ++ cc2cx(cursor->image.fg_color),
621 ++ cc2cx(cursor->image.bg_color),
622 ++ cursor->image.bg_color == vc->vc_decor.bg_color);
623 ++
624 ++ kfree(src);
625 ++}
626 ++
627 ++static void decorset(u8 *dst, int height, int width, int dstbytes,
628 ++ u32 bgx, int bpp)
629 ++{
630 ++ int i;
631 ++
632 ++ if (bpp == 8)
633 ++ bgx |= bgx << 8;
634 ++ if (bpp == 16 || bpp == 8)
635 ++ bgx |= bgx << 16;
636 ++
637 ++ while (height-- > 0) {
638 ++ u8 *p = dst;
639 ++
640 ++ switch (bpp) {
641 ++
642 ++ case 32:
643 ++ for (i=0; i < width; i++) {
644 ++ fb_writel(bgx, p); p += 4;
645 ++ }
646 ++ break;
647 ++ case 24:
648 ++ for (i=0; i < width; i++) {
649 ++#ifdef __LITTLE_ENDIAN
650 ++ fb_writew((bgx & 0xffff),(u16*)p); p += 2;
651 ++ fb_writeb((bgx >> 16),p++);
652 ++#else
653 ++ fb_writew((bgx >> 8),(u16*)p); p += 2;
654 ++ fb_writeb((bgx & 0xff),p++);
655 ++#endif
656 ++ }
657 ++ case 16:
658 ++ for (i=0; i < width/4; i++) {
659 ++ fb_writel(bgx,p); p += 4;
660 ++ fb_writel(bgx,p); p += 4;
661 ++ }
662 ++ if (width & 2) {
663 ++ fb_writel(bgx,p); p += 4;
664 ++ }
665 ++ if (width & 1)
666 ++ fb_writew(bgx,(u16*)p);
667 ++ break;
668 ++ case 8:
669 ++ for (i=0; i < width/4; i++) {
670 ++ fb_writel(bgx,p); p += 4;
671 ++ }
672 ++
673 ++ if (width & 2) {
674 ++ fb_writew(bgx,p); p += 2;
675 ++ }
676 ++ if (width & 1)
677 ++ fb_writeb(bgx,(u8*)p);
678 ++ break;
679 ++
680 ++ }
681 ++ dst += dstbytes;
682 ++ }
683 ++}
684 ++
685 ++void fbcon_decor_copy(u8 *dst, u8 *src, int height, int width, int linebytes,
686 ++ int srclinebytes, int bpp)
687 ++{
688 ++ int i;
689 ++
690 ++ while (height-- > 0) {
691 ++ u32 *p = (u32 *)dst;
692 ++ u32 *q = (u32 *)src;
693 ++
694 ++ switch (bpp) {
695 ++
696 ++ case 32:
697 ++ for (i=0; i < width; i++)
698 ++ fb_writel(*q++, p++);
699 ++ break;
700 ++ case 24:
701 ++ for (i=0; i < (width*3/4); i++)
702 ++ fb_writel(*q++, p++);
703 ++ if ((width*3) % 4) {
704 ++ if (width & 2) {
705 ++ fb_writeb(*(u8*)q, (u8*)p);
706 ++ } else if (width & 1) {
707 ++ fb_writew(*(u16*)q, (u16*)p);
708 ++ fb_writeb(*(u8*)((u16*)q+1),(u8*)((u16*)p+2));
709 ++ }
710 ++ }
711 ++ break;
712 ++ case 16:
713 ++ for (i=0; i < width/4; i++) {
714 ++ fb_writel(*q++, p++);
715 ++ fb_writel(*q++, p++);
716 ++ }
717 ++ if (width & 2)
718 ++ fb_writel(*q++, p++);
719 ++ if (width & 1)
720 ++ fb_writew(*(u16*)q, (u16*)p);
721 ++ break;
722 ++ case 8:
723 ++ for (i=0; i < width/4; i++)
724 ++ fb_writel(*q++, p++);
725 ++
726 ++ if (width & 2) {
727 ++ fb_writew(*(u16*)q, (u16*)p);
728 ++ q = (u32*) ((u16*)q + 1);
729 ++ p = (u32*) ((u16*)p + 1);
730 ++ }
731 ++ if (width & 1)
732 ++ fb_writeb(*(u8*)q, (u8*)p);
733 ++ break;
734 ++ }
735 ++
736 ++ dst += linebytes;
737 ++ src += srclinebytes;
738 ++ }
739 ++}
740 ++
741 ++static void decorfill(struct fb_info *info, int sy, int sx, int height,
742 ++ int width)
743 ++{
744 ++ int bytespp = ((info->var.bits_per_pixel + 7) >> 3);
745 ++ int d = sy * info->fix.line_length + sx * bytespp;
746 ++ int ds = (sy * info->var.xres + sx) * bytespp;
747 ++
748 ++ fbcon_decor_copy((u8 *)(info->screen_base + d), (u8 *)(info->bgdecor.data + ds),
749 ++ height, width, info->fix.line_length, info->var.xres * bytespp,
750 ++ info->var.bits_per_pixel);
751 ++}
752 ++
753 ++void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx,
754 ++ int height, int width)
755 ++{
756 ++ int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
757 ++ struct fbcon_ops *ops = info->fbcon_par;
758 ++ u8 *dst;
759 ++ int transparent, bg_color = attr_bgcol_ec(bgshift, vc, info);
760 ++
761 ++ transparent = (vc->vc_decor.bg_color == bg_color);
762 ++ sy = sy * vc->vc_font.height + vc->vc_decor.ty;
763 ++ sx = sx * vc->vc_font.width + vc->vc_decor.tx;
764 ++ height *= vc->vc_font.height;
765 ++ width *= vc->vc_font.width;
766 ++
767 ++ /* Don't paint the background image if console is blanked */
768 ++ if (transparent && !ops->blank_state) {
769 ++ decorfill(info, sy, sx, height, width);
770 ++ } else {
771 ++ dst = (u8 *)(info->screen_base + sy * info->fix.line_length +
772 ++ sx * ((info->var.bits_per_pixel + 7) >> 3));
773 ++ decorset(dst, height, width, info->fix.line_length, cc2cx(bg_color),
774 ++ info->var.bits_per_pixel);
775 ++ }
776 ++}
777 ++
778 ++void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info,
779 ++ int bottom_only)
780 ++{
781 ++ unsigned int tw = vc->vc_cols*vc->vc_font.width;
782 ++ unsigned int th = vc->vc_rows*vc->vc_font.height;
783 ++
784 ++ if (!bottom_only) {
785 ++ /* top margin */
786 ++ decorfill(info, 0, 0, vc->vc_decor.ty, info->var.xres);
787 ++ /* left margin */
788 ++ decorfill(info, vc->vc_decor.ty, 0, th, vc->vc_decor.tx);
789 ++ /* right margin */
790 ++ decorfill(info, vc->vc_decor.ty, vc->vc_decor.tx + tw, th,
791 ++ info->var.xres - vc->vc_decor.tx - tw);
792 ++ }
793 ++ decorfill(info, vc->vc_decor.ty + th, 0,
794 ++ info->var.yres - vc->vc_decor.ty - th, info->var.xres);
795 ++}
796 ++
797 ++void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y,
798 ++ int sx, int dx, int width)
799 ++{
800 ++ u16 *d = (u16 *) (vc->vc_origin + vc->vc_size_row * y + dx * 2);
801 ++ u16 *s = d + (dx - sx);
802 ++ u16 *start = d;
803 ++ u16 *ls = d;
804 ++ u16 *le = d + width;
805 ++ u16 c;
806 ++ int x = dx;
807 ++ u16 attr = 1;
808 ++
809 ++ do {
810 ++ c = scr_readw(d);
811 ++ if (attr != (c & 0xff00)) {
812 ++ attr = c & 0xff00;
813 ++ if (d > start) {
814 ++ fbcon_decor_putcs(vc, info, start, d - start, y, x);
815 ++ x += d - start;
816 ++ start = d;
817 ++ }
818 ++ }
819 ++ if (s >= ls && s < le && c == scr_readw(s)) {
820 ++ if (d > start) {
821 ++ fbcon_decor_putcs(vc, info, start, d - start, y, x);
822 ++ x += d - start + 1;
823 ++ start = d + 1;
824 ++ } else {
825 ++ x++;
826 ++ start++;
827 ++ }
828 ++ }
829 ++ s++;
830 ++ d++;
831 ++ } while (d < le);
832 ++ if (d > start)
833 ++ fbcon_decor_putcs(vc, info, start, d - start, y, x);
834 ++}
835 ++
836 ++void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank)
837 ++{
838 ++ if (blank) {
839 ++ decorset((u8 *)info->screen_base, info->var.yres, info->var.xres,
840 ++ info->fix.line_length, 0, info->var.bits_per_pixel);
841 ++ } else {
842 ++ update_screen(vc);
843 ++ fbcon_decor_clear_margins(vc, info, 0);
844 ++ }
845 ++}
846 ++
847 +diff --git a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
848 +index f447734..1a840c2 100644
849 +--- a/drivers/video/console/fbcon.c
850 ++++ b/drivers/video/console/fbcon.c
851 +@@ -79,6 +79,7 @@
852 + #include <asm/irq.h>
853 +
854 + #include "fbcon.h"
855 ++#include "fbcondecor.h"
856 +
857 + #ifdef FBCONDEBUG
858 + # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __func__ , ## args)
859 +@@ -94,7 +95,7 @@ enum {
860 +
861 + static struct display fb_display[MAX_NR_CONSOLES];
862 +
863 +-static signed char con2fb_map[MAX_NR_CONSOLES];
864 ++signed char con2fb_map[MAX_NR_CONSOLES];
865 + static signed char con2fb_map_boot[MAX_NR_CONSOLES];
866 +
867 + static int logo_lines;
868 +@@ -286,7 +287,7 @@ static inline int fbcon_is_inactive(struct vc_data *vc, struct fb_info *info)
869 + !vt_force_oops_output(vc);
870 + }
871 +
872 +-static int get_color(struct vc_data *vc, struct fb_info *info,
873 ++int get_color(struct vc_data *vc, struct fb_info *info,
874 + u16 c, int is_fg)
875 + {
876 + int depth = fb_get_color_depth(&info->var, &info->fix);
877 +@@ -551,6 +552,9 @@ static int do_fbcon_takeover(int show_logo)
878 + info_idx = -1;
879 + } else {
880 + fbcon_has_console_bind = 1;
881 ++#ifdef CONFIG_FB_CON_DECOR
882 ++ fbcon_decor_init();
883 ++#endif
884 + }
885 +
886 + return err;
887 +@@ -1007,6 +1011,12 @@ static const char *fbcon_startup(void)
888 + rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
889 + cols /= vc->vc_font.width;
890 + rows /= vc->vc_font.height;
891 ++
892 ++ if (fbcon_decor_active(info, vc)) {
893 ++ cols = vc->vc_decor.twidth / vc->vc_font.width;
894 ++ rows = vc->vc_decor.theight / vc->vc_font.height;
895 ++ }
896 ++
897 + vc_resize(vc, cols, rows);
898 +
899 + DPRINTK("mode: %s\n", info->fix.id);
900 +@@ -1036,7 +1046,7 @@ static void fbcon_init(struct vc_data *vc, int init)
901 + cap = info->flags;
902 +
903 + if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
904 +- (info->fix.type == FB_TYPE_TEXT))
905 ++ (info->fix.type == FB_TYPE_TEXT) || fbcon_decor_active(info, vc))
906 + logo = 0;
907 +
908 + if (var_to_display(p, &info->var, info))
909 +@@ -1260,6 +1270,11 @@ static void fbcon_clear(struct vc_data *vc, int sy, int sx, int height,
910 + fbcon_clear_margins(vc, 0);
911 + }
912 +
913 ++ if (fbcon_decor_active(info, vc)) {
914 ++ fbcon_decor_clear(vc, info, sy, sx, height, width);
915 ++ return;
916 ++ }
917 ++
918 + /* Split blits that cross physical y_wrap boundary */
919 +
920 + y_break = p->vrows - p->yscroll;
921 +@@ -1279,10 +1294,15 @@ static void fbcon_putcs(struct vc_data *vc, const unsigned short *s,
922 + struct display *p = &fb_display[vc->vc_num];
923 + struct fbcon_ops *ops = info->fbcon_par;
924 +
925 +- if (!fbcon_is_inactive(vc, info))
926 +- ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
927 +- get_color(vc, info, scr_readw(s), 1),
928 +- get_color(vc, info, scr_readw(s), 0));
929 ++ if (!fbcon_is_inactive(vc, info)) {
930 ++
931 ++ if (fbcon_decor_active(info, vc))
932 ++ fbcon_decor_putcs(vc, info, s, count, ypos, xpos);
933 ++ else
934 ++ ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
935 ++ get_color(vc, info, scr_readw(s), 1),
936 ++ get_color(vc, info, scr_readw(s), 0));
937 ++ }
938 + }
939 +
940 + static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos)
941 +@@ -1298,8 +1318,13 @@ static void fbcon_clear_margins(struct vc_data *vc, int bottom_only)
942 + struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
943 + struct fbcon_ops *ops = info->fbcon_par;
944 +
945 +- if (!fbcon_is_inactive(vc, info))
946 +- ops->clear_margins(vc, info, bottom_only);
947 ++ if (!fbcon_is_inactive(vc, info)) {
948 ++ if (fbcon_decor_active(info, vc)) {
949 ++ fbcon_decor_clear_margins(vc, info, bottom_only);
950 ++ } else {
951 ++ ops->clear_margins(vc, info, bottom_only);
952 ++ }
953 ++ }
954 + }
955 +
956 + static void fbcon_cursor(struct vc_data *vc, int mode)
957 +@@ -1819,7 +1844,7 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
958 + count = vc->vc_rows;
959 + if (softback_top)
960 + fbcon_softback_note(vc, t, count);
961 +- if (logo_shown >= 0)
962 ++ if (logo_shown >= 0 || fbcon_decor_active(info, vc))
963 + goto redraw_up;
964 + switch (p->scrollmode) {
965 + case SCROLL_MOVE:
966 +@@ -1912,6 +1937,8 @@ static int fbcon_scroll(struct vc_data *vc, int t, int b, int dir,
967 + count = vc->vc_rows;
968 + if (logo_shown >= 0)
969 + goto redraw_down;
970 ++ if (fbcon_decor_active(info, vc))
971 ++ goto redraw_down;
972 + switch (p->scrollmode) {
973 + case SCROLL_MOVE:
974 + fbcon_redraw_blit(vc, info, p, b - 1, b - t - count,
975 +@@ -2060,6 +2087,13 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s
976 + }
977 + return;
978 + }
979 ++
980 ++ if (fbcon_decor_active(info, vc) && sy == dy && height == 1) {
981 ++ /* must use slower redraw bmove to keep background pic intact */
982 ++ fbcon_decor_bmove_redraw(vc, info, sy, sx, dx, width);
983 ++ return;
984 ++ }
985 ++
986 + ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx,
987 + height, width);
988 + }
989 +@@ -2130,8 +2164,8 @@ static int fbcon_resize(struct vc_data *vc, unsigned int width,
990 + var.yres = virt_h * virt_fh;
991 + x_diff = info->var.xres - var.xres;
992 + y_diff = info->var.yres - var.yres;
993 +- if (x_diff < 0 || x_diff > virt_fw ||
994 +- y_diff < 0 || y_diff > virt_fh) {
995 ++ if ((x_diff < 0 || x_diff > virt_fw ||
996 ++ y_diff < 0 || y_diff > virt_fh) && !vc->vc_decor.state) {
997 + const struct fb_videomode *mode;
998 +
999 + DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
1000 +@@ -2167,6 +2201,21 @@ static int fbcon_switch(struct vc_data *vc)
1001 +
1002 + info = registered_fb[con2fb_map[vc->vc_num]];
1003 + ops = info->fbcon_par;
1004 ++ prev_console = ops->currcon;
1005 ++ if (prev_console != -1)
1006 ++ old_info = registered_fb[con2fb_map[prev_console]];
1007 ++
1008 ++#ifdef CONFIG_FB_CON_DECOR
1009 ++ if (!fbcon_decor_active_vc(vc) && info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
1010 ++ struct vc_data *vc_curr = vc_cons[prev_console].d;
1011 ++ if (vc_curr && fbcon_decor_active_vc(vc_curr)) {
1012 ++ /* Clear the screen to avoid displaying funky colors during
1013 ++ * palette updates. */
1014 ++ memset((u8*)info->screen_base + info->fix.line_length * info->var.yoffset,
1015 ++ 0, info->var.yres * info->fix.line_length);
1016 ++ }
1017 ++ }
1018 ++#endif
1019 +
1020 + if (softback_top) {
1021 + if (softback_lines)
1022 +@@ -2185,9 +2234,6 @@ static int fbcon_switch(struct vc_data *vc)
1023 + logo_shown = FBCON_LOGO_CANSHOW;
1024 + }
1025 +
1026 +- prev_console = ops->currcon;
1027 +- if (prev_console != -1)
1028 +- old_info = registered_fb[con2fb_map[prev_console]];
1029 + /*
1030 + * FIXME: If we have multiple fbdev's loaded, we need to
1031 + * update all info->currcon. Perhaps, we can place this
1032 +@@ -2231,6 +2277,18 @@ static int fbcon_switch(struct vc_data *vc)
1033 + fbcon_del_cursor_timer(old_info);
1034 + }
1035 +
1036 ++ if (fbcon_decor_active_vc(vc)) {
1037 ++ struct vc_data *vc_curr = vc_cons[prev_console].d;
1038 ++
1039 ++ if (!vc_curr->vc_decor.theme ||
1040 ++ strcmp(vc->vc_decor.theme, vc_curr->vc_decor.theme) ||
1041 ++ (fbcon_decor_active_nores(info, vc_curr) &&
1042 ++ !fbcon_decor_active(info, vc_curr))) {
1043 ++ fbcon_decor_disable(vc, 0);
1044 ++ fbcon_decor_call_helper("modechange", vc->vc_num);
1045 ++ }
1046 ++ }
1047 ++
1048 + if (fbcon_is_inactive(vc, info) ||
1049 + ops->blank_state != FB_BLANK_UNBLANK)
1050 + fbcon_del_cursor_timer(info);
1051 +@@ -2339,15 +2397,20 @@ static int fbcon_blank(struct vc_data *vc, int blank, int mode_switch)
1052 + }
1053 + }
1054 +
1055 +- if (!fbcon_is_inactive(vc, info)) {
1056 ++ if (!fbcon_is_inactive(vc, info)) {
1057 + if (ops->blank_state != blank) {
1058 + ops->blank_state = blank;
1059 + fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
1060 + ops->cursor_flash = (!blank);
1061 +
1062 +- if (!(info->flags & FBINFO_MISC_USEREVENT))
1063 +- if (fb_blank(info, blank))
1064 +- fbcon_generic_blank(vc, info, blank);
1065 ++ if (!(info->flags & FBINFO_MISC_USEREVENT)) {
1066 ++ if (fb_blank(info, blank)) {
1067 ++ if (fbcon_decor_active(info, vc))
1068 ++ fbcon_decor_blank(vc, info, blank);
1069 ++ else
1070 ++ fbcon_generic_blank(vc, info, blank);
1071 ++ }
1072 ++ }
1073 + }
1074 +
1075 + if (!blank)
1076 +@@ -2522,13 +2585,22 @@ static int fbcon_do_set_font(struct vc_data *vc, int w, int h,
1077 + }
1078 +
1079 + if (resize) {
1080 ++ /* reset wrap/pan */
1081 + int cols, rows;
1082 +
1083 + cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres);
1084 + rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
1085 ++
1086 ++ if (fbcon_decor_active(info, vc)) {
1087 ++ info->var.xoffset = info->var.yoffset = p->yscroll = 0;
1088 ++ cols = vc->vc_decor.twidth;
1089 ++ rows = vc->vc_decor.theight;
1090 ++ }
1091 + cols /= w;
1092 + rows /= h;
1093 ++
1094 + vc_resize(vc, cols, rows);
1095 ++
1096 + if (CON_IS_VISIBLE(vc) && softback_buf)
1097 + fbcon_update_softback(vc);
1098 + } else if (CON_IS_VISIBLE(vc)
1099 +@@ -2657,7 +2729,11 @@ static int fbcon_set_palette(struct vc_data *vc, unsigned char *table)
1100 + int i, j, k, depth;
1101 + u8 val;
1102 +
1103 +- if (fbcon_is_inactive(vc, info))
1104 ++ if (fbcon_is_inactive(vc, info)
1105 ++#ifdef CONFIG_FB_CON_DECOR
1106 ++ || vc->vc_num != fg_console
1107 ++#endif
1108 ++ )
1109 + return -EINVAL;
1110 +
1111 + if (!CON_IS_VISIBLE(vc))
1112 +@@ -2683,14 +2759,56 @@ static int fbcon_set_palette(struct vc_data *vc, unsigned char *table)
1113 + } else
1114 + fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap);
1115 +
1116 +- return fb_set_cmap(&palette_cmap, info);
1117 ++ if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
1118 ++ info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
1119 ++
1120 ++ u16 *red, *green, *blue;
1121 ++ int minlen = min(min(info->var.red.length, info->var.green.length),
1122 ++ info->var.blue.length);
1123 ++ int h;
1124 ++
1125 ++ struct fb_cmap cmap = {
1126 ++ .start = 0,
1127 ++ .len = (1 << minlen),
1128 ++ .red = NULL,
1129 ++ .green = NULL,
1130 ++ .blue = NULL,
1131 ++ .transp = NULL
1132 ++ };
1133 ++
1134 ++ red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL);
1135 ++
1136 ++ if (!red)
1137 ++ goto out;
1138 ++
1139 ++ green = red + 256;
1140 ++ blue = green + 256;
1141 ++ cmap.red = red;
1142 ++ cmap.green = green;
1143 ++ cmap.blue = blue;
1144 ++
1145 ++ for (i = 0; i < cmap.len; i++) {
1146 ++ red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1);
1147 ++ }
1148 ++
1149 ++ h = fb_set_cmap(&cmap, info);
1150 ++ fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d);
1151 ++ kfree(red);
1152 ++
1153 ++ return h;
1154 ++
1155 ++ } else if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
1156 ++ info->var.bits_per_pixel == 8 && info->bgdecor.cmap.red != NULL)
1157 ++ fb_set_cmap(&info->bgdecor.cmap, info);
1158 ++
1159 ++out: return fb_set_cmap(&palette_cmap, info);
1160 + }
1161 +
1162 + static u16 *fbcon_screen_pos(struct vc_data *vc, int offset)
1163 + {
1164 + unsigned long p;
1165 + int line;
1166 +-
1167 ++
1168 + if (vc->vc_num != fg_console || !softback_lines)
1169 + return (u16 *) (vc->vc_origin + offset);
1170 + line = offset / vc->vc_size_row;
1171 +@@ -2909,7 +3027,14 @@ static void fbcon_modechanged(struct fb_info *info)
1172 + rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
1173 + cols /= vc->vc_font.width;
1174 + rows /= vc->vc_font.height;
1175 +- vc_resize(vc, cols, rows);
1176 ++
1177 ++ if (!fbcon_decor_active_nores(info, vc)) {
1178 ++ vc_resize(vc, cols, rows);
1179 ++ } else {
1180 ++ fbcon_decor_disable(vc, 0);
1181 ++ fbcon_decor_call_helper("modechange", vc->vc_num);
1182 ++ }
1183 ++
1184 + updatescrollmode(p, info, vc);
1185 + scrollback_max = 0;
1186 + scrollback_current = 0;
1187 +@@ -2954,7 +3079,9 @@ static void fbcon_set_all_vcs(struct fb_info *info)
1188 + rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
1189 + cols /= vc->vc_font.width;
1190 + rows /= vc->vc_font.height;
1191 +- vc_resize(vc, cols, rows);
1192 ++ if (!fbcon_decor_active_nores(info, vc)) {
1193 ++ vc_resize(vc, cols, rows);
1194 ++ }
1195 + }
1196 +
1197 + if (fg != -1)
1198 +@@ -3596,6 +3723,7 @@ static void fbcon_exit(void)
1199 + }
1200 + }
1201 +
1202 ++ fbcon_decor_exit();
1203 + fbcon_has_exited = 1;
1204 + }
1205 +
1206 +diff --git a/drivers/video/console/fbcondecor.c b/drivers/video/console/fbcondecor.c
1207 +new file mode 100644
1208 +index 0000000..babc8c5
1209 +--- /dev/null
1210 ++++ b/drivers/video/console/fbcondecor.c
1211 +@@ -0,0 +1,555 @@
1212 ++/*
1213 ++ * linux/drivers/video/console/fbcondecor.c -- Framebuffer console decorations
1214 ++ *
1215 ++ * Copyright (C) 2004-2009 Michal Januszewski <michalj+fbcondecor@×××××.com>
1216 ++ *
1217 ++ * Code based upon "Bootsplash" (C) 2001-2003
1218 ++ * Volker Poplawski <volker@×××××××××.de>,
1219 ++ * Stefan Reinauer <stepan@××××.de>,
1220 ++ * Steffen Winterfeldt <snwint@××××.de>,
1221 ++ * Michael Schroeder <mls@××××.de>,
1222 ++ * Ken Wimer <wimer@××××.de>.
1223 ++ *
1224 ++ * Compat ioctl support by Thorsten Klein <TK@××××××××××××××.de>.
1225 ++ *
1226 ++ * This file is subject to the terms and conditions of the GNU General Public
1227 ++ * License. See the file COPYING in the main directory of this archive for
1228 ++ * more details.
1229 ++ *
1230 ++ */
1231 ++#include <linux/module.h>
1232 ++#include <linux/kernel.h>
1233 ++#include <linux/string.h>
1234 ++#include <linux/types.h>
1235 ++#include <linux/fb.h>
1236 ++#include <linux/vt_kern.h>
1237 ++#include <linux/vmalloc.h>
1238 ++#include <linux/unistd.h>
1239 ++#include <linux/syscalls.h>
1240 ++#include <linux/init.h>
1241 ++#include <linux/proc_fs.h>
1242 ++#include <linux/workqueue.h>
1243 ++#include <linux/kmod.h>
1244 ++#include <linux/miscdevice.h>
1245 ++#include <linux/device.h>
1246 ++#include <linux/fs.h>
1247 ++#include <linux/compat.h>
1248 ++#include <linux/console.h>
1249 ++
1250 ++#include <asm/uaccess.h>
1251 ++#include <asm/irq.h>
1252 ++
1253 ++#include "fbcon.h"
1254 ++#include "fbcondecor.h"
1255 ++
1256 ++extern signed char con2fb_map[];
1257 ++static int fbcon_decor_enable(struct vc_data *vc);
1258 ++char fbcon_decor_path[KMOD_PATH_LEN] = "/sbin/fbcondecor_helper";
1259 ++static int initialized = 0;
1260 ++
1261 ++int fbcon_decor_call_helper(char* cmd, unsigned short vc)
1262 ++{
1263 ++ char *envp[] = {
1264 ++ "HOME=/",
1265 ++ "PATH=/sbin:/bin",
1266 ++ NULL
1267 ++ };
1268 ++
1269 ++ char tfb[5];
1270 ++ char tcons[5];
1271 ++ unsigned char fb = (int) con2fb_map[vc];
1272 ++
1273 ++ char *argv[] = {
1274 ++ fbcon_decor_path,
1275 ++ "2",
1276 ++ cmd,
1277 ++ tcons,
1278 ++ tfb,
1279 ++ vc_cons[vc].d->vc_decor.theme,
1280 ++ NULL
1281 ++ };
1282 ++
1283 ++ snprintf(tfb,5,"%d",fb);
1284 ++ snprintf(tcons,5,"%d",vc);
1285 ++
1286 ++ return call_usermodehelper(fbcon_decor_path, argv, envp, UMH_WAIT_EXEC);
1287 ++}
1288 ++
1289 ++/* Disables fbcondecor on a virtual console; called with console sem held. */
1290 ++int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw)
1291 ++{
1292 ++ struct fb_info* info;
1293 ++
1294 ++ if (!vc->vc_decor.state)
1295 ++ return -EINVAL;
1296 ++
1297 ++ info = registered_fb[(int) con2fb_map[vc->vc_num]];
1298 ++
1299 ++ if (info == NULL)
1300 ++ return -EINVAL;
1301 ++
1302 ++ vc->vc_decor.state = 0;
1303 ++ vc_resize(vc, info->var.xres / vc->vc_font.width,
1304 ++ info->var.yres / vc->vc_font.height);
1305 ++
1306 ++ if (fg_console == vc->vc_num && redraw) {
1307 ++ redraw_screen(vc, 0);
1308 ++ update_region(vc, vc->vc_origin +
1309 ++ vc->vc_size_row * vc->vc_top,
1310 ++ vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
1311 ++ }
1312 ++
1313 ++ printk(KERN_INFO "fbcondecor: switched decor state to 'off' on console %d\n",
1314 ++ vc->vc_num);
1315 ++
1316 ++ return 0;
1317 ++}
1318 ++
1319 ++/* Enables fbcondecor on a virtual console; called with console sem held. */
1320 ++static int fbcon_decor_enable(struct vc_data *vc)
1321 ++{
1322 ++ struct fb_info* info;
1323 ++
1324 ++ info = registered_fb[(int) con2fb_map[vc->vc_num]];
1325 ++
1326 ++ if (vc->vc_decor.twidth == 0 || vc->vc_decor.theight == 0 ||
1327 ++ info == NULL || vc->vc_decor.state || (!info->bgdecor.data &&
1328 ++ vc->vc_num == fg_console))
1329 ++ return -EINVAL;
1330 ++
1331 ++ vc->vc_decor.state = 1;
1332 ++ vc_resize(vc, vc->vc_decor.twidth / vc->vc_font.width,
1333 ++ vc->vc_decor.theight / vc->vc_font.height);
1334 ++
1335 ++ if (fg_console == vc->vc_num) {
1336 ++ redraw_screen(vc, 0);
1337 ++ update_region(vc, vc->vc_origin +
1338 ++ vc->vc_size_row * vc->vc_top,
1339 ++ vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
1340 ++ fbcon_decor_clear_margins(vc, info, 0);
1341 ++ }
1342 ++
1343 ++ printk(KERN_INFO "fbcondecor: switched decor state to 'on' on console %d\n",
1344 ++ vc->vc_num);
1345 ++
1346 ++ return 0;
1347 ++}
1348 ++
1349 ++static inline int fbcon_decor_ioctl_dosetstate(struct vc_data *vc, unsigned int state, unsigned char origin)
1350 ++{
1351 ++ int ret;
1352 ++
1353 ++// if (origin == FBCON_DECOR_IO_ORIG_USER)
1354 ++ console_lock();
1355 ++ if (!state)
1356 ++ ret = fbcon_decor_disable(vc, 1);
1357 ++ else
1358 ++ ret = fbcon_decor_enable(vc);
1359 ++// if (origin == FBCON_DECOR_IO_ORIG_USER)
1360 ++ console_unlock();
1361 ++
1362 ++ return ret;
1363 ++}
1364 ++
1365 ++static inline void fbcon_decor_ioctl_dogetstate(struct vc_data *vc, unsigned int *state)
1366 ++{
1367 ++ *state = vc->vc_decor.state;
1368 ++}
1369 ++
1370 ++static int fbcon_decor_ioctl_dosetcfg(struct vc_data *vc, struct vc_decor *cfg, unsigned char origin)
1371 ++{
1372 ++ struct fb_info *info;
1373 ++ int len;
1374 ++ char *tmp;
1375 ++
1376 ++ info = registered_fb[(int) con2fb_map[vc->vc_num]];
1377 ++
1378 ++ if (info == NULL || !cfg->twidth || !cfg->theight ||
1379 ++ cfg->tx + cfg->twidth > info->var.xres ||
1380 ++ cfg->ty + cfg->theight > info->var.yres)
1381 ++ return -EINVAL;
1382 ++
1383 ++ len = strlen_user(cfg->theme);
1384 ++ if (!len || len > FBCON_DECOR_THEME_LEN)
1385 ++ return -EINVAL;
1386 ++ tmp = kmalloc(len, GFP_KERNEL);
1387 ++ if (!tmp)
1388 ++ return -ENOMEM;
1389 ++ if (copy_from_user(tmp, (void __user *)cfg->theme, len))
1390 ++ return -EFAULT;
1391 ++ cfg->theme = tmp;
1392 ++ cfg->state = 0;
1393 ++
1394 ++ /* If this ioctl is a response to a request from kernel, the console sem
1395 ++ * is already held; we also don't need to disable decor because either the
1396 ++ * new config and background picture will be successfully loaded, and the
1397 ++ * decor will stay on, or in case of a failure it'll be turned off in fbcon. */
1398 ++// if (origin == FBCON_DECOR_IO_ORIG_USER) {
1399 ++ console_lock();
1400 ++ if (vc->vc_decor.state)
1401 ++ fbcon_decor_disable(vc, 1);
1402 ++// }
1403 ++
1404 ++ if (vc->vc_decor.theme)
1405 ++ kfree(vc->vc_decor.theme);
1406 ++
1407 ++ vc->vc_decor = *cfg;
1408 ++
1409 ++// if (origin == FBCON_DECOR_IO_ORIG_USER)
1410 ++ console_unlock();
1411 ++
1412 ++ printk(KERN_INFO "fbcondecor: console %d using theme '%s'\n",
1413 ++ vc->vc_num, vc->vc_decor.theme);
1414 ++ return 0;
1415 ++}
1416 ++
1417 ++static int fbcon_decor_ioctl_dogetcfg(struct vc_data *vc, struct vc_decor *decor)
1418 ++{
1419 ++ char __user *tmp;
1420 ++
1421 ++ tmp = decor->theme;
1422 ++ *decor = vc->vc_decor;
1423 ++ decor->theme = tmp;
1424 ++
1425 ++ if (vc->vc_decor.theme) {
1426 ++ if (copy_to_user(tmp, vc->vc_decor.theme, strlen(vc->vc_decor.theme) + 1))
1427 ++ return -EFAULT;
1428 ++ } else
1429 ++ if (put_user(0, tmp))
1430 ++ return -EFAULT;
1431 ++
1432 ++ return 0;
1433 ++}
1434 ++
1435 ++static int fbcon_decor_ioctl_dosetpic(struct vc_data *vc, struct fb_image *img, unsigned char origin)
1436 ++{
1437 ++ struct fb_info *info;
1438 ++ int len;
1439 ++ u8 *tmp;
1440 ++
1441 ++ if (vc->vc_num != fg_console)
1442 ++ return -EINVAL;
1443 ++
1444 ++ info = registered_fb[(int) con2fb_map[vc->vc_num]];
1445 ++
1446 ++ if (info == NULL)
1447 ++ return -EINVAL;
1448 ++
1449 ++ if (img->width != info->var.xres || img->height != info->var.yres) {
1450 ++ printk(KERN_ERR "fbcondecor: picture dimensions mismatch\n");
1451 ++ printk(KERN_ERR "%dx%d vs %dx%d\n", img->width, img->height, info->var.xres, info->var.yres);
1452 ++ return -EINVAL;
1453 ++ }
1454 ++
1455 ++ if (img->depth != info->var.bits_per_pixel) {
1456 ++ printk(KERN_ERR "fbcondecor: picture depth mismatch\n");
1457 ++ return -EINVAL;
1458 ++ }
1459 ++
1460 ++ if (img->depth == 8) {
1461 ++ if (!img->cmap.len || !img->cmap.red || !img->cmap.green ||
1462 ++ !img->cmap.blue)
1463 ++ return -EINVAL;
1464 ++
1465 ++ tmp = vmalloc(img->cmap.len * 3 * 2);
1466 ++ if (!tmp)
1467 ++ return -ENOMEM;
1468 ++
1469 ++ if (copy_from_user(tmp,
1470 ++ (void __user*)img->cmap.red, (img->cmap.len << 1)) ||
1471 ++ copy_from_user(tmp + (img->cmap.len << 1),
1472 ++ (void __user*)img->cmap.green, (img->cmap.len << 1)) ||
1473 ++ copy_from_user(tmp + (img->cmap.len << 2),
1474 ++ (void __user*)img->cmap.blue, (img->cmap.len << 1))) {
1475 ++ vfree(tmp);
1476 ++ return -EFAULT;
1477 ++ }
1478 ++
1479 ++ img->cmap.transp = NULL;
1480 ++ img->cmap.red = (u16*)tmp;
1481 ++ img->cmap.green = img->cmap.red + img->cmap.len;
1482 ++ img->cmap.blue = img->cmap.green + img->cmap.len;
1483 ++ } else {
1484 ++ img->cmap.red = NULL;
1485 ++ }
1486 ++
1487 ++ len = ((img->depth + 7) >> 3) * img->width * img->height;
1488 ++
1489 ++ /*
1490 ++ * Allocate an additional byte so that we never go outside of the
1491 ++ * buffer boundaries in the rendering functions in a 24 bpp mode.
1492 ++ */
1493 ++ tmp = vmalloc(len + 1);
1494 ++
1495 ++ if (!tmp)
1496 ++ goto out;
1497 ++
1498 ++ if (copy_from_user(tmp, (void __user*)img->data, len))
1499 ++ goto out;
1500 ++
1501 ++ img->data = tmp;
1502 ++
1503 ++ /* If this ioctl is a response to a request from kernel, the console sem
1504 ++ * is already held. */
1505 ++// if (origin == FBCON_DECOR_IO_ORIG_USER)
1506 ++ console_lock();
1507 ++
1508 ++ if (info->bgdecor.data)
1509 ++ vfree((u8*)info->bgdecor.data);
1510 ++ if (info->bgdecor.cmap.red)
1511 ++ vfree(info->bgdecor.cmap.red);
1512 ++
1513 ++ info->bgdecor = *img;
1514 ++
1515 ++ if (fbcon_decor_active_vc(vc) && fg_console == vc->vc_num) {
1516 ++ redraw_screen(vc, 0);
1517 ++ update_region(vc, vc->vc_origin +
1518 ++ vc->vc_size_row * vc->vc_top,
1519 ++ vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
1520 ++ fbcon_decor_clear_margins(vc, info, 0);
1521 ++ }
1522 ++
1523 ++// if (origin == FBCON_DECOR_IO_ORIG_USER)
1524 ++ console_unlock();
1525 ++
1526 ++ return 0;
1527 ++
1528 ++out: if (img->cmap.red)
1529 ++ vfree(img->cmap.red);
1530 ++
1531 ++ if (tmp)
1532 ++ vfree(tmp);
1533 ++ return -ENOMEM;
1534 ++}
1535 ++
1536 ++static long fbcon_decor_ioctl(struct file *filp, u_int cmd, u_long arg)
1537 ++{
1538 ++ struct fbcon_decor_iowrapper __user *wrapper = (void __user*) arg;
1539 ++ struct vc_data *vc = NULL;
1540 ++ unsigned short vc_num = 0;
1541 ++ unsigned char origin = 0;
1542 ++ void __user *data = NULL;
1543 ++
1544 ++ if (!access_ok(VERIFY_READ, wrapper,
1545 ++ sizeof(struct fbcon_decor_iowrapper)))
1546 ++ return -EFAULT;
1547 ++
1548 ++ __get_user(vc_num, &wrapper->vc);
1549 ++ __get_user(origin, &wrapper->origin);
1550 ++ __get_user(data, &wrapper->data);
1551 ++
1552 ++ if (!vc_cons_allocated(vc_num))
1553 ++ return -EINVAL;
1554 ++
1555 ++ vc = vc_cons[vc_num].d;
1556 ++
1557 ++ switch (cmd) {
1558 ++ case FBIOCONDECOR_SETPIC:
1559 ++ {
1560 ++ struct fb_image img;
1561 ++ if (copy_from_user(&img, (struct fb_image __user *)data, sizeof(struct fb_image)))
1562 ++ return -EFAULT;
1563 ++
1564 ++ return fbcon_decor_ioctl_dosetpic(vc, &img, origin);
1565 ++ }
1566 ++ case FBIOCONDECOR_SETCFG:
1567 ++ {
1568 ++ struct vc_decor cfg;
1569 ++ if (copy_from_user(&cfg, (struct vc_decor __user *)data, sizeof(struct vc_decor)))
1570 ++ return -EFAULT;
1571 ++
1572 ++ return fbcon_decor_ioctl_dosetcfg(vc, &cfg, origin);
1573 ++ }
1574 ++ case FBIOCONDECOR_GETCFG:
1575 ++ {
1576 ++ int rval;
1577 ++ struct vc_decor cfg;
1578 ++
1579 ++ if (copy_from_user(&cfg, (struct vc_decor __user *)data, sizeof(struct vc_decor)))
1580 ++ return -EFAULT;
1581 ++
1582 ++ rval = fbcon_decor_ioctl_dogetcfg(vc, &cfg);
1583 ++
1584 ++ if (copy_to_user(data, &cfg, sizeof(struct vc_decor)))
1585 ++ return -EFAULT;
1586 ++ return rval;
1587 ++ }
1588 ++ case FBIOCONDECOR_SETSTATE:
1589 ++ {
1590 ++ unsigned int state = 0;
1591 ++ if (get_user(state, (unsigned int __user *)data))
1592 ++ return -EFAULT;
1593 ++ return fbcon_decor_ioctl_dosetstate(vc, state, origin);
1594 ++ }
1595 ++ case FBIOCONDECOR_GETSTATE:
1596 ++ {
1597 ++ unsigned int state = 0;
1598 ++ fbcon_decor_ioctl_dogetstate(vc, &state);
1599 ++ return put_user(state, (unsigned int __user *)data);
1600 ++ }
1601 ++
1602 ++ default:
1603 ++ return -ENOIOCTLCMD;
1604 ++ }
1605 ++}
1606 ++
1607 ++#ifdef CONFIG_COMPAT
1608 ++
1609 ++static long fbcon_decor_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) {
1610 ++
1611 ++ struct fbcon_decor_iowrapper32 __user *wrapper = (void __user *)arg;
1612 ++ struct vc_data *vc = NULL;
1613 ++ unsigned short vc_num = 0;
1614 ++ unsigned char origin = 0;
1615 ++ compat_uptr_t data_compat = 0;
1616 ++ void __user *data = NULL;
1617 ++
1618 ++ if (!access_ok(VERIFY_READ, wrapper,
1619 ++ sizeof(struct fbcon_decor_iowrapper32)))
1620 ++ return -EFAULT;
1621 ++
1622 ++ __get_user(vc_num, &wrapper->vc);
1623 ++ __get_user(origin, &wrapper->origin);
1624 ++ __get_user(data_compat, &wrapper->data);
1625 ++ data = compat_ptr(data_compat);
1626 ++
1627 ++ if (!vc_cons_allocated(vc_num))
1628 ++ return -EINVAL;
1629 ++
1630 ++ vc = vc_cons[vc_num].d;
1631 ++
1632 ++ switch (cmd) {
1633 ++ case FBIOCONDECOR_SETPIC32:
1634 ++ {
1635 ++ struct fb_image32 img_compat;
1636 ++ struct fb_image img;
1637 ++
1638 ++ if (copy_from_user(&img_compat, (struct fb_image32 __user *)data, sizeof(struct fb_image32)))
1639 ++ return -EFAULT;
1640 ++
1641 ++ fb_image_from_compat(img, img_compat);
1642 ++
1643 ++ return fbcon_decor_ioctl_dosetpic(vc, &img, origin);
1644 ++ }
1645 ++
1646 ++ case FBIOCONDECOR_SETCFG32:
1647 ++ {
1648 ++ struct vc_decor32 cfg_compat;
1649 ++ struct vc_decor cfg;
1650 ++
1651 ++ if (copy_from_user(&cfg_compat, (struct vc_decor32 __user *)data, sizeof(struct vc_decor32)))
1652 ++ return -EFAULT;
1653 ++
1654 ++ vc_decor_from_compat(cfg, cfg_compat);
1655 ++
1656 ++ return fbcon_decor_ioctl_dosetcfg(vc, &cfg, origin);
1657 ++ }
1658 ++
1659 ++ case FBIOCONDECOR_GETCFG32:
1660 ++ {
1661 ++ int rval;
1662 ++ struct vc_decor32 cfg_compat;
1663 ++ struct vc_decor cfg;
1664 ++
1665 ++ if (copy_from_user(&cfg_compat, (struct vc_decor32 __user *)data, sizeof(struct vc_decor32)))
1666 ++ return -EFAULT;
1667 ++ cfg.theme = compat_ptr(cfg_compat.theme);
1668 ++
1669 ++ rval = fbcon_decor_ioctl_dogetcfg(vc, &cfg);
1670 ++
1671 ++ vc_decor_to_compat(cfg_compat, cfg);
1672 ++
1673 ++ if (copy_to_user((struct vc_decor32 __user *)data, &cfg_compat, sizeof(struct vc_decor32)))
1674 ++ return -EFAULT;
1675 ++ return rval;
1676 ++ }
1677 ++
1678 ++ case FBIOCONDECOR_SETSTATE32:
1679 ++ {
1680 ++ compat_uint_t state_compat = 0;
1681 ++ unsigned int state = 0;
1682 ++
1683 ++ if (get_user(state_compat, (compat_uint_t __user *)data))
1684 ++ return -EFAULT;
1685 ++
1686 ++ state = (unsigned int)state_compat;
1687 ++
1688 ++ return fbcon_decor_ioctl_dosetstate(vc, state, origin);
1689 ++ }
1690 ++
1691 ++ case FBIOCONDECOR_GETSTATE32:
1692 ++ {
1693 ++ compat_uint_t state_compat = 0;
1694 ++ unsigned int state = 0;
1695 ++
1696 ++ fbcon_decor_ioctl_dogetstate(vc, &state);
1697 ++ state_compat = (compat_uint_t)state;
1698 ++
1699 ++ return put_user(state_compat, (compat_uint_t __user *)data);
1700 ++ }
1701 ++
1702 ++ default:
1703 ++ return -ENOIOCTLCMD;
1704 ++ }
1705 ++}
1706 ++#else
1707 ++ #define fbcon_decor_compat_ioctl NULL
1708 ++#endif
1709 ++
1710 ++static struct file_operations fbcon_decor_ops = {
1711 ++ .owner = THIS_MODULE,
1712 ++ .unlocked_ioctl = fbcon_decor_ioctl,
1713 ++ .compat_ioctl = fbcon_decor_compat_ioctl
1714 ++};
1715 ++
1716 ++static struct miscdevice fbcon_decor_dev = {
1717 ++ .minor = MISC_DYNAMIC_MINOR,
1718 ++ .name = "fbcondecor",
1719 ++ .fops = &fbcon_decor_ops
1720 ++};
1721 ++
1722 ++void fbcon_decor_reset(void)
1723 ++{
1724 ++ int i;
1725 ++
1726 ++ for (i = 0; i < num_registered_fb; i++) {
1727 ++ registered_fb[i]->bgdecor.data = NULL;
1728 ++ registered_fb[i]->bgdecor.cmap.red = NULL;
1729 ++ }
1730 ++
1731 ++ for (i = 0; i < MAX_NR_CONSOLES && vc_cons[i].d; i++) {
1732 ++ vc_cons[i].d->vc_decor.state = vc_cons[i].d->vc_decor.twidth =
1733 ++ vc_cons[i].d->vc_decor.theight = 0;
1734 ++ vc_cons[i].d->vc_decor.theme = NULL;
1735 ++ }
1736 ++
1737 ++ return;
1738 ++}
1739 ++
1740 ++int fbcon_decor_init(void)
1741 ++{
1742 ++ int i;
1743 ++
1744 ++ fbcon_decor_reset();
1745 ++
1746 ++ if (initialized)
1747 ++ return 0;
1748 ++
1749 ++ i = misc_register(&fbcon_decor_dev);
1750 ++ if (i) {
1751 ++ printk(KERN_ERR "fbcondecor: failed to register device\n");
1752 ++ return i;
1753 ++ }
1754 ++
1755 ++ fbcon_decor_call_helper("init", 0);
1756 ++ initialized = 1;
1757 ++ return 0;
1758 ++}
1759 ++
1760 ++int fbcon_decor_exit(void)
1761 ++{
1762 ++ fbcon_decor_reset();
1763 ++ return 0;
1764 ++}
1765 ++
1766 ++EXPORT_SYMBOL(fbcon_decor_path);
1767 +diff --git a/drivers/video/console/fbcondecor.h b/drivers/video/console/fbcondecor.h
1768 +new file mode 100644
1769 +index 0000000..3b3724b
1770 +--- /dev/null
1771 ++++ b/drivers/video/console/fbcondecor.h
1772 +@@ -0,0 +1,78 @@
1773 ++/*
1774 ++ * linux/drivers/video/console/fbcondecor.h -- Framebuffer Console Decoration headers
1775 ++ *
1776 ++ * Copyright (C) 2004 Michal Januszewski <michalj+fbcondecor@×××××.com>
1777 ++ *
1778 ++ */
1779 ++
1780 ++#ifndef __FBCON_DECOR_H
1781 ++#define __FBCON_DECOR_H
1782 ++
1783 ++#ifndef _LINUX_FB_H
1784 ++#include <linux/fb.h>
1785 ++#endif
1786 ++
1787 ++/* This is needed for vc_cons in fbcmap.c */
1788 ++#include <linux/vt_kern.h>
1789 ++
1790 ++struct fb_cursor;
1791 ++struct fb_info;
1792 ++struct vc_data;
1793 ++
1794 ++#ifdef CONFIG_FB_CON_DECOR
1795 ++/* fbcondecor.c */
1796 ++int fbcon_decor_init(void);
1797 ++int fbcon_decor_exit(void);
1798 ++int fbcon_decor_call_helper(char* cmd, unsigned short cons);
1799 ++int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw);
1800 ++
1801 ++/* cfbcondecor.c */
1802 ++void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info, const unsigned short *s, int count, int yy, int xx);
1803 ++void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor);
1804 ++void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width);
1805 ++void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info, int bottom_only);
1806 ++void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank);
1807 ++void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y, int sx, int dx, int width);
1808 ++void fbcon_decor_copy(u8 *dst, u8 *src, int height, int width, int linebytes, int srclinesbytes, int bpp);
1809 ++void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc);
1810 ++
1811 ++/* vt.c */
1812 ++void acquire_console_sem(void);
1813 ++void release_console_sem(void);
1814 ++void do_unblank_screen(int entering_gfx);
1815 ++
1816 ++/* struct vc_data *y */
1817 ++#define fbcon_decor_active_vc(y) (y->vc_decor.state && y->vc_decor.theme)
1818 ++
1819 ++/* struct fb_info *x, struct vc_data *y */
1820 ++#define fbcon_decor_active_nores(x,y) (x->bgdecor.data && fbcon_decor_active_vc(y))
1821 ++
1822 ++/* struct fb_info *x, struct vc_data *y */
1823 ++#define fbcon_decor_active(x,y) (fbcon_decor_active_nores(x,y) && \
1824 ++ x->bgdecor.width == x->var.xres && \
1825 ++ x->bgdecor.height == x->var.yres && \
1826 ++ x->bgdecor.depth == x->var.bits_per_pixel)
1827 ++
1828 ++
1829 ++#else /* CONFIG_FB_CON_DECOR */
1830 ++
1831 ++static inline void fbcon_decor_putcs(struct vc_data *vc, struct fb_info *info, const unsigned short *s, int count, int yy, int xx) {}
1832 ++static inline void fbcon_decor_putc(struct vc_data *vc, struct fb_info *info, int c, int ypos, int xpos) {}
1833 ++static inline void fbcon_decor_cursor(struct fb_info *info, struct fb_cursor *cursor) {}
1834 ++static inline void fbcon_decor_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width) {}
1835 ++static inline void fbcon_decor_clear_margins(struct vc_data *vc, struct fb_info *info, int bottom_only) {}
1836 ++static inline void fbcon_decor_blank(struct vc_data *vc, struct fb_info *info, int blank) {}
1837 ++static inline void fbcon_decor_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y, int sx, int dx, int width) {}
1838 ++static inline void fbcon_decor_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc) {}
1839 ++static inline int fbcon_decor_call_helper(char* cmd, unsigned short cons) { return 0; }
1840 ++static inline int fbcon_decor_init(void) { return 0; }
1841 ++static inline int fbcon_decor_exit(void) { return 0; }
1842 ++static inline int fbcon_decor_disable(struct vc_data *vc, unsigned char redraw) { return 0; }
1843 ++
1844 ++#define fbcon_decor_active_vc(y) (0)
1845 ++#define fbcon_decor_active_nores(x,y) (0)
1846 ++#define fbcon_decor_active(x,y) (0)
1847 ++
1848 ++#endif /* CONFIG_FB_CON_DECOR */
1849 ++
1850 ++#endif /* __FBCON_DECOR_H */
1851 +diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
1852 +index e1f4727..2952e33 100644
1853 +--- a/drivers/video/fbdev/Kconfig
1854 ++++ b/drivers/video/fbdev/Kconfig
1855 +@@ -1204,7 +1204,6 @@ config FB_MATROX
1856 + select FB_CFB_FILLRECT
1857 + select FB_CFB_COPYAREA
1858 + select FB_CFB_IMAGEBLIT
1859 +- select FB_TILEBLITTING
1860 + select FB_MACMODES if PPC_PMAC
1861 + ---help---
1862 + Say Y here if you have a Matrox Millennium, Matrox Millennium II,
1863 +diff --git a/drivers/video/fbdev/core/fbcmap.c b/drivers/video/fbdev/core/fbcmap.c
1864 +index f89245b..05e036c 100644
1865 +--- a/drivers/video/fbdev/core/fbcmap.c
1866 ++++ b/drivers/video/fbdev/core/fbcmap.c
1867 +@@ -17,6 +17,8 @@
1868 + #include <linux/slab.h>
1869 + #include <linux/uaccess.h>
1870 +
1871 ++#include "../../console/fbcondecor.h"
1872 ++
1873 + static u16 red2[] __read_mostly = {
1874 + 0x0000, 0xaaaa
1875 + };
1876 +@@ -249,14 +251,17 @@ int fb_set_cmap(struct fb_cmap *cmap, struct fb_info *info)
1877 + if (transp)
1878 + htransp = *transp++;
1879 + if (info->fbops->fb_setcolreg(start++,
1880 +- hred, hgreen, hblue,
1881 ++ hred, hgreen, hblue,
1882 + htransp, info))
1883 + break;
1884 + }
1885 + }
1886 +- if (rc == 0)
1887 ++ if (rc == 0) {
1888 + fb_copy_cmap(cmap, &info->cmap);
1889 +-
1890 ++ if (fbcon_decor_active(info, vc_cons[fg_console].d) &&
1891 ++ info->fix.visual == FB_VISUAL_DIRECTCOLOR)
1892 ++ fbcon_decor_fix_pseudo_pal(info, vc_cons[fg_console].d);
1893 ++ }
1894 + return rc;
1895 + }
1896 +
1897 +diff --git a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
1898 +index b6d5008..d6703f2 100644
1899 +--- a/drivers/video/fbdev/core/fbmem.c
1900 ++++ b/drivers/video/fbdev/core/fbmem.c
1901 +@@ -1250,15 +1250,6 @@ struct fb_fix_screeninfo32 {
1902 + u16 reserved[3];
1903 + };
1904 +
1905 +-struct fb_cmap32 {
1906 +- u32 start;
1907 +- u32 len;
1908 +- compat_caddr_t red;
1909 +- compat_caddr_t green;
1910 +- compat_caddr_t blue;
1911 +- compat_caddr_t transp;
1912 +-};
1913 +-
1914 + static int fb_getput_cmap(struct fb_info *info, unsigned int cmd,
1915 + unsigned long arg)
1916 + {
1917 +diff --git a/include/linux/console_decor.h b/include/linux/console_decor.h
1918 +new file mode 100644
1919 +index 0000000..04b8d80
1920 +--- /dev/null
1921 ++++ b/include/linux/console_decor.h
1922 +@@ -0,0 +1,46 @@
1923 ++#ifndef _LINUX_CONSOLE_DECOR_H_
1924 ++#define _LINUX_CONSOLE_DECOR_H_ 1
1925 ++
1926 ++/* A structure used by the framebuffer console decorations (drivers/video/console/fbcondecor.c) */
1927 ++struct vc_decor {
1928 ++ __u8 bg_color; /* The color that is to be treated as transparent */
1929 ++ __u8 state; /* Current decor state: 0 = off, 1 = on */
1930 ++ __u16 tx, ty; /* Top left corner coordinates of the text field */
1931 ++ __u16 twidth, theight; /* Width and height of the text field */
1932 ++ char* theme;
1933 ++};
1934 ++
1935 ++#ifdef __KERNEL__
1936 ++#ifdef CONFIG_COMPAT
1937 ++#include <linux/compat.h>
1938 ++
1939 ++struct vc_decor32 {
1940 ++ __u8 bg_color; /* The color that is to be treated as transparent */
1941 ++ __u8 state; /* Current decor state: 0 = off, 1 = on */
1942 ++ __u16 tx, ty; /* Top left corner coordinates of the text field */
1943 ++ __u16 twidth, theight; /* Width and height of the text field */
1944 ++ compat_uptr_t theme;
1945 ++};
1946 ++
1947 ++#define vc_decor_from_compat(to, from) \
1948 ++ (to).bg_color = (from).bg_color; \
1949 ++ (to).state = (from).state; \
1950 ++ (to).tx = (from).tx; \
1951 ++ (to).ty = (from).ty; \
1952 ++ (to).twidth = (from).twidth; \
1953 ++ (to).theight = (from).theight; \
1954 ++ (to).theme = compat_ptr((from).theme)
1955 ++
1956 ++#define vc_decor_to_compat(to, from) \
1957 ++ (to).bg_color = (from).bg_color; \
1958 ++ (to).state = (from).state; \
1959 ++ (to).tx = (from).tx; \
1960 ++ (to).ty = (from).ty; \
1961 ++ (to).twidth = (from).twidth; \
1962 ++ (to).theight = (from).theight; \
1963 ++ (to).theme = ptr_to_compat((from).theme)
1964 ++
1965 ++#endif /* CONFIG_COMPAT */
1966 ++#endif /* __KERNEL__ */
1967 ++
1968 ++#endif
1969 +diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h
1970 +index 7f0c329..98f5d60 100644
1971 +--- a/include/linux/console_struct.h
1972 ++++ b/include/linux/console_struct.h
1973 +@@ -19,6 +19,7 @@
1974 + struct vt_struct;
1975 +
1976 + #define NPAR 16
1977 ++#include <linux/console_decor.h>
1978 +
1979 + struct vc_data {
1980 + struct tty_port port; /* Upper level data */
1981 +@@ -107,6 +108,8 @@ struct vc_data {
1982 + unsigned long vc_uni_pagedir;
1983 + unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
1984 + bool vc_panic_force_write; /* when oops/panic this VC can accept forced output/blanking */
1985 ++
1986 ++ struct vc_decor vc_decor;
1987 + /* additional information is in vt_kern.h */
1988 + };
1989 +
1990 +diff --git a/include/linux/fb.h b/include/linux/fb.h
1991 +index fe6ac95..1e36b03 100644
1992 +--- a/include/linux/fb.h
1993 ++++ b/include/linux/fb.h
1994 +@@ -219,6 +219,34 @@ struct fb_deferred_io {
1995 + };
1996 + #endif
1997 +
1998 ++#ifdef __KERNEL__
1999 ++#ifdef CONFIG_COMPAT
2000 ++struct fb_image32 {
2001 ++ __u32 dx; /* Where to place image */
2002 ++ __u32 dy;
2003 ++ __u32 width; /* Size of image */
2004 ++ __u32 height;
2005 ++ __u32 fg_color; /* Only used when a mono bitmap */
2006 ++ __u32 bg_color;
2007 ++ __u8 depth; /* Depth of the image */
2008 ++ const compat_uptr_t data; /* Pointer to image data */
2009 ++ struct fb_cmap32 cmap; /* color map info */
2010 ++};
2011 ++
2012 ++#define fb_image_from_compat(to, from) \
2013 ++ (to).dx = (from).dx; \
2014 ++ (to).dy = (from).dy; \
2015 ++ (to).width = (from).width; \
2016 ++ (to).height = (from).height; \
2017 ++ (to).fg_color = (from).fg_color; \
2018 ++ (to).bg_color = (from).bg_color; \
2019 ++ (to).depth = (from).depth; \
2020 ++ (to).data = compat_ptr((from).data); \
2021 ++ fb_cmap_from_compat((to).cmap, (from).cmap)
2022 ++
2023 ++#endif /* CONFIG_COMPAT */
2024 ++#endif /* __KERNEL__ */
2025 ++
2026 + /*
2027 + * Frame buffer operations
2028 + *
2029 +@@ -489,6 +517,9 @@ struct fb_info {
2030 + #define FBINFO_STATE_SUSPENDED 1
2031 + u32 state; /* Hardware state i.e suspend */
2032 + void *fbcon_par; /* fbcon use-only private area */
2033 ++
2034 ++ struct fb_image bgdecor;
2035 ++
2036 + /* From here on everything is device dependent */
2037 + void *par;
2038 + /* we need the PCI or similar aperture base/size not
2039 +diff --git a/include/uapi/linux/fb.h b/include/uapi/linux/fb.h
2040 +index fb795c3..dc77a03 100644
2041 +--- a/include/uapi/linux/fb.h
2042 ++++ b/include/uapi/linux/fb.h
2043 +@@ -8,6 +8,25 @@
2044 +
2045 + #define FB_MAX 32 /* sufficient for now */
2046 +
2047 ++struct fbcon_decor_iowrapper
2048 ++{
2049 ++ unsigned short vc; /* Virtual console */
2050 ++ unsigned char origin; /* Point of origin of the request */
2051 ++ void *data;
2052 ++};
2053 ++
2054 ++#ifdef __KERNEL__
2055 ++#ifdef CONFIG_COMPAT
2056 ++#include <linux/compat.h>
2057 ++struct fbcon_decor_iowrapper32
2058 ++{
2059 ++ unsigned short vc; /* Virtual console */
2060 ++ unsigned char origin; /* Point of origin of the request */
2061 ++ compat_uptr_t data;
2062 ++};
2063 ++#endif /* CONFIG_COMPAT */
2064 ++#endif /* __KERNEL__ */
2065 ++
2066 + /* ioctls
2067 + 0x46 is 'F' */
2068 + #define FBIOGET_VSCREENINFO 0x4600
2069 +@@ -35,6 +54,25 @@
2070 + #define FBIOGET_DISPINFO 0x4618
2071 + #define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
2072 +
2073 ++#define FBIOCONDECOR_SETCFG _IOWR('F', 0x19, struct fbcon_decor_iowrapper)
2074 ++#define FBIOCONDECOR_GETCFG _IOR('F', 0x1A, struct fbcon_decor_iowrapper)
2075 ++#define FBIOCONDECOR_SETSTATE _IOWR('F', 0x1B, struct fbcon_decor_iowrapper)
2076 ++#define FBIOCONDECOR_GETSTATE _IOR('F', 0x1C, struct fbcon_decor_iowrapper)
2077 ++#define FBIOCONDECOR_SETPIC _IOWR('F', 0x1D, struct fbcon_decor_iowrapper)
2078 ++#ifdef __KERNEL__
2079 ++#ifdef CONFIG_COMPAT
2080 ++#define FBIOCONDECOR_SETCFG32 _IOWR('F', 0x19, struct fbcon_decor_iowrapper32)
2081 ++#define FBIOCONDECOR_GETCFG32 _IOR('F', 0x1A, struct fbcon_decor_iowrapper32)
2082 ++#define FBIOCONDECOR_SETSTATE32 _IOWR('F', 0x1B, struct fbcon_decor_iowrapper32)
2083 ++#define FBIOCONDECOR_GETSTATE32 _IOR('F', 0x1C, struct fbcon_decor_iowrapper32)
2084 ++#define FBIOCONDECOR_SETPIC32 _IOWR('F', 0x1D, struct fbcon_decor_iowrapper32)
2085 ++#endif /* CONFIG_COMPAT */
2086 ++#endif /* __KERNEL__ */
2087 ++
2088 ++#define FBCON_DECOR_THEME_LEN 128 /* Maximum lenght of a theme name */
2089 ++#define FBCON_DECOR_IO_ORIG_KERNEL 0 /* Kernel ioctl origin */
2090 ++#define FBCON_DECOR_IO_ORIG_USER 1 /* User ioctl origin */
2091 ++
2092 + #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
2093 + #define FB_TYPE_PLANES 1 /* Non interleaved planes */
2094 + #define FB_TYPE_INTERLEAVED_PLANES 2 /* Interleaved planes */
2095 +@@ -277,6 +315,29 @@ struct fb_var_screeninfo {
2096 + __u32 reserved[4]; /* Reserved for future compatibility */
2097 + };
2098 +
2099 ++#ifdef __KERNEL__
2100 ++#ifdef CONFIG_COMPAT
2101 ++struct fb_cmap32 {
2102 ++ __u32 start;
2103 ++ __u32 len; /* Number of entries */
2104 ++ compat_uptr_t red; /* Red values */
2105 ++ compat_uptr_t green;
2106 ++ compat_uptr_t blue;
2107 ++ compat_uptr_t transp; /* transparency, can be NULL */
2108 ++};
2109 ++
2110 ++#define fb_cmap_from_compat(to, from) \
2111 ++ (to).start = (from).start; \
2112 ++ (to).len = (from).len; \
2113 ++ (to).red = compat_ptr((from).red); \
2114 ++ (to).green = compat_ptr((from).green); \
2115 ++ (to).blue = compat_ptr((from).blue); \
2116 ++ (to).transp = compat_ptr((from).transp)
2117 ++
2118 ++#endif /* CONFIG_COMPAT */
2119 ++#endif /* __KERNEL__ */
2120 ++
2121 ++
2122 + struct fb_cmap {
2123 + __u32 start; /* First entry */
2124 + __u32 len; /* Number of entries */
2125 +diff --git a/kernel/sysctl.c b/kernel/sysctl.c
2126 +index 74f5b58..6386ab0 100644
2127 +--- a/kernel/sysctl.c
2128 ++++ b/kernel/sysctl.c
2129 +@@ -146,6 +146,10 @@ static const int cap_last_cap = CAP_LAST_CAP;
2130 + static unsigned long hung_task_timeout_max = (LONG_MAX/HZ);
2131 + #endif
2132 +
2133 ++#ifdef CONFIG_FB_CON_DECOR
2134 ++extern char fbcon_decor_path[];
2135 ++#endif
2136 ++
2137 + #ifdef CONFIG_INOTIFY_USER
2138 + #include <linux/inotify.h>
2139 + #endif
2140 +@@ -255,6 +259,15 @@ static struct ctl_table sysctl_base_table[] = {
2141 + .mode = 0555,
2142 + .child = dev_table,
2143 + },
2144 ++#ifdef CONFIG_FB_CON_DECOR
2145 ++ {
2146 ++ .procname = "fbcondecor",
2147 ++ .data = &fbcon_decor_path,
2148 ++ .maxlen = KMOD_PATH_LEN,
2149 ++ .mode = 0644,
2150 ++ .proc_handler = &proc_dostring,
2151 ++ },
2152 ++#endif
2153 + { }
2154 + };
2155 +