/[linux-patches]/genpatches-2.6/trunk/2.6.22-pre/4200_fbsplash-0.9.2-r5.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.22-pre/4200_fbsplash-0.9.2-r5.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 963 - (show annotations) (download)
Sat May 19 09:58:57 2007 UTC (11 years, 4 months ago) by phreak
File size: 52514 byte(s)
Starting branch for 2.6.22.
1 ---
2 Documentation/fb/00-INDEX | 2
3 Documentation/fb/splash.txt | 207 +++++++++++++++++
4 drivers/Makefile | 7
5 drivers/video/Kconfig | 12 -
6 drivers/video/Makefile | 1
7 drivers/video/cfbsplash.c | 471 ++++++++++++++++++++++++++++++++++++++++
8 drivers/video/console/bitblit.c | 20 +
9 drivers/video/console/fbcon.c | 159 +++++++++++--
10 drivers/video/fbcmap.c | 12 -
11 drivers/video/fbsplash.c | 424 ++++++++++++++++++++++++++++++++++++
12 drivers/video/fbsplash.h | 78 ++++++
13 include/linux/console_splash.h | 13 +
14 include/linux/console_struct.h | 3
15 include/linux/fb.h | 20 +
16 include/linux/sysctl.h | 1
17 kernel/sysctl.c | 14 +
18 16 files changed, 1410 insertions(+), 34 deletions(-)
19
20 --- a/Documentation/fb/00-INDEX
21 +++ b/Documentation/fb/00-INDEX
22 @@ -19,6 +19,8 @@ matroxfb.txt
23 - info on the Matrox frame buffer driver
24 pvr2fb.txt
25 - info on the PowerVR 2 frame buffer driver
26 +splash.txt
27 + - info on the Framebuffer Splash
28 tgafb.txt
29 - info on the TGA (DECChip 21030) frame buffer driver
30 vesafb.txt
31 --- /dev/null
32 +++ b/Documentation/fb/splash.txt
33 @@ -0,0 +1,207 @@
34 +What is it?
35 +-----------
36 +
37 +The framebuffer splash is a kernel feature that allows displaying a background
38 +picture on selected consoles.
39 +
40 +What do I need to get it to work?
41 +---------------------------------
42 +
43 +To get fb splash up-and-running you will have to:
44 + 1) get a copy of splashutils [1] or a similar program
45 + 2) get some splash themes
46 + 3) build the kernel helper program
47 + 4) build your kernel with the FB_SPLASH option enabled.
48 +
49 +To get fbsplash operational right after fbcon initialization is finished, you
50 +will have to include a theme and the kernel helper into your initramfs image.
51 +Please refer to splashutils documentation for instructions on how to do that.
52 +
53 +[1] The splashutils package can be downloaded from:
54 + http://dev.gentoo.org/~spock/projects/splashutils/
55 +
56 +The userspace helper
57 +--------------------
58 +
59 +The userspace splash helper (by default: /sbin/splash_helper) is called by the
60 +kernel whenever an important event occurs and the kernel needs some kind of
61 +job to be carried out. Important events include console switches and video
62 +mode switches (the kernel requests background images and configuration
63 +parameters for the current console). The splash helper must be accessible at
64 +all times. If it's not, fbsplash will be switched off automatically.
65 +
66 +It's possible to set path to the splash helper by writing it to
67 +/proc/sys/kernel/fbsplash.
68 +
69 +*****************************************************************************
70 +
71 +The information below is mostly technical stuff. There's probably no need to
72 +read it unless you plan to develop a userspace helper.
73 +
74 +The splash protocol
75 +-------------------
76 +
77 +The splash protocol defines a communication interface between the kernel and
78 +the userspace splash helper.
79 +
80 +The kernel side is responsible for:
81 +
82 + * rendering console text, using an image as a background (instead of a
83 + standard solid color fbcon uses),
84 + * accepting commands from the user via ioctls on the fbsplash device,
85 + * calling the userspace helper to set things up as soon as the fb subsystem
86 + is initialized.
87 +
88 +The userspace helper is responsible for everything else, including parsing
89 +configuration files, decompressing the image files whenever the kernel needs
90 +it, and communicating with the kernel if necessary.
91 +
92 +The splash protocol specifies how communication is done in both ways:
93 +kernel->userspace and userspace->helper.
94 +
95 +Kernel -> Userspace
96 +-------------------
97 +
98 +The kernel communicates with the userspace helper by calling it and specifying
99 +the task to be done in a series of arguments.
100 +
101 +The arguments follow the pattern:
102 +<splash protocol version> <command> <parameters>
103 +
104 +All commands defined in splash protocol v2 have the following parameters:
105 + virtual console
106 + framebuffer number
107 + theme
108 +
109 +Splash protocol v1 specified an additional 'fbsplash mode' after the
110 +framebuffer number. Splash protocol v1 is deprecated and should not be used.
111 +
112 +Splash protocol v2 specifies the following commands:
113 +
114 +getpic
115 +------
116 + The kernel issues this command to request image data. It's up to the
117 + userspace helper to find a background image appropriate for the specified
118 + theme and the current resolution. The userspace helper should respond by
119 + issuing the FBIOSPLASH_SETPIC ioctl.
120 +
121 +init
122 +----
123 + The kernel issues this command after the fbsplash device is created and
124 + the fbsplash interface is initialized. Upon receiving 'init', the userspace
125 + helper should parse the kernel command line (/proc/cmdline) or otherwise
126 + decide whether fbsplash is to be activated.
127 +
128 + To activate fbsplash on the first console the helper should issue the
129 + FBIOSPLASH_SETCFG, FBIOSPLASH_SETPIC and FBIOSPLASH_SETSTATE commands,
130 + in the above-mentioned order.
131 +
132 + When the userspace helper is called in an early phase of the boot process
133 + (right after the initialization of fbcon), no filesystems will be mounted.
134 + The helper program should mount sysfs and then create the appropriate
135 + framebuffer, fbsplash and tty0 devices (if they don't already exist) to get
136 + current display settings and to be able to communicate with the kernel side.
137 + It should probably also mount the procfs to be able to parse the kernel
138 + command line parameters.
139 +
140 + Note that the console sem is not held when the kernel calls splash_helper
141 + with the 'init' command. The splash helper should perform all ioctls with
142 + origin set to FB_SPLASH_IO_ORIG_USER.
143 +
144 +modechange
145 +----------
146 + The kernel issues this command on a mode change. The helper's response should
147 + be similar to the response to the 'init' command. Note that this time the
148 + console sem is held and all ioctls must be performed with origin set to
149 + FB_SPLASH_IO_ORIG_KERNEL.
150 +
151 +
152 +Userspace -> Kernel
153 +-------------------
154 +
155 +Userspace programs can communicate with fbsplash via ioctls on the fbsplash
156 +device. These ioctls are to be used by both the userspace helper (called
157 +only by the kernel) and userspace configuration tools (run by the users).
158 +
159 +The splash helper should set the origin field to FB_SPLASH_IO_ORIG_KERNEL
160 +when doing the appropriate ioctls. All userspace configuration tools should
161 +use FB_SPLASH_IO_ORIG_USER. Failure to set the appropriate value in the origin
162 +field when performing ioctls from the kernel helper will most likely result
163 +in a console deadlock.
164 +
165 +FB_SPLASH_IO_ORIG_KERNEL instructs fbsplash not to try to acquire the console
166 +semaphore. Not surprisingly, FB_SPLASH_IO_ORIG_USER instructs it to acquire
167 +the console sem.
168 +
169 +The framebuffer splash provides the following ioctls (all defined in
170 +linux/fb.h):
171 +
172 +FBIOSPLASH_SETPIC
173 +description: loads a background picture for a virtual console
174 +argument: struct fb_splash_iowrapper*; data: struct fb_image*
175 +notes:
176 +If called for consoles other than the current foreground one, the picture data
177 +will be ignored.
178 +
179 +If the current virtual console is running in a 8-bpp mode, the cmap substruct
180 +of fb_image has to be filled appropriately: start should be set to 16 (first
181 +16 colors are reserved for fbcon), len to a value <= 240 and red, green and
182 +blue should point to valid cmap data. The transp field is ingored. The fields
183 +dx, dy, bg_color, fg_color in fb_image are ignored as well.
184 +
185 +FBIOSPLASH_SETCFG
186 +description: sets the fbsplash config for a virtual console
187 +argument: struct fb_splash_iowrapper*; data: struct vc_splash*
188 +notes: The structure has to be filled with valid data.
189 +
190 +FBIOSPLASH_GETCFG
191 +description: gets the fbsplash config for a virtual console
192 +argument: struct fb_splash_iowrapper*; data: struct vc_splash*
193 +
194 +FBIOSPLASH_SETSTATE
195 +description: sets the fbsplash state for a virtual console
196 +argument: struct fb_splash_iowrapper*; data: unsigned int*
197 + values: 0 = disabled, 1 = enabled.
198 +
199 +FBIOSPLASH_GETSTATE
200 +description: gets the fbsplash state for a virtual console
201 +argument: struct fb_splash_iowrapper*; data: unsigned int*
202 + values: as in FBIOSPLASH_SETSTATE
203 +
204 +Info on used structures:
205 +
206 +Definition of struct vc_splash can be found in linux/console_splash.h. It's
207 +heavily commented. Note that the 'theme' field should point to a string
208 +no longer than FB_SPLASH_THEME_LEN. When FBIOSPLASH_GETCFG call is
209 +performed, the theme field should point to a char buffer of length
210 +FB_SPLASH_THEME_LEN.
211 +
212 +Definition of struct fb_splash_iowrapper can be found in linux/fb.h.
213 +The fields in this struct have the following meaning:
214 +
215 +vc:
216 +Virtual console number.
217 +
218 +origin:
219 +Specifies if the ioctl is performed as a response to a kernel request. The
220 +splash helper should set this field to FB_SPLASH_IO_ORIG_KERNEL, userspace
221 +programs should set it to FB_SPLASH_IO_ORIG_USER. This field is necessary to
222 +avoid console semaphore deadlocks.
223 +
224 +data:
225 +Pointer to a data structure appropriate for the performed ioctl. Type of
226 +the data struct is specified in the ioctls description.
227 +
228 +*****************************************************************************
229 +
230 +Credit
231 +------
232 +
233 +Original 'bootsplash' project & implementation by:
234 + Volker Poplawski <volker@poplawski.de>, Stefan Reinauer <stepan@suse.de>,
235 + Steffen Winterfeldt <snwint@suse.de>, Michael Schroeder <mls@suse.de>,
236 + Ken Wimer <wimer@suse.de>.
237 +
238 +Fbsplash, splash protocol design, current implementation & docs by:
239 + Michal Januszewski <spock@gentoo.org>
240 +
241 --- a/drivers/Makefile
242 +++ b/drivers/Makefile
243 @@ -8,6 +8,9 @@
244 obj-$(CONFIG_PCI) += pci/
245 obj-$(CONFIG_PARISC) += parisc/
246 obj-$(CONFIG_RAPIDIO) += rapidio/
247 +# char/ comes before serial/ etc so that the VT console is the boot-time
248 +# default.
249 +obj-y += char/
250 obj-y += video/
251 obj-$(CONFIG_ACPI) += acpi/
252 # PnP must come after ACPI since it will eventually need to check if acpi
253 @@ -15,10 +18,6 @@ obj-$(CONFIG_ACPI) += acpi/
254 obj-$(CONFIG_PNP) += pnp/
255 obj-$(CONFIG_ARM_AMBA) += amba/
256
257 -# char/ comes before serial/ etc so that the VT console is the boot-time
258 -# default.
259 -obj-y += char/
260 -
261 obj-$(CONFIG_CONNECTOR) += connector/
262
263 # i810fb and intelfb depend on char/agp/
264 --- a/drivers/video/Kconfig
265 +++ b/drivers/video/Kconfig
266 @@ -1854,5 +1854,15 @@ if FB || SGI_NEWPORT_CONSOLE
267 source "drivers/video/logo/Kconfig"
268 endif
269
270 -endmenu
271 +config FB_SPLASH
272 + bool "Support for the framebuffer splash"
273 + depends on FRAMEBUFFER_CONSOLE=y && !FB_TILEBLITTING
274 + default n
275 + ---help---
276 + This option enables support for the Linux boot-up splash screen and
277 + graphical backgrounds on consoles. Note that you will need userspace
278 + splash utilities in order to take advantage of these features. Refer
279 + to Documentation/fb/splash.txt for more information.
280
281 + If unsure, say N.
282 +endmenu
283 --- a/drivers/video/Makefile
284 +++ b/drivers/video/Makefile
285 @@ -14,6 +14,7 @@ fb-objs := $(f
286 obj-$(CONFIG_VT) += console/
287 obj-$(CONFIG_LOGO) += logo/
288 obj-y += backlight/ display/
289 +obj-$(CONFIG_FB_SPLASH) += fbsplash.o cfbsplash.o
290
291 obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o
292 obj-$(CONFIG_FB_CFB_COPYAREA) += cfbcopyarea.o
293 --- /dev/null
294 +++ b/drivers/video/cfbsplash.c
295 @@ -0,0 +1,471 @@
296 +/*
297 + * linux/drivers/video/cfbsplash.c -- Framebuffer splash render functions
298 + *
299 + * Copyright (C) 2004 Michal Januszewski <spock@gentoo.org>
300 + *
301 + * Code based upon "Bootsplash" (C) 2001-2003
302 + * Volker Poplawski <volker@poplawski.de>,
303 + * Stefan Reinauer <stepan@suse.de>,
304 + * Steffen Winterfeldt <snwint@suse.de>,
305 + * Michael Schroeder <mls@suse.de>,
306 + * Ken Wimer <wimer@suse.de>.
307 + *
308 + * This file is subject to the terms and conditions of the GNU General Public
309 + * License. See the file COPYING in the main directory of this archive for
310 + * more details.
311 + */
312 +#include <linux/module.h>
313 +#include <linux/types.h>
314 +#include <linux/fb.h>
315 +#include <linux/selection.h>
316 +#include <linux/vt_kern.h>
317 +#include <asm/irq.h>
318 +#include <asm/system.h>
319 +
320 +#include "console/fbcon.h"
321 +#include "fbsplash.h"
322 +
323 +#define parse_pixel(shift,bpp,type) \
324 + do { \
325 + if (d & (0x80 >> (shift))) \
326 + dd2[(shift)] = fgx; \
327 + else \
328 + dd2[(shift)] = transparent ? *(type *)splash_src : bgx; \
329 + splash_src += (bpp); \
330 + } while (0) \
331 +
332 +extern int get_color(struct vc_data *vc, struct fb_info *info,
333 + u16 c, int is_fg);
334 +
335 +void fbsplash_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc)
336 +{
337 + int i, j, k;
338 + int minlen = min(min(info->var.red.length, info->var.green.length),
339 + info->var.blue.length);
340 + u32 col;
341 +
342 + for (j = i = 0; i < 16; i++) {
343 + k = color_table[i];
344 +
345 + col = ((vc->vc_palette[j++] >> (8-minlen))
346 + << info->var.red.offset);
347 + col |= ((vc->vc_palette[j++] >> (8-minlen))
348 + << info->var.green.offset);
349 + col |= ((vc->vc_palette[j++] >> (8-minlen))
350 + << info->var.blue.offset);
351 + ((u32 *)info->pseudo_palette)[k] = col;
352 + }
353 +}
354 +
355 +void fbsplash_renderc(struct fb_info *info, int ypos, int xpos, int height,
356 + int width, u8* src, u32 fgx, u32 bgx, u8 transparent)
357 +{
358 + unsigned int x, y;
359 + u32 dd;
360 + int bytespp = ((info->var.bits_per_pixel + 7) >> 3);
361 + unsigned int d = ypos * info->fix.line_length + xpos * bytespp;
362 + unsigned int ds = (ypos * info->var.xres + xpos) * bytespp;
363 + u16 dd2[4];
364 +
365 + u8* splash_src = (u8 *)(info->splash.data + ds);
366 + u8* dst = (u8 *)(info->screen_base + d);
367 +
368 + if ((ypos + height) > info->var.yres || (xpos + width) > info->var.xres)
369 + return;
370 +
371 + for (y = 0; y < height; y++) {
372 + switch (info->var.bits_per_pixel) {
373 +
374 + case 32:
375 + for (x = 0; x < width; x++) {
376 +
377 + if ((x & 7) == 0)
378 + d = *src++;
379 + if (d & 0x80)
380 + dd = fgx;
381 + else
382 + dd = transparent ?
383 + *(u32 *)splash_src : bgx;
384 +
385 + d <<= 1;
386 + splash_src += 4;
387 + fb_writel(dd, dst);
388 + dst += 4;
389 + }
390 + break;
391 + case 24:
392 + for (x = 0; x < width; x++) {
393 +
394 + if ((x & 7) == 0)
395 + d = *src++;
396 + if (d & 0x80)
397 + dd = fgx;
398 + else
399 + dd = transparent ?
400 + (*(u32 *)splash_src & 0xffffff) : bgx;
401 +
402 + d <<= 1;
403 + splash_src += 3;
404 +#ifdef __LITTLE_ENDIAN
405 + fb_writew(dd & 0xffff, dst);
406 + dst += 2;
407 + fb_writeb((dd >> 16), dst);
408 +#else
409 + fb_writew(dd >> 8, dst);
410 + dst += 2;
411 + fb_writeb(dd & 0xff, dst);
412 +#endif
413 + dst++;
414 + }
415 + break;
416 + case 16:
417 + for (x = 0; x < width; x += 2) {
418 + if ((x & 7) == 0)
419 + d = *src++;
420 +
421 + parse_pixel(0, 2, u16);
422 + parse_pixel(1, 2, u16);
423 +#ifdef __LITTLE_ENDIAN
424 + dd = dd2[0] | (dd2[1] << 16);
425 +#else
426 + dd = dd2[1] | (dd2[0] << 16);
427 +#endif
428 + d <<= 2;
429 + fb_writel(dd, dst);
430 + dst += 4;
431 + }
432 + break;
433 +
434 + case 8:
435 + for (x = 0; x < width; x += 4) {
436 + if ((x & 7) == 0)
437 + d = *src++;
438 +
439 + parse_pixel(0, 1, u8);
440 + parse_pixel(1, 1, u8);
441 + parse_pixel(2, 1, u8);
442 + parse_pixel(3, 1, u8);
443 +
444 +#ifdef __LITTLE_ENDIAN
445 + dd = dd2[0] | (dd2[1] << 8) | (dd2[2] << 16) | (dd2[3] << 24);
446 +#else
447 + dd = dd2[3] | (dd2[2] << 8) | (dd2[1] << 16) | (dd2[0] << 24);
448 +#endif
449 + d <<= 4;
450 + fb_writel(dd, dst);
451 + dst += 4;
452 + }
453 + }
454 +
455 + dst += info->fix.line_length - width * bytespp;
456 + splash_src += (info->var.xres - width) * bytespp;
457 + }
458 +}
459 +
460 +#define cc2cx(a) \
461 + ((info->fix.visual == FB_VISUAL_TRUECOLOR || \
462 + info->fix.visual == FB_VISUAL_DIRECTCOLOR) ? \
463 + ((u32*)info->pseudo_palette)[a] : a)
464 +
465 +void fbsplash_putcs(struct vc_data *vc, struct fb_info *info,
466 + const unsigned short *s, int count, int yy, int xx)
467 +{
468 + unsigned short charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff;
469 + struct fbcon_ops *ops = info->fbcon_par;
470 + int fg_color, bg_color, transparent;
471 + u8 *src;
472 + u32 bgx, fgx;
473 + u16 c = scr_readw(s);
474 +
475 + fg_color = get_color(vc, info, c, 1);
476 + bg_color = get_color(vc, info, c, 0);
477 +
478 + /* Don't paint the background image if console is blanked */
479 + transparent = ops->blank_state ? 0 :
480 + (vc->vc_splash.bg_color == bg_color);
481 +
482 + xx = xx * vc->vc_font.width + vc->vc_splash.tx;
483 + yy = yy * vc->vc_font.height + vc->vc_splash.ty;
484 +
485 + fgx = cc2cx(fg_color);
486 + bgx = cc2cx(bg_color);
487 +
488 + while (count--) {
489 + c = scr_readw(s++);
490 + src = vc->vc_font.data + (c & charmask) * vc->vc_font.height *
491 + ((vc->vc_font.width + 7) >> 3);
492 +
493 + fbsplash_renderc(info, yy, xx, vc->vc_font.height,
494 + vc->vc_font.width, src, fgx, bgx, transparent);
495 + xx += vc->vc_font.width;
496 + }
497 +}
498 +
499 +void fbsplash_cursor(struct fb_info *info, struct fb_cursor *cursor)
500 +{
501 + int i;
502 + unsigned int dsize, s_pitch;
503 + struct fbcon_ops *ops = info->fbcon_par;
504 + struct vc_data* vc;
505 + u8 *src;
506 +
507 + /* we really don't need any cursors while the console is blanked */
508 + if (info->state != FBINFO_STATE_RUNNING || ops->blank_state)
509 + return;
510 +
511 + vc = vc_cons[ops->currcon].d;
512 +
513 + src = kmalloc(64 + sizeof(struct fb_image), GFP_ATOMIC);
514 + if (!src)
515 + return;
516 +
517 + s_pitch = (cursor->image.width + 7) >> 3;
518 + dsize = s_pitch * cursor->image.height;
519 + if (cursor->enable) {
520 + switch (cursor->rop) {
521 + case ROP_XOR:
522 + for (i = 0; i < dsize; i++)
523 + src[i] = cursor->image.data[i] ^ cursor->mask[i];
524 + break;
525 + case ROP_COPY:
526 + default:
527 + for (i = 0; i < dsize; i++)
528 + src[i] = cursor->image.data[i] & cursor->mask[i];
529 + break;
530 + }
531 + } else
532 + memcpy(src, cursor->image.data, dsize);
533 +
534 + fbsplash_renderc(info,
535 + cursor->image.dy + vc->vc_splash.ty,
536 + cursor->image.dx + vc->vc_splash.tx,
537 + cursor->image.height,
538 + cursor->image.width,
539 + (u8*)src,
540 + cc2cx(cursor->image.fg_color),
541 + cc2cx(cursor->image.bg_color),
542 + cursor->image.bg_color == vc->vc_splash.bg_color);
543 +
544 + kfree(src);
545 +}
546 +
547 +static void splashset(u8 *dst, int height, int width, int dstbytes,
548 + u32 bgx, int bpp)
549 +{
550 + int i;
551 +
552 + if (bpp == 8)
553 + bgx |= bgx << 8;
554 + if (bpp == 16 || bpp == 8)
555 + bgx |= bgx << 16;
556 +
557 + while (height-- > 0) {
558 + u8 *p = dst;
559 +
560 + switch (bpp) {
561 +
562 + case 32:
563 + for (i=0; i < width; i++) {
564 + fb_writel(bgx, p); p += 4;
565 + }
566 + break;
567 + case 24:
568 + for (i=0; i < width; i++) {
569 +#ifdef __LITTLE_ENDIAN
570 + fb_writew((bgx & 0xffff),(u16*)p); p += 2;
571 + fb_writeb((bgx >> 16),p++);
572 +#else
573 + fb_writew((bgx >> 8),(u16*)p); p += 2;
574 + fb_writeb((bgx & 0xff),p++);
575 +#endif
576 + }
577 + case 16:
578 + for (i=0; i < width/4; i++) {
579 + fb_writel(bgx,p); p += 4;
580 + fb_writel(bgx,p); p += 4;
581 + }
582 + if (width & 2) {
583 + fb_writel(bgx,p); p += 4;
584 + }
585 + if (width & 1)
586 + fb_writew(bgx,(u16*)p);
587 + break;
588 + case 8:
589 + for (i=0; i < width/4; i++) {
590 + fb_writel(bgx,p); p += 4;
591 + }
592 +
593 + if (width & 2) {
594 + fb_writew(bgx,p); p += 2;
595 + }
596 + if (width & 1)
597 + fb_writeb(bgx,(u8*)p);
598 + break;
599 +
600 + }
601 + dst += dstbytes;
602 + }
603 +}
604 +
605 +void fbsplash_copy(u8 *dst, u8 *src, int height, int width, int linebytes,
606 + int srclinebytes, int bpp)
607 +{
608 + int i;
609 +
610 + while (height-- > 0) {
611 + u32 *p = (u32 *)dst;
612 + u32 *q = (u32 *)src;
613 +
614 + switch (bpp) {
615 +
616 + case 32:
617 + for (i=0; i < width; i++)
618 + fb_writel(*q++, p++);
619 + break;
620 + case 24:
621 + for (i=0; i < (width*3/4); i++)
622 + fb_writel(*q++, p++);
623 + if ((width*3) % 4) {
624 + if (width & 2) {
625 + fb_writeb(*(u8*)q, (u8*)p);
626 + } else if (width & 1) {
627 + fb_writew(*(u16*)q, (u16*)p);
628 + fb_writeb(*(u8*)((u16*)q+1),(u8*)((u16*)p+2));
629 + }
630 + }
631 + break;
632 + case 16:
633 + for (i=0; i < width/4; i++) {
634 + fb_writel(*q++, p++);
635 + fb_writel(*q++, p++);
636 + }
637 + if (width & 2)
638 + fb_writel(*q++, p++);
639 + if (width & 1)
640 + fb_writew(*(u16*)q, (u16*)p);
641 + break;
642 + case 8:
643 + for (i=0; i < width/4; i++)
644 + fb_writel(*q++, p++);
645 +
646 + if (width & 2) {
647 + fb_writew(*(u16*)q, (u16*)p);
648 + q = (u32*) ((u16*)q + 1);
649 + p = (u32*) ((u16*)p + 1);
650 + }
651 + if (width & 1)
652 + fb_writeb(*(u8*)q, (u8*)p);
653 + break;
654 + }
655 +
656 + dst += linebytes;
657 + src += srclinebytes;
658 + }
659 +}
660 +
661 +static void splashfill(struct fb_info *info, int sy, int sx, int height,
662 + int width)
663 +{
664 + int bytespp = ((info->var.bits_per_pixel + 7) >> 3);
665 + int d = sy * info->fix.line_length + sx * bytespp;
666 + int ds = (sy * info->var.xres + sx) * bytespp;
667 +
668 + fbsplash_copy((u8 *)(info->screen_base + d), (u8 *)(info->splash.data + ds),
669 + height, width, info->fix.line_length, info->var.xres * bytespp,
670 + info->var.bits_per_pixel);
671 +}
672 +
673 +void fbsplash_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx,
674 + int height, int width)
675 +{
676 + int bgshift = (vc->vc_hi_font_mask) ? 13 : 12;
677 + int bg_color = attr_bgcol_ec(bgshift, vc);
678 + int transparent = vc->vc_splash.bg_color == bg_color;
679 + struct fbcon_ops *ops = info->fbcon_par;
680 + u8 *dst;
681 +
682 + sy = sy * vc->vc_font.height + vc->vc_splash.ty;
683 + sx = sx * vc->vc_font.width + vc->vc_splash.tx;
684 + height *= vc->vc_font.height;
685 + width *= vc->vc_font.width;
686 +
687 + /* Don't paint the background image if console is blanked */
688 + if (transparent && !ops->blank_state) {
689 + splashfill(info, sy, sx, height, width);
690 + } else {
691 + dst = (u8 *)(info->screen_base + sy * info->fix.line_length +
692 + sx * ((info->var.bits_per_pixel + 7) >> 3));
693 + splashset(dst, height, width, info->fix.line_length, cc2cx(bg_color),
694 + info->var.bits_per_pixel);
695 + }
696 +}
697 +
698 +void fbsplash_clear_margins(struct vc_data *vc, struct fb_info *info,
699 + int bottom_only)
700 +{
701 + unsigned int tw = vc->vc_cols*vc->vc_font.width;
702 + unsigned int th = vc->vc_rows*vc->vc_font.height;
703 +
704 + if (!bottom_only) {
705 + /* top margin */
706 + splashfill(info, 0, 0, vc->vc_splash.ty, info->var.xres);
707 + /* left margin */
708 + splashfill(info, vc->vc_splash.ty, 0, th, vc->vc_splash.tx);
709 + /* right margin */
710 + splashfill(info, vc->vc_splash.ty, vc->vc_splash.tx + tw, th,
711 + info->var.xres - vc->vc_splash.tx - tw);
712 + }
713 + splashfill(info, vc->vc_splash.ty + th, 0,
714 + info->var.yres - vc->vc_splash.ty - th, info->var.xres);
715 +}
716 +
717 +void fbsplash_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y,
718 + int sx, int dx, int width)
719 +{
720 + u16 *d = (u16 *) (vc->vc_origin + vc->vc_size_row * y + dx * 2);
721 + u16 *s = d + (dx - sx);
722 + u16 *start = d;
723 + u16 *ls = d;
724 + u16 *le = d + width;
725 + u16 c;
726 + int x = dx;
727 + u16 attr = 1;
728 +
729 + do {
730 + c = scr_readw(d);
731 + if (attr != (c & 0xff00)) {
732 + attr = c & 0xff00;
733 + if (d > start) {
734 + fbsplash_putcs(vc, info, start, d - start, y, x);
735 + x += d - start;
736 + start = d;
737 + }
738 + }
739 + if (s >= ls && s < le && c == scr_readw(s)) {
740 + if (d > start) {
741 + fbsplash_putcs(vc, info, start, d - start, y, x);
742 + x += d - start + 1;
743 + start = d + 1;
744 + } else {
745 + x++;
746 + start++;
747 + }
748 + }
749 + s++;
750 + d++;
751 + } while (d < le);
752 + if (d > start)
753 + fbsplash_putcs(vc, info, start, d - start, y, x);
754 +}
755 +
756 +void fbsplash_blank(struct vc_data *vc, struct fb_info *info, int blank)
757 +{
758 + if (blank) {
759 + splashset((u8 *)info->screen_base, info->var.yres, info->var.xres,
760 + info->fix.line_length, 0, info->var.bits_per_pixel);
761 + } else {
762 + update_screen(vc);
763 + fbsplash_clear_margins(vc, info, 0);
764 + }
765 +}
766 +
767 --- a/drivers/video/console/bitblit.c
768 +++ b/drivers/video/console/bitblit.c
769 @@ -17,6 +17,7 @@
770 #include <linux/console.h>
771 #include <asm/types.h>
772 #include "fbcon.h"
773 +#include "../fbsplash.h"
774
775 /*
776 * Accelerated handlers.
777 @@ -54,6 +55,13 @@ static void bit_bmove(struct vc_data *vc
778 area.height = height * vc->vc_font.height;
779 area.width = width * vc->vc_font.width;
780
781 + if (fbsplash_active(info, vc)) {
782 + area.sx += vc->vc_splash.tx;
783 + area.sy += vc->vc_splash.ty;
784 + area.dx += vc->vc_splash.tx;
785 + area.dy += vc->vc_splash.ty;
786 + }
787 +
788 info->fbops->fb_copyarea(info, &area);
789 }
790
791 @@ -379,11 +387,15 @@ static void bit_cursor(struct vc_data *v
792 cursor.image.depth = 1;
793 cursor.rop = ROP_XOR;
794
795 - if (info->fbops->fb_cursor)
796 - err = info->fbops->fb_cursor(info, &cursor);
797 + if (fbsplash_active(info, vc)) {
798 + fbsplash_cursor(info, &cursor);
799 + } else {
800 + if (info->fbops->fb_cursor)
801 + err = info->fbops->fb_cursor(info, &cursor);
802
803 - if (err)
804 - soft_cursor(info, &cursor);
805 + if (err)
806 + soft_cursor(info, &cursor);
807 + }
808
809 ops->cursor_reset = 0;
810 }
811 --- a/drivers/video/console/fbcon.c
812 +++ b/drivers/video/console/fbcon.c
813 @@ -90,6 +90,7 @@
814 #endif
815
816 #include "fbcon.h"
817 +#include "../fbsplash.h"
818
819 #ifdef FBCONDEBUG
820 # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
821 @@ -105,7 +106,7 @@ enum {
822
823 static struct display fb_display[MAX_NR_CONSOLES];
824
825 -static signed char con2fb_map[MAX_NR_CONSOLES];
826 +signed char con2fb_map[MAX_NR_CONSOLES];
827 static signed char con2fb_map_boot[MAX_NR_CONSOLES];
828 #ifndef MODULE
829 static int logo_height;
830 @@ -302,7 +303,7 @@ static inline int fbcon_is_inactive(stru
831 vc->vc_mode != KD_TEXT || ops->graphics);
832 }
833
834 -static inline int get_color(struct vc_data *vc, struct fb_info *info,
835 +inline int get_color(struct vc_data *vc, struct fb_info *info,
836 u16 c, int is_fg)
837 {
838 int depth = fb_get_color_depth(&info->var, &info->fix);
839 @@ -410,6 +411,7 @@ static void fb_flashcursor(struct work_s
840 CM_ERASE : CM_DRAW;
841 ops->cursor(vc, info, mode, softback_lines, get_color(vc, info, c, 1),
842 get_color(vc, info, c, 0));
843 +
844 release_console_sem();
845 }
846
847 @@ -575,6 +577,8 @@ static int fbcon_takeover(int show_logo)
848 info_idx = -1;
849 }
850
851 + fbsplash_init();
852 +
853 return err;
854 }
855
856 @@ -1018,6 +1022,12 @@ static const char *fbcon_startup(void)
857 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
858 cols /= vc->vc_font.width;
859 rows /= vc->vc_font.height;
860 +
861 + if (fbsplash_active(info, vc)) {
862 + cols = vc->vc_splash.twidth / vc->vc_font.width;
863 + rows = vc->vc_splash.theight / vc->vc_font.height;
864 + }
865 +
866 vc_resize(vc, cols, rows);
867
868 DPRINTK("mode: %s\n", info->fix.id);
869 @@ -1101,7 +1111,7 @@ static void fbcon_init(struct vc_data *v
870 cap = info->flags;
871
872 if (vc != svc || logo_shown == FBCON_LOGO_DONTSHOW ||
873 - (info->fix.type == FB_TYPE_TEXT))
874 + (info->fix.type == FB_TYPE_TEXT) || fbsplash_active(info, vc))
875 logo = 0;
876
877 if (var_to_display(p, &info->var, info))
878 @@ -1297,6 +1307,11 @@ static void fbcon_clear(struct vc_data *
879 if (!height || !width)
880 return;
881
882 + if (fbsplash_active(info, vc)) {
883 + fbsplash_clear(vc, info, sy, sx, height, width);
884 + return;
885 + }
886 +
887 /* Split blits that cross physical y_wrap boundary */
888
889 y_break = p->vrows - p->yscroll;
890 @@ -1316,10 +1331,15 @@ static void fbcon_putcs(struct vc_data *
891 struct display *p = &fb_display[vc->vc_num];
892 struct fbcon_ops *ops = info->fbcon_par;
893
894 - if (!fbcon_is_inactive(vc, info))
895 - ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
896 - get_color(vc, info, scr_readw(s), 1),
897 - get_color(vc, info, scr_readw(s), 0));
898 + if (!fbcon_is_inactive(vc, info)) {
899 +
900 + if (fbsplash_active(info, vc))
901 + fbsplash_putcs(vc, info, s, count, ypos, xpos);
902 + else
903 + ops->putcs(vc, info, s, count, real_y(p, ypos), xpos,
904 + get_color(vc, info, scr_readw(s), 1),
905 + get_color(vc, info, scr_readw(s), 0));
906 + }
907 }
908
909 static void fbcon_putc(struct vc_data *vc, int c, int ypos, int xpos)
910 @@ -1335,8 +1355,13 @@ static void fbcon_clear_margins(struct v
911 struct fb_info *info = registered_fb[con2fb_map[vc->vc_num]];
912 struct fbcon_ops *ops = info->fbcon_par;
913
914 - if (!fbcon_is_inactive(vc, info))
915 - ops->clear_margins(vc, info, bottom_only);
916 + if (!fbcon_is_inactive(vc, info)) {
917 + if (fbsplash_active(info, vc)) {
918 + fbsplash_clear_margins(vc, info, bottom_only);
919 + } else {
920 + ops->clear_margins(vc, info, bottom_only);
921 + }
922 + }
923 }
924
925 static void fbcon_cursor(struct vc_data *vc, int mode)
926 @@ -1809,7 +1834,7 @@ static int fbcon_scroll(struct vc_data *
927 count = vc->vc_rows;
928 if (softback_top)
929 fbcon_softback_note(vc, t, count);
930 - if (logo_shown >= 0)
931 + if (logo_shown >= 0 || fbsplash_active(info, vc))
932 goto redraw_up;
933 switch (p->scrollmode) {
934 case SCROLL_MOVE:
935 @@ -1897,6 +1922,8 @@ static int fbcon_scroll(struct vc_data *
936 count = vc->vc_rows;
937 if (logo_shown >= 0)
938 goto redraw_down;
939 + if (fbsplash_active(info, vc))
940 + goto redraw_down;
941 switch (p->scrollmode) {
942 case SCROLL_MOVE:
943 ops->bmove(vc, info, t, 0, t + count, 0,
944 @@ -2039,6 +2066,13 @@ static void fbcon_bmove_rec(struct vc_da
945 }
946 return;
947 }
948 +
949 + if (fbsplash_active(info, vc) && sy == dy && height == 1) {
950 + /* must use slower redraw bmove to keep background pic intact */
951 + fbsplash_bmove_redraw(vc, info, sy, sx, dx, width);
952 + return;
953 + }
954 +
955 ops->bmove(vc, info, real_y(p, sy), sx, real_y(p, dy), dx,
956 height, width);
957 }
958 @@ -2109,8 +2143,9 @@ static int fbcon_resize(struct vc_data *
959 var.yres = virt_h * virt_fh;
960 x_diff = info->var.xres - var.xres;
961 y_diff = info->var.yres - var.yres;
962 - if (x_diff < 0 || x_diff > virt_fw ||
963 - y_diff < 0 || y_diff > virt_fh) {
964 +
965 + if ((x_diff < 0 || x_diff > virt_fw ||
966 + y_diff < 0 || y_diff > virt_fh) && !vc->vc_splash.state) {
967 const struct fb_videomode *mode;
968
969 DPRINTK("attempting resize %ix%i\n", var.xres, var.yres);
970 @@ -2146,6 +2181,25 @@ static int fbcon_switch(struct vc_data *
971
972 info = registered_fb[con2fb_map[vc->vc_num]];
973 ops = info->fbcon_par;
974 + prev_console = ops->currcon;
975 + if (prev_console != -1)
976 + old_info = registered_fb[con2fb_map[prev_console]];
977 +
978 + if (fbsplash_active_vc(vc)) {
979 + struct vc_data *vc_curr = vc_cons[prev_console].d;
980 + if (!vc_curr->vc_splash.theme || strcmp(vc->vc_splash.theme, vc_curr->vc_splash.theme)) {
981 + if (fbsplash_call_helper("getpic", vc->vc_num))
982 + fbsplash_disable(vc, 0);
983 + }
984 + } else if (info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
985 + struct vc_data *vc_curr = vc_cons[prev_console].d;
986 + if (vc_curr && fbsplash_active_vc(vc_curr)) {
987 + /* Clear the screen to avoid displaying funky colors during
988 + * palette updates. */
989 + memset((u8*)info->screen_base + info->fix.line_length * info->var.yoffset,
990 + 0, info->var.yres * info->fix.line_length);
991 + }
992 + }
993
994 if (softback_top) {
995 if (softback_lines)
996 @@ -2164,9 +2218,6 @@ static int fbcon_switch(struct vc_data *
997 logo_shown = FBCON_LOGO_CANSHOW;
998 }
999
1000 - prev_console = ops->currcon;
1001 - if (prev_console != -1)
1002 - old_info = registered_fb[con2fb_map[prev_console]];
1003 /*
1004 * FIXME: If we have multiple fbdev's loaded, we need to
1005 * update all info->currcon. Perhaps, we can place this
1006 @@ -2205,6 +2256,11 @@ static int fbcon_switch(struct vc_data *
1007 if (old_info != info)
1008 fbcon_del_cursor_timer(old_info);
1009 }
1010 +
1011 + if (fbsplash_active_nores(info, vc) && !fbsplash_active(info, vc)) {
1012 + if (fbsplash_call_helper("modechange", vc->vc_num))
1013 + fbsplash_disable(vc, 0);
1014 + }
1015
1016 if (fbcon_is_inactive(vc, info) ||
1017 ops->blank_state != FB_BLANK_UNBLANK)
1018 @@ -2320,8 +2376,12 @@ static int fbcon_blank(struct vc_data *v
1019 fbcon_cursor(vc, blank ? CM_ERASE : CM_DRAW);
1020 ops->cursor_flash = (!blank);
1021
1022 - if (fb_blank(info, blank))
1023 - fbcon_generic_blank(vc, info, blank);
1024 + if (fb_blank(info, blank)) {
1025 + if (fbsplash_active(info, vc))
1026 + fbsplash_blank(vc, info, blank);
1027 + else
1028 + fbcon_generic_blank(vc, info, blank);
1029 + }
1030 }
1031
1032 if (!blank)
1033 @@ -2472,13 +2532,22 @@ static int fbcon_do_set_font(struct vc_d
1034 }
1035
1036 if (resize) {
1037 + /* reset wrap/pan */
1038 int cols, rows;
1039
1040 cols = FBCON_SWAP(ops->rotate, info->var.xres, info->var.yres);
1041 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
1042 +
1043 + info->var.xoffset = info->var.yoffset = p->yscroll = 0;
1044 + if (fbsplash_active(info, vc)) {
1045 + cols = vc->vc_splash.twidth;
1046 + rows = vc->vc_splash.theight;
1047 + }
1048 cols /= w;
1049 rows /= h;
1050 +
1051 vc_resize(vc, cols, rows);
1052 +
1053 if (CON_IS_VISIBLE(vc) && softback_buf)
1054 fbcon_update_softback(vc);
1055 } else if (CON_IS_VISIBLE(vc)
1056 @@ -2607,7 +2676,7 @@ static int fbcon_set_palette(struct vc_d
1057 int i, j, k, depth;
1058 u8 val;
1059
1060 - if (fbcon_is_inactive(vc, info))
1061 + if (fbcon_is_inactive(vc, info) || vc->vc_num != fg_console)
1062 return -EINVAL;
1063
1064 if (!CON_IS_VISIBLE(vc))
1065 @@ -2633,7 +2702,49 @@ static int fbcon_set_palette(struct vc_d
1066 } else
1067 fb_copy_cmap(fb_default_cmap(1 << depth), &palette_cmap);
1068
1069 - return fb_set_cmap(&palette_cmap, info);
1070 + if (fbsplash_active(info, vc_cons[fg_console].d) &&
1071 + info->fix.visual == FB_VISUAL_DIRECTCOLOR) {
1072 +
1073 + u16 *red, *green, *blue;
1074 + int minlen = min(min(info->var.red.length, info->var.green.length),
1075 + info->var.blue.length);
1076 + int h;
1077 +
1078 + struct fb_cmap cmap = {
1079 + .start = 0,
1080 + .len = (1 << minlen),
1081 + .red = NULL,
1082 + .green = NULL,
1083 + .blue = NULL,
1084 + .transp = NULL
1085 + };
1086 +
1087 + red = kmalloc(256 * sizeof(u16) * 3, GFP_KERNEL);
1088 +
1089 + if (!red)
1090 + goto out;
1091 +
1092 + green = red + 256;
1093 + blue = green + 256;
1094 + cmap.red = red;
1095 + cmap.green = green;
1096 + cmap.blue = blue;
1097 +
1098 + for (i = 0; i < cmap.len; i++) {
1099 + red[i] = green[i] = blue[i] = (0xffff * i)/(cmap.len-1);
1100 + }
1101 +
1102 + h = fb_set_cmap(&cmap, info);
1103 + fbsplash_fix_pseudo_pal(info, vc_cons[fg_console].d);
1104 + kfree(red);
1105 +
1106 + return h;
1107 +
1108 + } else if (fbsplash_active(info, vc_cons[fg_console].d) &&
1109 + info->var.bits_per_pixel == 8 && info->splash.cmap.red != NULL)
1110 + fb_set_cmap(&info->splash.cmap, info);
1111 +
1112 +out: return fb_set_cmap(&palette_cmap, info);
1113 }
1114
1115 static u16 *fbcon_screen_pos(struct vc_data *vc, int offset)
1116 @@ -2859,7 +2970,14 @@ static void fbcon_modechanged(struct fb_
1117 rows = FBCON_SWAP(ops->rotate, info->var.yres, info->var.xres);
1118 cols /= vc->vc_font.width;
1119 rows /= vc->vc_font.height;
1120 - vc_resize(vc, cols, rows);
1121 +
1122 + if (!fbsplash_active_nores(info, vc)) {
1123 + vc_resize(vc, cols, rows);
1124 + } else {
1125 + if (fbsplash_call_helper("modechange", vc->vc_num))
1126 + fbsplash_disable(vc, 0);
1127 + }
1128 +
1129 updatescrollmode(p, info, vc);
1130 scrollback_max = 0;
1131 scrollback_current = 0;
1132 @@ -3347,6 +3465,7 @@ static void fbcon_exit(void)
1133 }
1134 }
1135
1136 + fbsplash_exit();
1137 fbcon_has_exited = 1;
1138 }
1139
1140 --- a/drivers/video/fbcmap.c
1141 +++ b/drivers/video/fbcmap.c
1142 @@ -15,6 +15,7 @@
1143 #include <linux/module.h>
1144 #include <linux/fb.h>
1145 #include <linux/slab.h>
1146 +#include "fbsplash.h"
1147
1148 #include <asm/uaccess.h>
1149
1150 @@ -235,14 +236,17 @@ int fb_set_cmap(struct fb_cmap *cmap, st
1151 if (transp)
1152 htransp = *transp++;
1153 if (info->fbops->fb_setcolreg(start++,
1154 - hred, hgreen, hblue,
1155 + hred, hgreen, hblue,
1156 htransp, info))
1157 break;
1158 }
1159 }
1160 - if (rc == 0)
1161 + if (rc == 0) {
1162 fb_copy_cmap(cmap, &info->cmap);
1163 -
1164 + if (fbsplash_active(info, vc_cons[fg_console].d) &&
1165 + info->fix.visual == FB_VISUAL_DIRECTCOLOR)
1166 + fbsplash_fix_pseudo_pal(info, vc_cons[fg_console].d);
1167 + }
1168 return rc;
1169 }
1170
1171 @@ -250,7 +254,7 @@ int fb_set_user_cmap(struct fb_cmap_user
1172 {
1173 int rc, size = cmap->len * sizeof(u16);
1174 struct fb_cmap umap;
1175 -
1176 +
1177 if (cmap->start < 0 || (!info->fbops->fb_setcolreg &&
1178 !info->fbops->fb_setcmap))
1179 return -EINVAL;
1180 --- /dev/null
1181 +++ b/drivers/video/fbsplash.c
1182 @@ -0,0 +1,424 @@
1183 +/*
1184 + * linux/drivers/video/fbsplash.c -- Framebuffer splash routines
1185 + *
1186 + * Copyright (C) 2004 Michal Januszewski <spock@gentoo.org>
1187 + *
1188 + * Code based upon "Bootsplash" (C) 2001-2003
1189 + * Volker Poplawski <volker@poplawski.de>,
1190 + * Stefan Reinauer <stepan@suse.de>,
1191 + * Steffen Winterfeldt <snwint@suse.de>,
1192 + * Michael Schroeder <mls@suse.de>,
1193 + * Ken Wimer <wimer@suse.de>.
1194 + *
1195 + * Splash render routines are located in /linux/drivers/video/cfbsplash.c
1196 + *
1197 + * This file is subject to the terms and conditions of the GNU General Public
1198 + * License. See the file COPYING in the main directory of this archive for
1199 + * more details.
1200 + *
1201 + */
1202 +#include <linux/module.h>
1203 +#include <linux/kernel.h>
1204 +#include <linux/string.h>
1205 +#include <linux/types.h>
1206 +#include <linux/fb.h>
1207 +#include <linux/vt_kern.h>
1208 +#include <linux/vmalloc.h>
1209 +#include <linux/unistd.h>
1210 +#include <linux/syscalls.h>
1211 +#include <linux/init.h>
1212 +#include <linux/proc_fs.h>
1213 +#include <linux/workqueue.h>
1214 +#include <linux/kmod.h>
1215 +#include <linux/miscdevice.h>
1216 +#include <linux/device.h>
1217 +#include <linux/fs.h>
1218 +
1219 +#include <asm/uaccess.h>
1220 +#include <asm/irq.h>
1221 +#include <asm/system.h>
1222 +
1223 +#include "console/fbcon.h"
1224 +#include "fbsplash.h"
1225 +
1226 +#define SPLASH_VERSION "0.9.2"
1227 +
1228 +extern signed char con2fb_map[];
1229 +static int fbsplash_enable(struct vc_data *vc);
1230 +char fbsplash_path[KMOD_PATH_LEN] = "/sbin/splash_helper";
1231 +static int initialized = 0;
1232 +
1233 +int fbsplash_call_helper(char* cmd, unsigned short vc)
1234 +{
1235 + char *envp[] = {
1236 + "HOME=/",
1237 + "PATH=/sbin:/bin",
1238 + NULL
1239 + };
1240 +
1241 + char tfb[5];
1242 + char tcons[5];
1243 + unsigned char fb = (int) con2fb_map[vc];
1244 +
1245 + char *argv[] = {
1246 + fbsplash_path,
1247 + "2",
1248 + cmd,
1249 + tcons,
1250 + tfb,
1251 + vc_cons[vc].d->vc_splash.theme,
1252 + NULL
1253 + };
1254 +
1255 + snprintf(tfb,5,"%d",fb);
1256 + snprintf(tcons,5,"%d",vc);
1257 +
1258 + return call_usermodehelper(fbsplash_path, argv, envp, 1);
1259 +}
1260 +
1261 +/* Disables fbsplash on a virtual console; called with console sem held. */
1262 +int fbsplash_disable(struct vc_data *vc, unsigned char redraw)
1263 +{
1264 + struct fb_info* info;
1265 +
1266 + if (!vc->vc_splash.state)
1267 + return -EINVAL;
1268 +
1269 + info = registered_fb[(int) con2fb_map[vc->vc_num]];
1270 +
1271 + if (info == NULL)
1272 + return -EINVAL;
1273 +
1274 + vc->vc_splash.state = 0;
1275 + vc_resize(vc, info->var.xres / vc->vc_font.width,
1276 + info->var.yres / vc->vc_font.height);
1277 +
1278 + if (fg_console == vc->vc_num && redraw) {
1279 + redraw_screen(vc, 0);
1280 + update_region(vc, vc->vc_origin +
1281 + vc->vc_size_row * vc->vc_top,
1282 + vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
1283 + }
1284 +
1285 + printk(KERN_INFO "fbsplash: switched splash state to 'off' on console %d\n",
1286 + vc->vc_num);
1287 +
1288 + return 0;
1289 +}
1290 +
1291 +/* Enables fbsplash on a virtual console; called with console sem held. */
1292 +static int fbsplash_enable(struct vc_data *vc)
1293 +{
1294 + struct fb_info* info;
1295 +
1296 + info = registered_fb[(int) con2fb_map[vc->vc_num]];
1297 +
1298 + if (vc->vc_splash.twidth == 0 || vc->vc_splash.theight == 0 ||
1299 + info == NULL || vc->vc_splash.state || (!info->splash.data &&
1300 + vc->vc_num == fg_console))
1301 + return -EINVAL;
1302 +
1303 + vc->vc_splash.state = 1;
1304 + vc_resize(vc, vc->vc_splash.twidth / vc->vc_font.width,
1305 + vc->vc_splash.theight / vc->vc_font.height);
1306 +
1307 + if (fg_console == vc->vc_num) {
1308 + redraw_screen(vc, 0);
1309 + update_region(vc, vc->vc_origin +
1310 + vc->vc_size_row * vc->vc_top,
1311 + vc->vc_size_row * (vc->vc_bottom - vc->vc_top) / 2);
1312 + fbsplash_clear_margins(vc, info, 0);
1313 + }
1314 +
1315 + printk(KERN_INFO "fbsplash: switched splash state to 'on' on console %d\n",
1316 + vc->vc_num);
1317 +
1318 + return 0;
1319 +}
1320 +
1321 +static inline int fbsplash_ioctl_dosetstate(struct vc_data *vc, unsigned int __user* state, unsigned char origin)
1322 +{
1323 + int tmp, ret;
1324 +
1325 + if (get_user(tmp, state))
1326 + return -EFAULT;
1327 +
1328 + if (origin == FB_SPLASH_IO_ORIG_USER)
1329 + acquire_console_sem();
1330 + if (!tmp)
1331 + ret = fbsplash_disable(vc, 1);
1332 + else
1333 + ret = fbsplash_enable(vc);
1334 + if (origin == FB_SPLASH_IO_ORIG_USER)
1335 + release_console_sem();
1336 +
1337 + return ret;
1338 +}
1339 +
1340 +static inline int fbsplash_ioctl_dogetstate(struct vc_data *vc, unsigned int __user *state)
1341 +{
1342 + return put_user(vc->vc_splash.state, (unsigned int __user*) state);
1343 +}
1344 +
1345 +static int fbsplash_ioctl_dosetcfg(struct vc_data *vc, struct vc_splash __user *arg, unsigned char origin)
1346 +{
1347 + struct vc_splash cfg;
1348 + struct fb_info *info;
1349 + int len;
1350 + char *tmp;
1351 +
1352 + info = registered_fb[(int) con2fb_map[vc->vc_num]];
1353 +
1354 + if (copy_from_user(&cfg, arg, sizeof(struct vc_splash)))
1355 + return -EFAULT;
1356 + if (info == NULL || !cfg.twidth || !cfg.theight ||
1357 + cfg.tx + cfg.twidth > info->var.xres ||
1358 + cfg.ty + cfg.theight > info->var.yres)
1359 + return -EINVAL;
1360 +
1361 + len = strlen_user(cfg.theme);
1362 + if (!len || len > FB_SPLASH_THEME_LEN)
1363 + return -EINVAL;
1364 + tmp = kmalloc(len, GFP_KERNEL);
1365 + if (!tmp)
1366 + return -ENOMEM;
1367 + if (copy_from_user(tmp, (void __user *)cfg.theme, len))
1368 + return -EFAULT;
1369 + cfg.theme = tmp;
1370 + cfg.state = 0;
1371 +
1372 + /* If this ioctl is a response to a request from kernel, the console sem
1373 + * is already held; we also don't need to disable splash because either the
1374 + * new config and background picture will be successfully loaded, and the
1375 + * splash will stay on, or in case of a failure it'll be turned off in fbcon. */
1376 + if (origin == FB_SPLASH_IO_ORIG_USER) {
1377 + acquire_console_sem();
1378 + if (vc->vc_splash.state)
1379 + fbsplash_disable(vc, 1);
1380 + }
1381 +
1382 + if (vc->vc_splash.theme)
1383 + kfree(vc->vc_splash.theme);
1384 +
1385 + vc->vc_splash = cfg;
1386 +
1387 + if (origin == FB_SPLASH_IO_ORIG_USER)
1388 + release_console_sem();
1389 +
1390 + printk(KERN_INFO "fbsplash: console %d using theme '%s'\n",
1391 + vc->vc_num, vc->vc_splash.theme);
1392 + return 0;
1393 +}
1394 +
1395 +static int fbsplash_ioctl_dogetcfg(struct vc_data *vc, struct vc_splash __user *arg)
1396 +{
1397 + struct vc_splash splash;
1398 + char __user *tmp;
1399 +
1400 + if (get_user(tmp, &arg->theme))
1401 + return -EFAULT;
1402 +
1403 + splash = vc->vc_splash;
1404 + splash.theme = tmp;
1405 +
1406 + if (vc->vc_splash.theme) {
1407 + if (copy_to_user(tmp, vc->vc_splash.theme, strlen(vc->vc_splash.theme) + 1))
1408 + return -EFAULT;
1409 + } else
1410 + if (put_user(0, tmp))
1411 + return -EFAULT;
1412 +
1413 + if (copy_to_user(arg, &splash, sizeof(struct vc_splash)))
1414 + return -EFAULT;
1415 +
1416 + return 0;
1417 +}
1418 +
1419 +static int fbsplash_ioctl_dosetpic(struct vc_data *vc, struct fb_image __user *arg, unsigned char origin)
1420 +{
1421 + struct fb_image img;
1422 + struct fb_info *info;
1423 + int len;
1424 + u8 *tmp;
1425 +
1426 + if (vc->vc_num != fg_console)
1427 + return -EINVAL;
1428 +
1429 + info = registered_fb[(int) con2fb_map[vc->vc_num]];
1430 +
1431 + if (info == NULL)
1432 + return -EINVAL;
1433 +
1434 + if (copy_from_user(&img, arg, sizeof(struct fb_image)))
1435 + return -EFAULT;
1436 +
1437 + if (img.width != info->var.xres || img.height != info->var.yres) {
1438 + printk(KERN_ERR "fbsplash: picture dimensions mismatch\n");
1439 + return -EINVAL;
1440 + }
1441 +
1442 + if (img.depth != info->var.bits_per_pixel) {
1443 + printk(KERN_ERR "fbsplash: picture depth mismatch\n");
1444 + return -EINVAL;
1445 + }
1446 +
1447 + if (img.depth == 8) {
1448 + if (!img.cmap.len || !img.cmap.red || !img.cmap.green ||
1449 + !img.cmap.blue)
1450 + return -EINVAL;
1451 +
1452 + tmp = vmalloc(img.cmap.len * 3 * 2);
1453 + if (!tmp)
1454 + return -ENOMEM;
1455 +
1456 + if (copy_from_user(tmp, (void __user*)img.cmap.red, img.cmap.len * 2) ||
1457 + copy_from_user(tmp + (img.cmap.len << 1),
1458 + (void __user*)img.cmap.green, (img.cmap.len << 1)) ||
1459 + copy_from_user(tmp + (img.cmap.len << 2),
1460 + (void __user*)img.cmap.blue, (img.cmap.len << 1))) {
1461 + vfree(tmp);
1462 + return -EFAULT;
1463 + }
1464 +
1465 + img.cmap.transp = NULL;
1466 + img.cmap.red = (u16*)tmp;
1467 + img.cmap.green = img.cmap.red + img.cmap.len;
1468 + img.cmap.blue = img.cmap.green + img.cmap.len;
1469 + } else {
1470 + img.cmap.red = NULL;
1471 + }
1472 +
1473 + len = ((img.depth + 7) >> 3) * img.width * img.height;
1474 + tmp = vmalloc(len);
1475 +
1476 + if (!tmp)
1477 + goto out;
1478 +
1479 + if (copy_from_user(tmp, (void __user*)img.data, len))
1480 + goto out;
1481 +
1482 + img.data = tmp;
1483 +
1484 + /* If this ioctl is a response to a request from kernel, the console sem
1485 + * is already held. */
1486 + if (origin == FB_SPLASH_IO_ORIG_USER)
1487 + acquire_console_sem();
1488 +
1489 + if (info->splash.data)
1490 + vfree((u8*)info->splash.data);
1491 + if (info->splash.cmap.red)
1492 + vfree(info->splash.cmap.red);
1493 +
1494 + info->splash = img;
1495 +
1496 + if (origin == FB_SPLASH_IO_ORIG_USER)
1497 + release_console_sem();
1498 +
1499 + return 0;
1500 +
1501 +out: if (img.cmap.red)
1502 + vfree(img.cmap.red);
1503 + if (tmp)
1504 + vfree(tmp);
1505 + return -ENOMEM;
1506 +}
1507 +
1508 +static int splash_ioctl(struct inode * inode, struct file *filp, u_int cmd,
1509 + u_long arg)
1510 +{
1511 + struct fb_splash_iowrapper __user *wrapper = (void __user*) arg;
1512 + struct vc_data *vc = NULL;
1513 + unsigned short vc_num = 0;
1514 + unsigned char origin = 0;
1515 + void __user *data = NULL;
1516 +
1517 + if (!access_ok(VERIFY_READ, wrapper,
1518 + sizeof(struct fb_splash_iowrapper)))
1519 + return -EFAULT;
1520 +
1521 + __get_user(vc_num, &wrapper->vc);
1522 + __get_user(origin, &wrapper->origin);
1523 + __get_user(data, &wrapper->data);
1524 +
1525 + if (!vc_cons_allocated(vc_num))
1526 + return -EINVAL;
1527 +
1528 + vc = vc_cons[vc_num].d;
1529 +
1530 + switch (cmd) {
1531 + case FBIOSPLASH_SETPIC:
1532 + return fbsplash_ioctl_dosetpic(vc, (struct fb_image __user*)data, origin);
1533 + case FBIOSPLASH_SETCFG:
1534 + return fbsplash_ioctl_dosetcfg(vc, (struct vc_splash*)data, origin);
1535 + case FBIOSPLASH_GETCFG:
1536 + return fbsplash_ioctl_dogetcfg(vc, (struct vc_splash*)data);
1537 + case FBIOSPLASH_SETSTATE:
1538 + return fbsplash_ioctl_dosetstate(vc, (unsigned int *)data, origin);
1539 + case FBIOSPLASH_GETSTATE:
1540 + return fbsplash_ioctl_dogetstate(vc, (unsigned int *)data);
1541 + default:
1542 + return -ENOIOCTLCMD;
1543 + }
1544 +}
1545 +
1546 +static struct file_operations splash_ops = {
1547 + .owner = THIS_MODULE,
1548 + .ioctl = splash_ioctl
1549 +};
1550 +
1551 +static struct miscdevice splash_dev = {
1552 + .minor = MISC_DYNAMIC_MINOR,
1553 + .name = "fbsplash",
1554 + .fops = &splash_ops
1555 +};
1556 +
1557 +void fbsplash_reset(void)
1558 +{
1559 + struct fb_info *info;
1560 + struct vc_data *vc;
1561 + int i;
1562 +
1563 + vc = vc_cons[0].d;
1564 + info = registered_fb[0];
1565 +
1566 + for (i = 0; i < num_registered_fb; i++) {
1567 + registered_fb[i]->splash.data = NULL;
1568 + registered_fb[i]->splash.cmap.red = NULL;
1569 + }
1570 +
1571 + for (i = 0; i < MAX_NR_CONSOLES && vc_cons[i].d; i++) {
1572 + vc_cons[i].d->vc_splash.state = vc_cons[i].d->vc_splash.twidth =
1573 + vc_cons[i].d->vc_splash.theight = 0;
1574 + vc_cons[i].d->vc_splash.theme = NULL;
1575 + }
1576 +
1577 + return;
1578 +}
1579 +
1580 +int fbsplash_init(void)
1581 +{
1582 + int i;
1583 +
1584 + fbsplash_reset();
1585 +
1586 + if (initialized)
1587 + return 0;
1588 +
1589 + i = misc_register(&splash_dev);
1590 + if (i) {
1591 + printk(KERN_ERR "fbsplash: failed to register device\n");
1592 + return i;
1593 + }
1594 +
1595 + fbsplash_call_helper("init", 0);
1596 + initialized = 1;
1597 + return 0;
1598 +}
1599 +
1600 +int fbsplash_exit(void)
1601 +{
1602 + fbsplash_reset();
1603 + return 0;
1604 +}
1605 +
1606 +EXPORT_SYMBOL(fbsplash_path);
1607 --- /dev/null
1608 +++ b/drivers/video/fbsplash.h
1609 @@ -0,0 +1,78 @@
1610 +/*
1611 + * linux/drivers/video/fbsplash.h -- Framebuffer splash headers
1612 + *
1613 + * Copyright (C) 2004 Michal Januszewski <spock@gentoo.org>
1614 + *
1615 + */
1616 +
1617 +#ifndef __FB_SPLASH_H
1618 +#define __FB_SPLASH_H
1619 +
1620 +#ifndef _LINUX_FB_H
1621 +#include <linux/fb.h>
1622 +#endif
1623 +
1624 +/* This is needed for vc_cons in fbcmap.c */
1625 +#include <linux/vt_kern.h>
1626 +
1627 +struct fb_cursor;
1628 +struct fb_info;
1629 +struct vc_data;
1630 +
1631 +#ifdef CONFIG_FB_SPLASH
1632 +/* fbsplash.c */
1633 +int fbsplash_init(void);
1634 +int fbsplash_exit(void);
1635 +int fbsplash_call_helper(char* cmd, unsigned short cons);
1636 +int fbsplash_disable(struct vc_data *vc, unsigned char redraw);
1637 +
1638 +/* cfbsplash.c */
1639 +void fbsplash_putcs(struct vc_data *vc, struct fb_info *info, const unsigned short *s, int count, int yy, int xx);
1640 +void fbsplash_cursor(struct fb_info *info, struct fb_cursor *cursor);
1641 +void fbsplash_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width);
1642 +void fbsplash_clear_margins(struct vc_data *vc, struct fb_info *info, int bottom_only);
1643 +void fbsplash_blank(struct vc_data *vc, struct fb_info *info, int blank);
1644 +void fbsplash_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y, int sx, int dx, int width);
1645 +void fbsplash_copy(u8 *dst, u8 *src, int height, int width, int linebytes, int srclinesbytes, int bpp);
1646 +void fbsplash_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc);
1647 +
1648 +/* vt.c */
1649 +void acquire_console_sem(void);
1650 +void release_console_sem(void);
1651 +void do_unblank_screen(int entering_gfx);
1652 +
1653 +/* struct vc_data *y */
1654 +#define fbsplash_active_vc(y) (y->vc_splash.state && y->vc_splash.theme)
1655 +
1656 +/* struct fb_info *x, struct vc_data *y */
1657 +#define fbsplash_active_nores(x,y) (x->splash.data && fbsplash_active_vc(y))
1658 +
1659 +/* struct fb_info *x, struct vc_data *y */
1660 +#define fbsplash_active(x,y) (fbsplash_active_nores(x,y) && \
1661 + x->splash.width == x->var.xres && \
1662 + x->splash.height == x->var.yres && \
1663 + x->splash.depth == x->var.bits_per_pixel)
1664 +
1665 +
1666 +#else /* CONFIG_FB_SPLASH */
1667 +
1668 +static inline void fbsplash_putcs(struct vc_data *vc, struct fb_info *info, const unsigned short *s, int count, int yy, int xx) {}
1669 +static inline void fbsplash_putc(struct vc_data *vc, struct fb_info *info, int c, int ypos, int xpos) {}
1670 +static inline void fbsplash_cursor(struct fb_info *info, struct fb_cursor *cursor) {}
1671 +static inline void fbsplash_clear(struct vc_data *vc, struct fb_info *info, int sy, int sx, int height, int width) {}
1672 +static inline void fbsplash_clear_margins(struct vc_data *vc, struct fb_info *info, int bottom_only) {}
1673 +static inline void fbsplash_blank(struct vc_data *vc, struct fb_info *info, int blank) {}
1674 +static inline void fbsplash_bmove_redraw(struct vc_data *vc, struct fb_info *info, int y, int sx, int dx, int width) {}
1675 +static inline void fbsplash_fix_pseudo_pal(struct fb_info *info, struct vc_data *vc) {}
1676 +static inline int fbsplash_call_helper(char* cmd, unsigned short cons) { return 0; }
1677 +static inline int fbsplash_init(void) { return 0; }
1678 +static inline int fbsplash_exit(void) { return 0; }
1679 +static inline int fbsplash_disable(struct vc_data *vc, unsigned char redraw) { return 0; }
1680 +
1681 +#define fbsplash_active_vc(y) (0)
1682 +#define fbsplash_active_nores(x,y) (0)
1683 +#define fbsplash_active(x,y) (0)
1684 +
1685 +#endif /* CONFIG_FB_SPLASH */
1686 +
1687 +#endif /* __FB_SPLASH_H */
1688 --- /dev/null
1689 +++ b/include/linux/console_splash.h
1690 @@ -0,0 +1,13 @@
1691 +#ifndef _LINUX_CONSOLE_SPLASH_H_
1692 +#define _LINUX_CONSOLE_SPLASH_H_ 1
1693 +
1694 +/* A structure used by the framebuffer splash code (drivers/video/fbsplash.c) */
1695 +struct vc_splash {
1696 + __u8 bg_color; /* The color that is to be treated as transparent */
1697 + __u8 state; /* Current splash state: 0 = off, 1 = on */
1698 + __u16 tx, ty; /* Top left corner coordinates of the text field */
1699 + __u16 twidth, theight; /* Width and height of the text field */
1700 + char* theme;
1701 +};
1702 +
1703 +#endif
1704 --- a/include/linux/console_struct.h
1705 +++ b/include/linux/console_struct.h
1706 @@ -16,6 +16,7 @@
1707 struct vt_struct;
1708
1709 #define NPAR 16
1710 +#include <linux/console_splash.h>
1711
1712 struct vc_data {
1713 unsigned short vc_num; /* Console number */
1714 @@ -102,6 +103,8 @@ struct vc_data {
1715 struct vc_data **vc_display_fg; /* [!] Ptr to var holding fg console for this display */
1716 unsigned long vc_uni_pagedir;
1717 unsigned long *vc_uni_pagedir_loc; /* [!] Location of uni_pagedir variable for this console */
1718 +
1719 + struct vc_splash vc_splash;
1720 /* additional information is in vt_kern.h */
1721 };
1722
1723 --- a/include/linux/fb.h
1724 +++ b/include/linux/fb.h
1725 @@ -11,6 +11,13 @@ struct dentry;
1726 #define FB_MAJOR 29
1727 #define FB_MAX 32 /* sufficient for now */
1728
1729 +struct fb_splash_iowrapper
1730 +{
1731 + unsigned short vc; /* Virtual console */
1732 + unsigned char origin; /* Point of origin of the request */
1733 + void *data;
1734 +};
1735 +
1736 /* ioctls
1737 0x46 is 'F' */
1738 #define FBIOGET_VSCREENINFO 0x4600
1739 @@ -38,7 +45,15 @@ struct dentry;
1740 #define FBIOGET_HWCINFO 0x4616
1741 #define FBIOPUT_MODEINFO 0x4617
1742 #define FBIOGET_DISPINFO 0x4618
1743 -
1744 +#define FBIOSPLASH_SETCFG _IOWR('F', 0x19, struct fb_splash_iowrapper)
1745 +#define FBIOSPLASH_GETCFG _IOR('F', 0x1A, struct fb_splash_iowrapper)
1746 +#define FBIOSPLASH_SETSTATE _IOWR('F', 0x1B, struct fb_splash_iowrapper)
1747 +#define FBIOSPLASH_GETSTATE _IOR('F', 0x1C, struct fb_splash_iowrapper)
1748 +#define FBIOSPLASH_SETPIC _IOWR('F', 0x1D, struct fb_splash_iowrapper)
1749 +
1750 +#define FB_SPLASH_THEME_LEN 128 /* Maximum lenght of a theme name */
1751 +#define FB_SPLASH_IO_ORIG_KERNEL 0 /* Kernel ioctl origin */
1752 +#define FB_SPLASH_IO_ORIG_USER 1 /* User ioctl origin */
1753
1754 #define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
1755 #define FB_TYPE_PLANES 1 /* Non interleaved planes */
1756 @@ -828,6 +843,9 @@ struct fb_info {
1757 #define FBINFO_STATE_SUSPENDED 1
1758 u32 state; /* Hardware state i.e suspend */
1759 void *fbcon_par; /* fbcon use-only private area */
1760 +
1761 + struct fb_image splash;
1762 +
1763 /* From here on everything is device dependent */
1764 void *par;
1765 };
1766 --- a/include/linux/sysctl.h
1767 +++ b/include/linux/sysctl.h
1768 @@ -165,6 +165,7 @@ enum
1769 KERN_MAX_LOCK_DEPTH=74,
1770 KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */
1771 KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */
1772 + KERN_FBSPLASH=77, /* string: path to fbsplash helper */
1773 };
1774
1775
1776 --- a/kernel/sysctl.c
1777 +++ b/kernel/sysctl.c
1778 @@ -89,6 +89,9 @@ static int ngroups_max = NGROUPS_MAX;
1779 #ifdef CONFIG_KMOD
1780 extern char modprobe_path[];
1781 #endif
1782 +#ifdef CONFIG_FB_SPLASH
1783 +extern char fbsplash_path[];
1784 +#endif
1785 #ifdef CONFIG_CHR_DEV_SG
1786 extern int sg_big_buff;
1787 #endif
1788 @@ -343,6 +346,17 @@ static ctl_table kern_table[] = {
1789 .strategy = &sysctl_string,
1790 },
1791 #endif
1792 +#ifdef CONFIG_FB_SPLASH
1793 + {
1794 + .ctl_name = KERN_FBSPLASH,
1795 + .procname = "fbsplash",
1796 + .data = &fbsplash_path,
1797 + .maxlen = KMOD_PATH_LEN,
1798 + .mode = 0644,
1799 + .proc_handler = &proc_dostring,
1800 + .strategy = &sysctl_string,
1801 + },
1802 +#endif
1803 #ifdef CONFIG_CHR_DEV_SG
1804 {
1805 .ctl_name = KERN_SG_BIG_BUFF,

  ViewVC Help
Powered by ViewVC 1.1.20