/[linux-patches]/genpatches-2.6/tags/2.6.12-12/4500_fbsplash-0.9.2-r3.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.12-12/4500_fbsplash-0.9.2-r3.patch

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20