]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/bootsplash-3.0.7-2.4.31-vanilla.diff
Fehlende Datei für Bootsplash nachgereicht.
[people/pmueller/ipfire-2.x.git] / src / patches / bootsplash-3.0.7-2.4.31-vanilla.diff
1 diff -ruN linux-2.4.31/Makefile linux-2.4.31-bs/Makefile
2 --- linux-2.4.31/Makefile 2005-04-04 02:42:20.000000000 +0100
3 +++ linux-2.4.31-bs/Makefile 2005-05-18 12:16:16.000000000 +0100
4 @@ -1,7 +1,7 @@
5 VERSION = 2
6 PATCHLEVEL = 4
7 SUBLEVEL = 31
8 -EXTRAVERSION =
9 +EXTRAVERSION =
10
11 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
12
13 diff -ruN linux-2.4.31/drivers/char/console.c linux-2.4.31-bs/drivers/char/console.c
14 --- linux-2.4.31/drivers/char/console.c 2005-01-19 14:09:44.000000000 +0000
15 +++ linux-2.4.31-bs/drivers/char/console.c 2005-05-05 22:20:15.000000000 +0100
16 @@ -3031,6 +3031,32 @@
17 return 0;
18 }
19
20 +#ifdef CONFIG_FBCON_SPLASHSCREEN
21 +void con_remap_def_color(int currcons, int new_color)
22 +{
23 + unsigned short *sbuf = screenbuf;
24 + unsigned c, len = screenbuf_size >> 1;
25 + int old_color;
26 +
27 + if (sbuf) {
28 + old_color = def_color << 8;
29 + new_color <<= 8;
30 + while(len--) {
31 + c = *sbuf;
32 + if (((c ^ old_color) & 0xf000) == 0)
33 + *sbuf ^= (old_color ^ new_color) & 0xf000;
34 + if (((c ^ old_color) & 0x0f00) == 0)
35 + *sbuf ^= (old_color ^ new_color) & 0x0f00;
36 + sbuf++;
37 + }
38 + new_color >>= 8;
39 + }
40 + def_color = color = new_color;
41 + update_attr(currcons);
42 +}
43 +#endif
44 +
45 +
46 /*
47 * Visible symbols for modules
48 */
49 diff -ruN linux-2.4.31/drivers/char/keyboard.c linux-2.4.31-bs/drivers/char/keyboard.c
50 --- linux-2.4.31/drivers/char/keyboard.c 2003-11-28 18:26:20.000000000 +0000
51 +++ linux-2.4.31-bs/drivers/char/keyboard.c 2005-05-05 22:27:48.000000000 +0100
52 @@ -263,6 +263,15 @@
53 } else
54 rep = test_and_set_bit(keycode, key_down);
55
56 +#ifdef CONFIG_FBCON_SPLASHSCREEN
57 + /* This code has to be redone for some non-x86 platforms */
58 + if (keycode == 0x3c || keycode == 0x01) { /* F2 and ESC on a PC keyboard */
59 + extern int splash_verbose(void);
60 + if (splash_verbose())
61 + goto out;
62 + }
63 +#endif
64 +
65 #ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */
66 if (keycode == SYSRQ_KEY) {
67 sysrq_pressed = !up_flag;
68 diff -ruN linux-2.4.31/drivers/char/n_tty.c linux-2.4.31-bs/drivers/char/n_tty.c
69 --- linux-2.4.31/drivers/char/n_tty.c 2005-01-19 14:09:47.000000000 +0000
70 +++ linux-2.4.31-bs/drivers/char/n_tty.c 2005-05-05 22:14:50.000000000 +0100
71 @@ -45,6 +45,7 @@
72 #include <linux/string.h>
73 #include <linux/slab.h>
74 #include <linux/poll.h>
75 +#include <linux/config.h>
76
77 #include <asm/uaccess.h>
78 #include <asm/system.h>
79 @@ -1184,6 +1185,17 @@
80 return -EIO;
81 }
82
83 +#ifdef CONFIG_FBCON_SPLASHSCREEN
84 + if (file->f_dentry->d_inode->i_rdev == CONSOLE_DEV ||
85 + file->f_dentry->d_inode->i_rdev == SYSCONS_DEV ||
86 + file->f_dentry->d_inode->i_rdev == MKDEV(TTYAUX_MAJOR,0) ||
87 + file->f_dentry->d_inode->i_rdev == MKDEV(TTY_MAJOR,1)) {
88 + extern int splash_verbose(void);
89 + (void)splash_verbose();
90 + }
91 +#endif
92 +
93 +
94 c = job_control(tty, file);
95 if(c < 0)
96 return c;
97 diff -ruN linux-2.4.31/drivers/video/Config.in linux-2.4.31-bs/drivers/video/Config.in
98 --- linux-2.4.31/drivers/video/Config.in 2004-02-18 13:36:31.000000000 +0000
99 +++ linux-2.4.31-bs/drivers/video/Config.in 2005-05-05 22:24:55.000000000 +0100
100 @@ -239,13 +239,20 @@
101 tristate ' Virtual Frame Buffer support (ONLY FOR TESTING!) (EXPERIMENTAL)' CONFIG_FB_VIRTUAL
102 fi
103
104 + dep_bool ' Use splash screen instead of boot logo' CONFIG_FBCON_SPLASHSCREEN $CONFIG_BLK_DEV_INITRD
105 + if [ "$CONFIG_FBCON_SPLASHSCREEN" = "y" ]; then
106 + define_bool CONFIG_FBCON_CFB16 y
107 + fi
108 +
109 bool ' Advanced low level driver options' CONFIG_FBCON_ADVANCED
110 if [ "$CONFIG_FBCON_ADVANCED" = "y" ]; then
111 tristate ' Monochrome support' CONFIG_FBCON_MFB
112 tristate ' 2 bpp packed pixels support' CONFIG_FBCON_CFB2
113 tristate ' 4 bpp packed pixels support' CONFIG_FBCON_CFB4
114 tristate ' 8 bpp packed pixels support' CONFIG_FBCON_CFB8
115 - tristate ' 16 bpp packed pixels support' CONFIG_FBCON_CFB16
116 + if [ "$CONFIG_FBCON_SPLASHSCREEN" != "y" ]; then
117 + tristate ' 16 bpp packed pixels support' CONFIG_FBCON_CFB16
118 + fi
119 tristate ' 24 bpp packed pixels support' CONFIG_FBCON_CFB24
120 tristate ' 32 bpp packed pixels support' CONFIG_FBCON_CFB32
121 tristate ' Amiga bitplanes support' CONFIG_FBCON_AFB
122 @@ -355,7 +362,9 @@
123 "$CONFIG_FB_SIS" = "y" -o "$CONFIG_FB_SA1100" = "y" -o \
124 "$CONFIG_FB_PVR2" = "y" -o "$CONFIG_FB_VOODOO1" = "y" -o \
125 "$CONFIG_FB_NEOMAGIC" = "y" -o "$CONFIG_FB_INTEL" = "y" ]; then
126 - define_tristate CONFIG_FBCON_CFB16 y
127 + if [ "$CONFIG_FBCON_CFB16" != "m" ]; then
128 + define_tristate CONFIG_FBCON_CFB16 y
129 + fi
130 else
131 if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \
132 "$CONFIG_FB_MAC" = "m" -o "$CONFIG_FB_VESA" = "m" -o \
133 @@ -373,7 +382,9 @@
134 "$CONFIG_FB_INTEL" = "m" -o \
135 "$CONFIG_FB_PVR2" = "m" -o "$CONFIG_FB_VOODOO1" = "m" -o \
136 "$CONFIG_FB_NEOMAGIC" = "m" -o "$CONFIG_FB_INTEL" = "m" ]; then
137 - define_tristate CONFIG_FBCON_CFB16 m
138 + if [ "$CONFIG_FBCON_CFB16" != "y" ]; then
139 + define_tristate CONFIG_FBCON_CFB16 m
140 + fi
141 fi
142 fi
143 if [ "$CONFIG_FB_ATY" = "y" -o "$CONFIG_FB_VIRTUAL" = "y" -o \
144 diff -ruN linux-2.4.31/drivers/video/Makefile linux-2.4.31-bs/drivers/video/Makefile
145 --- linux-2.4.31/drivers/video/Makefile 2004-02-18 13:36:31.000000000 +0000
146 +++ linux-2.4.31-bs/drivers/video/Makefile 2005-05-06 11:28:28.000000000 +0100
147 @@ -14,7 +14,7 @@
148 fbcon-vga.o fbcon-iplan2p2.o fbcon-iplan2p4.o \
149 fbcon-iplan2p8.o fbcon-vga-planes.o fbcon-cfb16.o \
150 fbcon-cfb2.o fbcon-cfb24.o fbcon-cfb32.o fbcon-cfb4.o \
151 - fbcon-cfb8.o fbcon-mac.o fbcon-mfb.o \
152 + fbcon-cfb8.o fbcon-splash16.o fbcon-mac.o fbcon-mfb.o \
153 cyber2000fb.o sa1100fb.o fbcon-hga.o fbgen.o
154
155 # Each configuration option enables a list of files.
156 @@ -154,6 +154,9 @@
157 obj-$(CONFIG_FBCON_VGA) += fbcon-vga.o
158 obj-$(CONFIG_FBCON_HGA) += fbcon-hga.o
159 obj-$(CONFIG_FBCON_STI) += fbcon-sti.o
160 +obj-$(CONFIG_FBCON_SPLASHSCREEN) += fbcon-splash.o
161 +obj-$(CONFIG_FBCON_SPLASHSCREEN) += fbcon-splash16.o
162 +obj-$(CONFIG_FBCON_SPLASHSCREEN) += fbcon-jpegdec.o
163
164 include $(TOPDIR)/Rules.make
165
166 diff -ruN linux-2.4.31/drivers/video/fbcon-jpegdec.c linux-2.4.31-bs/drivers/video/fbcon-jpegdec.c
167 --- linux-2.4.31/drivers/video/fbcon-jpegdec.c 1970-01-01 01:00:00.000000000 +0100
168 +++ linux-2.4.31-bs/drivers/video/fbcon-jpegdec.c 2005-05-06 11:22:05.000000000 +0100
169 @@ -0,0 +1,960 @@
170 +/*
171 + * linux/drivers/video/fbcon-jpegdec.c - a tiny jpeg decoder.
172 + *
173 + * (w) August 2001 by Michael Schroeder, <mls@suse.de>
174 + *
175 + */
176 +
177 +#include <linux/config.h>
178 +#include <linux/string.h>
179 +#include <asm/byteorder.h>
180 +
181 +struct display;
182 +#include "fbcon-splash.h"
183 +#include "fbcon-jpegdec.h"
184 +
185 +#define ISHIFT 11
186 +
187 +#define IFIX(a) ((int)((a) * (1 << ISHIFT) + .5))
188 +#define IMULT(a, b) (((a) * (b)) >> ISHIFT)
189 +#define ITOINT(a) ((a) >> ISHIFT)
190 +
191 +#ifndef __P
192 +# define __P(x) x
193 +#endif
194 +
195 +/* special markers */
196 +#define M_BADHUFF -1
197 +#define M_EOF 0x80
198 +
199 +struct in {
200 + unsigned char *p;
201 + unsigned int bits;
202 + int left;
203 + int marker;
204 +
205 + int (*func) __P((void *));
206 + void *data;
207 +};
208 +
209 +/*********************************/
210 +struct dec_hufftbl;
211 +struct enc_hufftbl;
212 +
213 +union hufftblp {
214 + struct dec_hufftbl *dhuff;
215 + struct enc_hufftbl *ehuff;
216 +};
217 +
218 +struct scan {
219 + int dc; /* old dc value */
220 +
221 + union hufftblp hudc;
222 + union hufftblp huac;
223 + int next; /* when to switch to next scan */
224 +
225 + int cid; /* component id */
226 + int hv; /* horiz/vert, copied from comp */
227 + int tq; /* quant tbl, copied from comp */
228 +};
229 +
230 +/*********************************/
231 +
232 +#define DECBITS 10 /* seems to be the optimum */
233 +
234 +struct dec_hufftbl {
235 + int maxcode[17];
236 + int valptr[16];
237 + unsigned char vals[256];
238 + unsigned int llvals[1 << DECBITS];
239 +};
240 +
241 +static void decode_mcus __P((struct in *, int *, int, struct scan *, int *));
242 +static int dec_readmarker __P((struct in *));
243 +static void dec_makehuff __P((struct dec_hufftbl *, int *, unsigned char *));
244 +
245 +static void setinput __P((struct in *, unsigned char *));
246 +/*********************************/
247 +
248 +#undef PREC
249 +#define PREC int
250 +
251 +static void idctqtab __P((unsigned char *, PREC *));
252 +static void idct __P((int *, int *, PREC *, PREC, int));
253 +static void scaleidctqtab __P((PREC *, PREC));
254 +
255 +/*********************************/
256 +
257 +static void initcol __P((PREC[][64]));
258 +
259 +static void col221111 __P((int *, unsigned char *, int));
260 +static void col221111_16 __P((int *, unsigned char *, int));
261 +
262 +/*********************************/
263 +
264 +#define M_SOI 0xd8
265 +#define M_APP0 0xe0
266 +#define M_DQT 0xdb
267 +#define M_SOF0 0xc0
268 +#define M_DHT 0xc4
269 +#define M_DRI 0xdd
270 +#define M_SOS 0xda
271 +#define M_RST0 0xd0
272 +#define M_EOI 0xd9
273 +#define M_COM 0xfe
274 +
275 +static unsigned char *datap;
276 +
277 +static int getbyte(void)
278 +{
279 + return *datap++;
280 +}
281 +
282 +static int getword(void)
283 +{
284 + int c1, c2;
285 + c1 = *datap++;
286 + c2 = *datap++;
287 + return c1 << 8 | c2;
288 +}
289 +
290 +struct comp {
291 + int cid;
292 + int hv;
293 + int tq;
294 +};
295 +
296 +#define MAXCOMP 4
297 +struct jpginfo {
298 + int nc; /* number of components */
299 + int ns; /* number of scans */
300 + int dri; /* restart interval */
301 + int nm; /* mcus til next marker */
302 + int rm; /* next restart marker */
303 +};
304 +
305 +static struct jpginfo info;
306 +static struct comp comps[MAXCOMP];
307 +
308 +static struct scan dscans[MAXCOMP];
309 +
310 +static unsigned char quant[4][64];
311 +
312 +static struct dec_hufftbl dhuff[4];
313 +
314 +#define dec_huffdc (dhuff + 0)
315 +#define dec_huffac (dhuff + 2)
316 +
317 +static struct in in;
318 +
319 +static int readtables(int till)
320 +{
321 + int m, l, i, j, lq, pq, tq;
322 + int tc, th, tt;
323 +
324 + for (;;) {
325 + if (getbyte() != 0xff)
326 + return -1;
327 + if ((m = getbyte()) == till)
328 + break;
329 +
330 + switch (m) {
331 + case 0xc2:
332 + return 0;
333 +
334 + case M_DQT:
335 + lq = getword();
336 + while (lq > 2) {
337 + pq = getbyte();
338 + tq = pq & 15;
339 + if (tq > 3)
340 + return -1;
341 + pq >>= 4;
342 + if (pq != 0)
343 + return -1;
344 + for (i = 0; i < 64; i++)
345 + quant[tq][i] = getbyte();
346 + lq -= 64 + 1;
347 + }
348 + break;
349 +
350 + case M_DHT:
351 + l = getword();
352 + while (l > 2) {
353 + int hufflen[16], k;
354 + unsigned char huffvals[256];
355 +
356 + tc = getbyte();
357 + th = tc & 15;
358 + tc >>= 4;
359 + tt = tc * 2 + th;
360 + if (tc > 1 || th > 1)
361 + return -1;
362 + for (i = 0; i < 16; i++)
363 + hufflen[i] = getbyte();
364 + l -= 1 + 16;
365 + k = 0;
366 + for (i = 0; i < 16; i++) {
367 + for (j = 0; j < hufflen[i]; j++)
368 + huffvals[k++] = getbyte();
369 + l -= hufflen[i];
370 + }
371 + dec_makehuff(dhuff + tt, hufflen,
372 + huffvals);
373 + }
374 + break;
375 +
376 + case M_DRI:
377 + l = getword();
378 + info.dri = getword();
379 + break;
380 +
381 + default:
382 + l = getword();
383 + while (l-- > 2)
384 + getbyte();
385 + break;
386 + }
387 + }
388 + return 0;
389 +}
390 +
391 +static void dec_initscans(void)
392 +{
393 + int i;
394 +
395 + info.nm = info.dri + 1;
396 + info.rm = M_RST0;
397 + for (i = 0; i < info.ns; i++)
398 + dscans[i].dc = 0;
399 +}
400 +
401 +static int dec_checkmarker(void)
402 +{
403 + int i;
404 +
405 + if (dec_readmarker(&in) != info.rm)
406 + return -1;
407 + info.nm = info.dri;
408 + info.rm = (info.rm + 1) & ~0x08;
409 + for (i = 0; i < info.ns; i++)
410 + dscans[i].dc = 0;
411 + return 0;
412 +}
413 +
414 +int jpeg_check_size(unsigned char *buf, int width, int height)
415 +{
416 + datap = buf;
417 + getbyte();
418 + getbyte();
419 + readtables(M_SOF0);
420 + getword();
421 + getbyte();
422 + if (height != getword() || width != getword())
423 + return 0;
424 + return 1;
425 +}
426 +
427 +int jpeg_decode(buf, pic, width, height, depth, decdata)
428 +unsigned char *buf, *pic;
429 +int width, height, depth;
430 +struct jpeg_decdata *decdata;
431 +{
432 + int i, j, m, tac, tdc;
433 + int mcusx, mcusy, mx, my;
434 + int max[6];
435 +
436 + if (!decdata)
437 + return -1;
438 + datap = buf;
439 + if (getbyte() != 0xff)
440 + return ERR_NO_SOI;
441 + if (getbyte() != M_SOI)
442 + return ERR_NO_SOI;
443 + if (readtables(M_SOF0))
444 + return ERR_BAD_TABLES;
445 + getword();
446 + i = getbyte();
447 + if (i != 8)
448 + return ERR_NOT_8BIT;
449 + if (((getword() + 15) & ~15) != height)
450 + return ERR_HEIGHT_MISMATCH;
451 + if (((getword() + 15) & ~15) != width)
452 + return ERR_WIDTH_MISMATCH;
453 + if ((height & 15) || (width & 15))
454 + return ERR_BAD_WIDTH_OR_HEIGHT;
455 + info.nc = getbyte();
456 + if (info.nc > MAXCOMP)
457 + return ERR_TOO_MANY_COMPPS;
458 + for (i = 0; i < info.nc; i++) {
459 + int h, v;
460 + comps[i].cid = getbyte();
461 + comps[i].hv = getbyte();
462 + v = comps[i].hv & 15;
463 + h = comps[i].hv >> 4;
464 + comps[i].tq = getbyte();
465 + if (h > 3 || v > 3)
466 + return ERR_ILLEGAL_HV;
467 + if (comps[i].tq > 3)
468 + return ERR_QUANT_TABLE_SELECTOR;
469 + }
470 + if (readtables(M_SOS))
471 + return ERR_BAD_TABLES;
472 + getword();
473 + info.ns = getbyte();
474 + if (info.ns != 3)
475 + return ERR_NOT_YCBCR_221111;
476 + for (i = 0; i < 3; i++) {
477 + dscans[i].cid = getbyte();
478 + tdc = getbyte();
479 + tac = tdc & 15;
480 + tdc >>= 4;
481 + if (tdc > 1 || tac > 1)
482 + return ERR_QUANT_TABLE_SELECTOR;
483 + for (j = 0; j < info.nc; j++)
484 + if (comps[j].cid == dscans[i].cid)
485 + break;
486 + if (j == info.nc)
487 + return ERR_UNKNOWN_CID_IN_SCAN;
488 + dscans[i].hv = comps[j].hv;
489 + dscans[i].tq = comps[j].tq;
490 + dscans[i].hudc.dhuff = dec_huffdc + tdc;
491 + dscans[i].huac.dhuff = dec_huffac + tac;
492 + }
493 +
494 + i = getbyte();
495 + j = getbyte();
496 + m = getbyte();
497 +
498 + if (i != 0 || j != 63 || m != 0)
499 + return ERR_NOT_SEQUENTIAL_DCT;
500 +
501 + if (dscans[0].cid != 1 || dscans[1].cid != 2 || dscans[2].cid != 3)
502 + return ERR_NOT_YCBCR_221111;
503 +
504 + if (dscans[0].hv != 0x22 || dscans[1].hv != 0x11 || dscans[2].hv != 0x11)
505 + return ERR_NOT_YCBCR_221111;
506 +
507 + mcusx = width >> 4;
508 + mcusy = height >> 4;
509 +
510 +
511 + idctqtab(quant[dscans[0].tq], decdata->dquant[0]);
512 + idctqtab(quant[dscans[1].tq], decdata->dquant[1]);
513 + idctqtab(quant[dscans[2].tq], decdata->dquant[2]);
514 + initcol(decdata->dquant);
515 + setinput(&in, datap);
516 +
517 +#if 0
518 + /* landing zone */
519 + img[len] = 0;
520 + img[len + 1] = 0xff;
521 + img[len + 2] = M_EOF;
522 +#endif
523 +
524 + dec_initscans();
525 +
526 + dscans[0].next = 6 - 4;
527 + dscans[1].next = 6 - 4 - 1;
528 + dscans[2].next = 6 - 4 - 1 - 1; /* 411 encoding */
529 + for (my = 0; my < mcusy; my++) {
530 + for (mx = 0; mx < mcusx; mx++) {
531 + if (info.dri && !--info.nm)
532 + if (dec_checkmarker())
533 + return ERR_WRONG_MARKER;
534 +
535 + decode_mcus(&in, decdata->dcts, 6, dscans, max);
536 + idct(decdata->dcts, decdata->out, decdata->dquant[0], IFIX(128.5), max[0]);
537 + idct(decdata->dcts + 64, decdata->out + 64, decdata->dquant[0], IFIX(128.5), max[1]);
538 + idct(decdata->dcts + 128, decdata->out + 128, decdata->dquant[0], IFIX(128.5), max[2]);
539 + idct(decdata->dcts + 192, decdata->out + 192, decdata->dquant[0], IFIX(128.5), max[3]);
540 + idct(decdata->dcts + 256, decdata->out + 256, decdata->dquant[1], IFIX(0.5), max[4]);
541 + idct(decdata->dcts + 320, decdata->out + 320, decdata->dquant[2], IFIX(0.5), max[5]);
542 +
543 + switch (depth) {
544 + case 24:
545 + col221111(decdata->out, pic + (my * 16 * mcusx + mx) * 16 * 3, mcusx * 16 * 3);
546 + break;
547 + case 16:
548 + col221111_16(decdata->out, pic + (my * 16 * mcusx + mx) * (16 * 2), mcusx * (16 * 2));
549 + break;
550 + default:
551 + return ERR_DEPTH_MISMATCH;
552 + break;
553 + }
554 + }
555 + }
556 +
557 + m = dec_readmarker(&in);
558 + if (m != M_EOI)
559 + return ERR_NO_EOI;
560 +
561 + return 0;
562 +}
563 +
564 +/****************************************************************/
565 +/************** huffman decoder ***************/
566 +/****************************************************************/
567 +
568 +static int fillbits __P((struct in *, int, unsigned int));
569 +static int dec_rec2
570 +__P((struct in *, struct dec_hufftbl *, int *, int, int));
571 +
572 +static void setinput(in, p)
573 +struct in *in;
574 +unsigned char *p;
575 +{
576 + in->p = p;
577 + in->left = 0;
578 + in->bits = 0;
579 + in->marker = 0;
580 +}
581 +
582 +static int fillbits(in, le, bi)
583 +struct in *in;
584 +int le;
585 +unsigned int bi;
586 +{
587 + int b, m;
588 +
589 + if (in->marker) {
590 + if (le <= 16)
591 + in->bits = bi << 16, le += 16;
592 + return le;
593 + }
594 + while (le <= 24) {
595 + b = *in->p++;
596 + if (b == 0xff && (m = *in->p++) != 0) {
597 + if (m == M_EOF) {
598 + if (in->func && (m = in->func(in->data)) == 0)
599 + continue;
600 + }
601 + in->marker = m;
602 + if (le <= 16)
603 + bi = bi << 16, le += 16;
604 + break;
605 + }
606 + bi = bi << 8 | b;
607 + le += 8;
608 + }
609 + in->bits = bi; /* tmp... 2 return values needed */
610 + return le;
611 +}
612 +
613 +static int dec_readmarker(in)
614 +struct in *in;
615 +{
616 + int m;
617 +
618 + in->left = fillbits(in, in->left, in->bits);
619 + if ((m = in->marker) == 0)
620 + return 0;
621 + in->left = 0;
622 + in->marker = 0;
623 + return m;
624 +}
625 +
626 +#define LEBI_DCL int le, bi
627 +#define LEBI_GET(in) (le = in->left, bi = in->bits)
628 +#define LEBI_PUT(in) (in->left = le, in->bits = bi)
629 +
630 +#define GETBITS(in, n) ( \
631 + (le < (n) ? le = fillbits(in, le, bi), bi = in->bits : 0), \
632 + (le -= (n)), \
633 + bi >> le & ((1 << (n)) - 1) \
634 +)
635 +
636 +#define UNGETBITS(in, n) ( \
637 + le += (n) \
638 +)
639 +
640 +
641 +static int dec_rec2(in, hu, runp, c, i)
642 +struct in *in;
643 +struct dec_hufftbl *hu;
644 +int *runp;
645 +int c, i;
646 +{
647 + LEBI_DCL;
648 +
649 + LEBI_GET(in);
650 + if (i) {
651 + UNGETBITS(in, i & 127);
652 + *runp = i >> 8 & 15;
653 + i >>= 16;
654 + } else {
655 + for (i = DECBITS; (c = ((c << 1) | GETBITS(in, 1))) >= (hu->maxcode[i]); i++);
656 + if (i >= 16) {
657 + in->marker = M_BADHUFF;
658 + return 0;
659 + }
660 + i = hu->vals[hu->valptr[i] + c - hu->maxcode[i - 1] * 2];
661 + *runp = i >> 4;
662 + i &= 15;
663 + }
664 + if (i == 0) { /* sigh, 0xf0 is 11 bit */
665 + LEBI_PUT(in);
666 + return 0;
667 + }
668 + /* receive part */
669 + c = GETBITS(in, i);
670 + if (c < (1 << (i - 1)))
671 + c += (-1 << i) + 1;
672 + LEBI_PUT(in);
673 + return c;
674 +}
675 +
676 +#define DEC_REC(in, hu, r, i) ( \
677 + r = GETBITS(in, DECBITS), \
678 + i = hu->llvals[r], \
679 + i & 128 ? \
680 + ( \
681 + UNGETBITS(in, i & 127), \
682 + r = i >> 8 & 15, \
683 + i >> 16 \
684 + ) \
685 + : \
686 + ( \
687 + LEBI_PUT(in), \
688 + i = dec_rec2(in, hu, &r, r, i), \
689 + LEBI_GET(in), \
690 + i \
691 + ) \
692 +)
693 +
694 +static void decode_mcus(in, dct, n, sc, maxp)
695 +struct in *in;
696 +int *dct;
697 +int n;
698 +struct scan *sc;
699 +int *maxp;
700 +{
701 + struct dec_hufftbl *hu;
702 + int i, r, t;
703 + LEBI_DCL;
704 +
705 + memset(dct, 0, n * 64 * sizeof(*dct));
706 + LEBI_GET(in);
707 + while (n-- > 0) {
708 + hu = sc->hudc.dhuff;
709 + *dct++ = (sc->dc += DEC_REC(in, hu, r, t));
710 +
711 + hu = sc->huac.dhuff;
712 + i = 63;
713 + while (i > 0) {
714 + t = DEC_REC(in, hu, r, t);
715 + if (t == 0 && r == 0) {
716 + dct += i;
717 + break;
718 + }
719 + dct += r;
720 + *dct++ = t;
721 + i -= r + 1;
722 + }
723 + *maxp++ = 64 - i;
724 + if (n == sc->next)
725 + sc++;
726 + }
727 + LEBI_PUT(in);
728 +}
729 +
730 +static void dec_makehuff(hu, hufflen, huffvals)
731 +struct dec_hufftbl *hu;
732 +int *hufflen;
733 +unsigned char *huffvals;
734 +{
735 + int code, k, i, j, d, x, c, v;
736 + for (i = 0; i < (1 << DECBITS); i++)
737 + hu->llvals[i] = 0;
738 +
739 +/*
740 + * llvals layout:
741 + *
742 + * value v already known, run r, backup u bits:
743 + * vvvvvvvvvvvvvvvv 0000 rrrr 1 uuuuuuu
744 + * value unknown, size b bits, run r, backup u bits:
745 + * 000000000000bbbb 0000 rrrr 0 uuuuuuu
746 + * value and size unknown:
747 + * 0000000000000000 0000 0000 0 0000000
748 + */
749 + code = 0;
750 + k = 0;
751 + for (i = 0; i < 16; i++, code <<= 1) { /* sizes */
752 + hu->valptr[i] = k;
753 + for (j = 0; j < hufflen[i]; j++) {
754 + hu->vals[k] = *huffvals++;
755 + if (i < DECBITS) {
756 + c = code << (DECBITS - 1 - i);
757 + v = hu->vals[k] & 0x0f; /* size */
758 + for (d = 1 << (DECBITS - 1 - i); --d >= 0;) {
759 + if (v + i < DECBITS) { /* both fit in table */
760 + x = d >> (DECBITS - 1 - v -
761 + i);
762 + if (v && x < (1 << (v - 1)))
763 + x += (-1 << v) + 1;
764 + x = x << 16 | (hu-> vals[k] & 0xf0) << 4 |
765 + (DECBITS - (i + 1 + v)) | 128;
766 + } else
767 + x = v << 16 | (hu-> vals[k] & 0xf0) << 4 |
768 + (DECBITS - (i + 1));
769 + hu->llvals[c | d] = x;
770 + }
771 + }
772 + code++;
773 + k++;
774 + }
775 + hu->maxcode[i] = code;
776 + }
777 + hu->maxcode[16] = 0x20000; /* always terminate decode */
778 +}
779 +
780 +/****************************************************************/
781 +/************** idct ***************/
782 +/****************************************************************/
783 +
784 +#define ONE ((PREC)IFIX(1.))
785 +#define S2 ((PREC)IFIX(0.382683432))
786 +#define C2 ((PREC)IFIX(0.923879532))
787 +#define C4 ((PREC)IFIX(0.707106781))
788 +
789 +#define S22 ((PREC)IFIX(2 * 0.382683432))
790 +#define C22 ((PREC)IFIX(2 * 0.923879532))
791 +#define IC4 ((PREC)IFIX(1 / 0.707106781))
792 +
793 +#define C3IC1 ((PREC)IFIX(0.847759065)) /* c3/c1 */
794 +#define C5IC1 ((PREC)IFIX(0.566454497)) /* c5/c1 */
795 +#define C7IC1 ((PREC)IFIX(0.198912367)) /* c7/c1 */
796 +
797 +#define XPP(a,b) (t = a + b, b = a - b, a = t)
798 +#define XMP(a,b) (t = a - b, b = a + b, a = t)
799 +#define XPM(a,b) (t = a + b, b = b - a, a = t)
800 +
801 +#define ROT(a,b,s,c) ( t = IMULT(a + b, s), \
802 + a = IMULT(a, c - s) + t, \
803 + b = IMULT(b, c + s) - t)
804 +
805 +#define IDCT \
806 +( \
807 + XPP(t0, t1), \
808 + XMP(t2, t3), \
809 + t2 = IMULT(t2, IC4) - t3, \
810 + XPP(t0, t3), \
811 + XPP(t1, t2), \
812 + XMP(t4, t7), \
813 + XPP(t5, t6), \
814 + XMP(t5, t7), \
815 + t5 = IMULT(t5, IC4), \
816 + ROT(t4, t6, S22, C22),\
817 + t6 -= t7, \
818 + t5 -= t6, \
819 + t4 -= t5, \
820 + XPP(t0, t7), \
821 + XPP(t1, t6), \
822 + XPP(t2, t5), \
823 + XPP(t3, t4) \
824 +)
825 +
826 +static unsigned char zig2[64] = {
827 + 0, 2, 3, 9, 10, 20, 21, 35,
828 + 14, 16, 25, 31, 39, 46, 50, 57,
829 + 5, 7, 12, 18, 23, 33, 37, 48,
830 + 27, 29, 41, 44, 52, 55, 59, 62,
831 + 15, 26, 30, 40, 45, 51, 56, 58,
832 + 1, 4, 8, 11, 19, 22, 34, 36,
833 + 28, 42, 43, 53, 54, 60, 61, 63,
834 + 6, 13, 17, 24, 32, 38, 47, 49
835 +};
836 +
837 +void idct(in, out, quant, off, max)
838 +int *in;
839 +int *out;
840 +PREC *quant;
841 +PREC off;
842 +int max;
843 +{
844 + PREC t0, t1, t2, t3, t4, t5, t6, t7, t;
845 + PREC tmp[64], *tmpp;
846 + int i, j;
847 + unsigned char *zig2p;
848 +
849 + t0 = off;
850 + if (max == 1) {
851 + t0 += in[0] * quant[0];
852 + for (i = 0; i < 64; i++)
853 + out[i] = ITOINT(t0);
854 + return;
855 + }
856 + zig2p = zig2;
857 + tmpp = tmp;
858 + for (i = 0; i < 8; i++) {
859 + j = *zig2p++;
860 + t0 += in[j] * quant[j];
861 + j = *zig2p++;
862 + t5 = in[j] * quant[j];
863 + j = *zig2p++;
864 + t2 = in[j] * quant[j];
865 + j = *zig2p++;
866 + t7 = in[j] * quant[j];
867 + j = *zig2p++;
868 + t1 = in[j] * quant[j];
869 + j = *zig2p++;
870 + t4 = in[j] * quant[j];
871 + j = *zig2p++;
872 + t3 = in[j] * quant[j];
873 + j = *zig2p++;
874 + t6 = in[j] * quant[j];
875 + IDCT;
876 + tmpp[0 * 8] = t0;
877 + tmpp[1 * 8] = t1;
878 + tmpp[2 * 8] = t2;
879 + tmpp[3 * 8] = t3;
880 + tmpp[4 * 8] = t4;
881 + tmpp[5 * 8] = t5;
882 + tmpp[6 * 8] = t6;
883 + tmpp[7 * 8] = t7;
884 + tmpp++;
885 + t0 = 0;
886 + }
887 + for (i = 0; i < 8; i++) {
888 + t0 = tmp[8 * i + 0];
889 + t1 = tmp[8 * i + 1];
890 + t2 = tmp[8 * i + 2];
891 + t3 = tmp[8 * i + 3];
892 + t4 = tmp[8 * i + 4];
893 + t5 = tmp[8 * i + 5];
894 + t6 = tmp[8 * i + 6];
895 + t7 = tmp[8 * i + 7];
896 + IDCT;
897 + out[8 * i + 0] = ITOINT(t0);
898 + out[8 * i + 1] = ITOINT(t1);
899 + out[8 * i + 2] = ITOINT(t2);
900 + out[8 * i + 3] = ITOINT(t3);
901 + out[8 * i + 4] = ITOINT(t4);
902 + out[8 * i + 5] = ITOINT(t5);
903 + out[8 * i + 6] = ITOINT(t6);
904 + out[8 * i + 7] = ITOINT(t7);
905 + }
906 +}
907 +
908 +static unsigned char zig[64] = {
909 + 0, 1, 5, 6, 14, 15, 27, 28,
910 + 2, 4, 7, 13, 16, 26, 29, 42,
911 + 3, 8, 12, 17, 25, 30, 41, 43,
912 + 9, 11, 18, 24, 31, 40, 44, 53,
913 + 10, 19, 23, 32, 39, 45, 52, 54,
914 + 20, 22, 33, 38, 46, 51, 55, 60,
915 + 21, 34, 37, 47, 50, 56, 59, 61,
916 + 35, 36, 48, 49, 57, 58, 62, 63
917 +};
918 +
919 +static PREC aaidct[8] = {
920 + IFIX(0.3535533906), IFIX(0.4903926402),
921 + IFIX(0.4619397663), IFIX(0.4157348062),
922 + IFIX(0.3535533906), IFIX(0.2777851165),
923 + IFIX(0.1913417162), IFIX(0.0975451610)
924 +};
925 +
926 +
927 +static void idctqtab(qin, qout)
928 +unsigned char *qin;
929 +PREC *qout;
930 +{
931 + int i, j;
932 +
933 + for (i = 0; i < 8; i++)
934 + for (j = 0; j < 8; j++)
935 + qout[zig[i * 8 + j]] = qin[zig[i * 8 + j]] *
936 + IMULT(aaidct[i], aaidct[j]);
937 +}
938 +
939 +static void scaleidctqtab(q, sc)
940 +PREC *q;
941 +PREC sc;
942 +{
943 + int i;
944 +
945 + for (i = 0; i < 64; i++)
946 + q[i] = IMULT(q[i], sc);
947 +}
948 +
949 +/****************************************************************/
950 +/************** color decoder ***************/
951 +/****************************************************************/
952 +
953 +#define ROUND
954 +
955 +/*
956 + * YCbCr Color transformation:
957 + *
958 + * y:0..255 Cb:-128..127 Cr:-128..127
959 + *
960 + * R = Y + 1.40200 * Cr
961 + * G = Y - 0.34414 * Cb - 0.71414 * Cr
962 + * B = Y + 1.77200 * Cb
963 + *
964 + * =>
965 + * Cr *= 1.40200;
966 + * Cb *= 1.77200;
967 + * Cg = 0.19421 * Cb + .50937 * Cr;
968 + * R = Y + Cr;
969 + * G = Y - Cg;
970 + * B = Y + Cb;
971 + *
972 + * =>
973 + * Cg = (50 * Cb + 130 * Cr + 128) >> 8;
974 + */
975 +
976 +static void initcol(q)
977 +PREC q[][64];
978 +{
979 + scaleidctqtab(q[1], IFIX(1.77200));
980 + scaleidctqtab(q[2], IFIX(1.40200));
981 +}
982 +
983 +/* This is optimized for the stupid sun SUNWspro compiler. */
984 +#define STORECLAMP(a,x) \
985 +( \
986 + (a) = (x), \
987 + (unsigned int)(x) >= 256 ? \
988 + ((a) = (x) < 0 ? 0 : 255) \
989 + : \
990 + 0 \
991 +)
992 +
993 +#define CLAMP(x) ((unsigned int)(x) >= 256 ? ((x) < 0 ? 0 : 255) : (x))
994 +
995 +#ifdef ROUND
996 +
997 +#define CBCRCG(yin, xin) \
998 +( \
999 + cb = outc[0 +yin*8+xin], \
1000 + cr = outc[64+yin*8+xin], \
1001 + cg = (50 * cb + 130 * cr + 128) >> 8 \
1002 +)
1003 +
1004 +#else
1005 +
1006 +#define CBCRCG(yin, xin) \
1007 +( \
1008 + cb = outc[0 +yin*8+xin], \
1009 + cr = outc[64+yin*8+xin], \
1010 + cg = (3 * cb + 8 * cr) >> 4 \
1011 +)
1012 +
1013 +#endif
1014 +
1015 +#define PIC(yin, xin, p, xout) \
1016 +( \
1017 + y = outy[(yin) * 8 + xin], \
1018 + STORECLAMP(p[(xout) * 3 + 0], y + cr), \
1019 + STORECLAMP(p[(xout) * 3 + 1], y - cg), \
1020 + STORECLAMP(p[(xout) * 3 + 2], y + cb) \
1021 +)
1022 +
1023 +#ifdef __LITTLE_ENDIAN
1024 +#define PIC_16(yin, xin, p, xout, add) \
1025 +( \
1026 + y = outy[(yin) * 8 + xin], \
1027 + y = ((CLAMP(y + cr + add*2+1) & 0xf8) << 8) | \
1028 + ((CLAMP(y - cg + add ) & 0xfc) << 3) | \
1029 + ((CLAMP(y + cb + add*2+1) ) >> 3), \
1030 + p[(xout) * 2 + 0] = y & 0xff, \
1031 + p[(xout) * 2 + 1] = y >> 8 \
1032 +)
1033 +#else
1034 +#ifdef CONFIG_PPC
1035 +#define PIC_16(yin, xin, p, xout, add) \
1036 +( \
1037 + y = outy[(yin) * 8 + xin], \
1038 + y = ((CLAMP(y + cr + add*2+1) & 0xf8) << 7) | \
1039 + ((CLAMP(y - cg + add*2+1) & 0xf8) << 2) | \
1040 + ((CLAMP(y + cb + add*2+1) ) >> 3), \
1041 + p[(xout) * 2 + 0] = y >> 8, \
1042 + p[(xout) * 2 + 1] = y & 0xff \
1043 +)
1044 +#else
1045 +#define PIC_16(yin, xin, p, xout, add) \
1046 +( \
1047 + y = outy[(yin) * 8 + xin], \
1048 + y = ((CLAMP(y + cr + add*2+1) & 0xf8) << 8) | \
1049 + ((CLAMP(y - cg + add ) & 0xfc) << 3) | \
1050 + ((CLAMP(y + cb + add*2+1) ) >> 3), \
1051 + p[(xout) * 2 + 0] = y >> 8, \
1052 + p[(xout) * 2 + 1] = y & 0xff \
1053 +)
1054 +#endif
1055 +#endif
1056 +
1057 +#define PIC221111(xin) \
1058 +( \
1059 + CBCRCG(0, xin), \
1060 + PIC(xin / 4 * 8 + 0, (xin & 3) * 2 + 0, pic0, xin * 2 + 0), \
1061 + PIC(xin / 4 * 8 + 0, (xin & 3) * 2 + 1, pic0, xin * 2 + 1), \
1062 + PIC(xin / 4 * 8 + 1, (xin & 3) * 2 + 0, pic1, xin * 2 + 0), \
1063 + PIC(xin / 4 * 8 + 1, (xin & 3) * 2 + 1, pic1, xin * 2 + 1) \
1064 +)
1065 +
1066 +#define PIC221111_16(xin) \
1067 +( \
1068 + CBCRCG(0, xin), \
1069 + PIC_16(xin / 4 * 8 + 0, (xin & 3) * 2 + 0, pic0, xin * 2 + 0, 3), \
1070 + PIC_16(xin / 4 * 8 + 0, (xin & 3) * 2 + 1, pic0, xin * 2 + 1, 0), \
1071 + PIC_16(xin / 4 * 8 + 1, (xin & 3) * 2 + 0, pic1, xin * 2 + 0, 1), \
1072 + PIC_16(xin / 4 * 8 + 1, (xin & 3) * 2 + 1, pic1, xin * 2 + 1, 2) \
1073 +)
1074 +
1075 +static void col221111(out, pic, width)
1076 +int *out;
1077 +unsigned char *pic;
1078 +int width;
1079 +{
1080 + int i, j, k;
1081 + unsigned char *pic0, *pic1;
1082 + int *outy, *outc;
1083 + int cr, cg, cb, y;
1084 +
1085 + pic0 = pic;
1086 + pic1 = pic + width;
1087 + outy = out;
1088 + outc = out + 64 * 4;
1089 + for (i = 2; i > 0; i--) {
1090 + for (j = 4; j > 0; j--) {
1091 + for (k = 0; k < 8; k++) {
1092 + PIC221111(k);
1093 + }
1094 + outc += 8;
1095 + outy += 16;
1096 + pic0 += 2 * width;
1097 + pic1 += 2 * width;
1098 + }
1099 + outy += 64 * 2 - 16 * 4;
1100 + }
1101 +}
1102 +
1103 +static void col221111_16(out, pic, width)
1104 +int *out;
1105 +unsigned char *pic;
1106 +int width;
1107 +{
1108 + int i, j, k;
1109 + unsigned char *pic0, *pic1;
1110 + int *outy, *outc;
1111 + int cr, cg, cb, y;
1112 +
1113 + pic0 = pic;
1114 + pic1 = pic + width;
1115 + outy = out;
1116 + outc = out + 64 * 4;
1117 + for (i = 2; i > 0; i--) {
1118 + for (j = 4; j > 0; j--) {
1119 + for (k = 0; k < 8; k++) {
1120 + PIC221111_16(k);
1121 + }
1122 + outc += 8;
1123 + outy += 16;
1124 + pic0 += 2 * width;
1125 + pic1 += 2 * width;
1126 + }
1127 + outy += 64 * 2 - 16 * 4;
1128 + }
1129 +}
1130 diff -ruN linux-2.4.31/drivers/video/fbcon-jpegdec.h linux-2.4.31-bs/drivers/video/fbcon-jpegdec.h
1131 --- linux-2.4.31/drivers/video/fbcon-jpegdec.h 1970-01-01 01:00:00.000000000 +0100
1132 +++ linux-2.4.31-bs/drivers/video/fbcon-jpegdec.h 2005-05-06 11:23:55.000000000 +0100
1133 @@ -0,0 +1,24 @@
1134 +#define ERR_NO_SOI 1
1135 +#define ERR_NOT_8BIT 2
1136 +#define ERR_HEIGHT_MISMATCH 3
1137 +#define ERR_WIDTH_MISMATCH 4
1138 +#define ERR_BAD_WIDTH_OR_HEIGHT 5
1139 +#define ERR_TOO_MANY_COMPPS 6
1140 +#define ERR_ILLEGAL_HV 7
1141 +#define ERR_QUANT_TABLE_SELECTOR 8
1142 +#define ERR_NOT_YCBCR_221111 9
1143 +#define ERR_UNKNOWN_CID_IN_SCAN 10
1144 +#define ERR_NOT_SEQUENTIAL_DCT 11
1145 +#define ERR_WRONG_MARKER 12
1146 +#define ERR_NO_EOI 13
1147 +#define ERR_BAD_TABLES 14
1148 +#define ERR_DEPTH_MISMATCH 15
1149 +
1150 +struct jpeg_decdata {
1151 + int dcts[6 * 64 + 16];
1152 + int out[64 * 6];
1153 + int dquant[3][64];
1154 +};
1155 +
1156 +extern int jpeg_decode(unsigned char *, unsigned char *, int, int, int, struct jpeg_decdata *);
1157 +extern int jpeg_check_size(unsigned char *, int, int);
1158 diff -ruN linux-2.4.31/drivers/video/fbcon-splash.c linux-2.4.31-bs/drivers/video/fbcon-splash.c
1159 --- linux-2.4.31/drivers/video/fbcon-splash.c 1970-01-01 01:00:00.000000000 +0100
1160 +++ linux-2.4.31-bs/drivers/video/fbcon-splash.c 2005-05-06 11:24:52.000000000 +0100
1161 @@ -0,0 +1,848 @@
1162 +/*
1163 + * linux/drivers/video/fbcon-splash.c - splash screen handling functions.
1164 + *
1165 + * (w) 2001-2003 by Volker Poplawski, <volker@suse.de>
1166 + * Stefan Reinauer, <stepan@suse.de>
1167 + * Steffen Winterfeldt, <snwint@suse.de>
1168 + *
1169 + * Ideas & SuSE screen work by Ken Wimer, <wimer@suse.de>
1170 + */
1171 +
1172 +#include <linux/version.h>
1173 +#include <linux/config.h>
1174 +#include <linux/module.h>
1175 +#include <linux/fb.h>
1176 +#include <linux/vt_kern.h>
1177 +#include <linux/vmalloc.h>
1178 +
1179 +#include <asm/irq.h>
1180 +#include <asm/system.h>
1181 +
1182 +#include <video/fbcon.h>
1183 +#include <video/font.h>
1184 +#include <video/fbcon-cfb16.h> /* for fbcon_cfb16 */
1185 +
1186 +#include "fbcon-splash.h"
1187 +#include "fbcon-jpegdec.h"
1188 +
1189 +#define SPLASH_VERSION "3.0.7-2003/03/10"
1190 +
1191 +#ifdef CONFIG_BLK_DEV_INITRD
1192 +unsigned char signature[] = "BOOTSPL1SPL2SPL3";
1193 +#endif
1194 +
1195 +/* from drivers/char/console.c */
1196 +extern void con_remap_def_color(int currcons, int new_color);
1197 +
1198 +/* from drivers/video/fbcon-splash16.c */
1199 +extern void splashfill(u8 *dest, u8 *src, int width, int height,
1200 + int dest_linesize, int src_linesize);
1201 +
1202 +/* internal control states and data pointers */
1203 +struct splash_data splash_data;
1204 +
1205 +unsigned char *linux_splash; /* decoded picture */
1206 +int linux_splash_size = 0;
1207 +
1208 +static struct jpeg_decdata *decdata = 0; /* private decoder data */
1209 +
1210 +int splash_bytes; /* bytes per line in linux_splash */
1211 +int splash_shown = 0; /* is the splash onscreen? */
1212 +int splash_usesilent = 0; /* shall we display the silentjpeg */
1213 +int splash_default = 0xf01;
1214 +
1215 +static int splash_status(struct display *p);
1216 +static int splash_recolor(struct display *p);
1217 +static int splash_check_jpeg(unsigned char *jpeg, int width, int height, int depth);
1218 +
1219 +extern struct display_switch fbcon_splash16;
1220 +
1221 +int __init splash_init(char *options)
1222 +{
1223 + if(!strncmp("silent",options,6)) {
1224 + printk(KERN_INFO "bootsplash: silent mode.\n");
1225 + splash_usesilent = 1;
1226 + /* skip "silent," */
1227 + if (strlen(options)==6)
1228 + return 0;
1229 + options+=7;
1230 + }
1231 + if(!strncmp("verbose",options,7)) {
1232 + printk(KERN_INFO "bootsplash: verbose mode.\n");
1233 + splash_usesilent = 0;
1234 + return 0;
1235 + }
1236 +
1237 + splash_default = simple_strtoul(options, NULL, 0);
1238 +
1239 + return 0;
1240 +}
1241 +
1242 +__setup("splash=", splash_init);
1243 +
1244 +
1245 +static int splash_hasinter(unsigned char *buf, int num)
1246 +{
1247 + unsigned char *bufend = buf + num * 12;
1248 + while(buf < bufend) {
1249 + if (buf[1] > 127) /* inter? */
1250 + return 1;
1251 + buf += buf[3] > 127 ? 24 : 12; /* blend? */
1252 + }
1253 + return 0;
1254 +}
1255 +
1256 +static int boxextract(unsigned char *buf, unsigned short *dp, unsigned char *cols, int *blendp)
1257 +{
1258 + dp[0] = buf[0] | buf[1] << 8;
1259 + dp[1] = buf[2] | buf[3] << 8;
1260 + dp[2] = buf[4] | buf[5] << 8;
1261 + dp[3] = buf[6] | buf[7] << 8;
1262 + *(unsigned int *)(cols + 0) =
1263 + *(unsigned int *)(cols + 4) =
1264 + *(unsigned int *)(cols + 8) =
1265 + *(unsigned int *)(cols + 12) = *(unsigned int *)(buf + 8);
1266 + if (dp[1] > 32767) {
1267 + dp[1] = ~dp[1];
1268 + *(unsigned int *)(cols + 4) = *(unsigned int *)(buf + 12);
1269 + *(unsigned int *)(cols + 8) = *(unsigned int *)(buf + 16);
1270 + *(unsigned int *)(cols + 12) = *(unsigned int *)(buf + 20);
1271 + *blendp = 1;
1272 + return 24;
1273 + }
1274 + return 12;
1275 +}
1276 +
1277 +static void boxit(unsigned char *pic, int bytes, unsigned char *buf, int num, int percent, int overpaint)
1278 +{
1279 + int x, y, i, p, doblend, r, g, b, a, add;
1280 + unsigned short data1[4];
1281 + unsigned char cols1[16];
1282 + unsigned short data2[4];
1283 + unsigned char cols2[16];
1284 + unsigned char *bufend;
1285 + unsigned short *picp;
1286 +
1287 + if (num == 0)
1288 + return;
1289 + bufend = buf + num * 12;
1290 + while(buf < bufend) {
1291 + doblend = 0;
1292 + buf += boxextract(buf, data1, cols1, &doblend);
1293 + if (data1[0] > 32767)
1294 + buf += boxextract(buf, data2, cols2, &doblend);
1295 + if (data1[2] > 32767) {
1296 + if (overpaint)
1297 + continue;
1298 + data1[2] = ~data1[2];
1299 + }
1300 + if (data1[3] > 32767) {
1301 + if (percent == 65536)
1302 + continue;
1303 + data1[3] = ~data1[3];
1304 + }
1305 + if (data1[0] > 32767) {
1306 + data1[0] = ~data1[0];
1307 + for (i = 0; i < 4; i++)
1308 + data1[i] = (data1[i] * (65536 - percent) + data2[i] * percent) >> 16;
1309 + for (i = 0; i < 16; i++)
1310 + cols1[i] = (cols1[i] * (65536 - percent) + cols2[i] * percent) >> 16;
1311 + }
1312 + *(unsigned int *)cols2 = *(unsigned int *)cols1;
1313 + a = cols2[3];
1314 + if (a == 0 && !doblend)
1315 + continue;
1316 + for (y = data1[1]; y <= data1[3]; y++) {
1317 + if (doblend) {
1318 + if ((p = data1[3] - data1[1]) != 0)
1319 + p = ((y - data1[1]) << 16) / p;
1320 + for (i = 0; i < 8; i++)
1321 + cols2[i + 8] = (cols1[i] * (65536 - p) + cols1[i + 8] * p) >> 16;
1322 + }
1323 + add = (data1[0] & 1);
1324 + add ^= (add ^ y) & 1 ? 1 : 3; /* 2x2 ordered dithering */
1325 + picp = (unsigned short *)(pic + data1[0] * 2 + y * bytes);
1326 + for (x = data1[0]; x <= data1[2]; x++) {
1327 + if (doblend) {
1328 + if ((p = data1[2] - data1[0]) != 0)
1329 + p = ((x - data1[0]) << 16) / p;
1330 + for (i = 0; i < 4; i++)
1331 + cols2[i] = (cols2[i + 8] * (65536 - p) + cols2[i + 12] * p) >> 16;
1332 + a = cols2[3];
1333 + }
1334 + r = cols2[0];
1335 + g = cols2[1];
1336 + b = cols2[2];
1337 + if (a != 255) {
1338 + i = *picp;
1339 + r = ((i >> 8 & 0xf8) * (255 - a) + r * a) / 255;
1340 + g = ((i >> 3 & 0xfc) * (255 - a) + g * a) / 255;
1341 + b = ((i << 3 & 0xf8) * (255 - a) + b * a) / 255;
1342 + }
1343 + #define CLAMP(x) ((x) >= 256 ? 255 : (x))
1344 + i = ((CLAMP(r + add*2+1) & 0xf8) << 8) |
1345 + ((CLAMP(g + add ) & 0xfc) << 3) |
1346 + ((CLAMP(b + add*2+1) ) >> 3);
1347 + *picp++ = i;
1348 + add ^= 3;
1349 + }
1350 + }
1351 + }
1352 +}
1353 +
1354 +static int splash_check_jpeg(unsigned char *jpeg, int width, int height, int depth)
1355 +{
1356 + int size, err;
1357 + unsigned char *mem;
1358 +
1359 + size = ((width + 15) & ~15) * ((height + 15) & ~15) * (depth >> 3);
1360 + mem = vmalloc(size);
1361 + if (!mem) {
1362 + printk(KERN_INFO "No memory for decoded picture!\n");
1363 + return -1;
1364 + }
1365 + if (!decdata)
1366 + decdata = vmalloc(sizeof(*decdata));
1367 + if ((err = jpeg_decode(jpeg, mem, ((width + 15) & ~15), ((height + 15) & ~15), depth, decdata)))
1368 + printk(KERN_INFO "error %d while decompressing picture.\n",err);
1369 + vfree(mem);
1370 + return err ? -1 : 0;
1371 +}
1372 +
1373 +static void splash_free(struct display * p)
1374 +{
1375 + if (!p->splash_data)
1376 + return;
1377 + if (p->splash_data->oldscreen_base)
1378 + p->screen_base = p->splash_data->oldscreen_base;
1379 + if (p->splash_data->olddispsw)
1380 + p->dispsw = p->splash_data->olddispsw;
1381 + if (p->splash_data->splash_silentjpeg)
1382 + vfree(p->splash_data->splash_sboxes);
1383 + vfree(p->splash_data);
1384 + p->splash_data = 0;
1385 +}
1386 +
1387 +static int splash_mkpenguin(struct splash_data *data, int pxo, int pyo, int pwi, int phe, int pr, int pg, int pb)
1388 +{
1389 + unsigned char *buf;
1390 + int i;
1391 +
1392 + if (pwi ==0 || phe == 0)
1393 + return 0;
1394 + buf = (unsigned char *)data + sizeof(*data);
1395 + pwi += pxo - 1;
1396 + phe += pyo - 1;
1397 + *buf++ = pxo;
1398 + *buf++ = pxo >> 8;
1399 + *buf++ = pyo;
1400 + *buf++ = pyo >> 8;
1401 + *buf++ = pwi;
1402 + *buf++ = pwi >> 8;
1403 + *buf++ = phe;
1404 + *buf++ = phe >> 8;
1405 + *buf++ = pr;
1406 + *buf++ = pg;
1407 + *buf++ = pb;
1408 + *buf++ = 0;
1409 + for (i = 0; i < 12; i++, buf++)
1410 + *buf = buf[-12];
1411 + buf[-24] ^= 0xff;
1412 + buf[-23] ^= 0xff;
1413 + buf[-1] = 0xff;
1414 + return 2;
1415 +}
1416 +
1417 +int splash_getraw(unsigned char *start, unsigned char *end)
1418 +{
1419 + unsigned char *ndata;
1420 + int found = 0;
1421 + int splash_size = 0;
1422 + void *splash_start = 0;
1423 + int unit = 0;
1424 + int width = 0, height = 0;
1425 + int silentsize;
1426 + int boxcount = 0;
1427 + int sboxcount = 0;
1428 + int palcnt = 0;
1429 + struct display *p;
1430 +
1431 + printk(KERN_INFO "Looking for splash picture...");
1432 +
1433 + p = &fb_display[0];
1434 + silentsize = 0;
1435 +
1436 + for (ndata = start; ndata < end; ndata++) {
1437 + if (*((unsigned int *)ndata) != *((unsigned int *)signature))
1438 + continue;
1439 + if (*((unsigned int *)(ndata+4))==*((unsigned int *)(signature+4))) {
1440 + printk(".");
1441 + unit = 0;
1442 + p = &fb_display[0];
1443 + width = p->var.xres;
1444 + height = p->var.yres;
1445 +
1446 + splash_size = ndata[16] + (ndata[17] << 8) + (ndata[18] << 16) + (ndata[19] << 24);
1447 + if (ndata + 20 + splash_size > end) {
1448 + printk(" found, but truncated!\n");
1449 + return -1;
1450 + }
1451 + if (!jpeg_check_size(ndata + 20, width, height)) {
1452 + ndata += 20 - 1 + splash_size;
1453 + continue;
1454 + }
1455 + if (splash_check_jpeg(ndata + 20, width, height, p->var.bits_per_pixel))
1456 + return -1;
1457 + if (p->splash_data)
1458 + splash_free(p);
1459 + p->splash_data = vmalloc(sizeof(*p->splash_data) + splash_size + 24);
1460 + if (!p->splash_data)
1461 + break;
1462 +
1463 + p->splash_data->oldscreen_base = 0;
1464 + p->splash_data->olddispsw = 0;
1465 + p->splash_data->splash_silentjpeg = 0;
1466 +
1467 + p->splash_data->splash_text_xo = ndata[ 8] + (ndata[ 9] << 8);
1468 + p->splash_data->splash_text_yo = ndata[10] + (ndata[11] << 8);
1469 + p->splash_data->splash_text_wi = ndata[12] + (ndata[13] << 8);
1470 + p->splash_data->splash_text_he = ndata[14] + (ndata[15] << 8);
1471 + /* use 8x16 font... */
1472 + p->splash_data->splash_text_xo *= 8;
1473 + p->splash_data->splash_text_wi *= 8;
1474 + p->splash_data->splash_text_yo *= 16;
1475 + p->splash_data->splash_text_he *= 16;
1476 + p->splash_data->splash_color = (splash_default >> 8) & 0x0f;
1477 + p->splash_data->splash_fg_color = (splash_default >> 4) & 0x0f;
1478 + p->splash_data->splash_state = splash_default & 1;
1479 + p->splash_data->splash_percent = 0;
1480 + p->splash_data->splash_overpaintok = 0;
1481 + boxcount = splash_mkpenguin(p->splash_data, p->splash_data->splash_text_xo + 10, p->splash_data->splash_text_yo + 10, p->splash_data->splash_text_wi - 20, p->splash_data->splash_text_he - 20, 0xf0, 0xf0, 0xf0);
1482 + splash_start = ndata + 20;
1483 + found = 1;
1484 + break;
1485 + }
1486 + if (*((unsigned int *)(ndata + 4)) == *((unsigned int *)(signature+8))) {
1487 + printk(".");
1488 + unit = ndata[8];
1489 + if (unit >= MAX_NR_CONSOLES)
1490 + continue;
1491 + if (unit)
1492 + vc_allocate(unit);
1493 + p = &fb_display[unit];
1494 + width = fb_display[unit].var.xres;
1495 + height = fb_display[unit].var.yres;
1496 + splash_size = ndata[12] + (ndata[13] << 8) + (ndata[14] << 16) + (ndata[15] << 24);
1497 + if (splash_size == -1) {
1498 + printk(" found, updating values.\n");
1499 + if (p->splash_data) {
1500 + if (ndata[9] != 255)
1501 + p->splash_data->splash_state = ndata[9];
1502 + if (ndata[10] != 255)
1503 + p->splash_data->splash_fg_color = ndata[10];
1504 + if (ndata[11] != 255)
1505 + p->splash_data->splash_color = ndata[11];
1506 + }
1507 + return unit;
1508 + }
1509 + if (splash_size == 0) {
1510 + printk(" found, freeing memory.\n");
1511 + if (p->splash_data)
1512 + splash_free(p);
1513 + return unit;
1514 + }
1515 + if (ndata + 35 + splash_size > end) {
1516 + printk(" found, but truncated!\n");
1517 + return -1;
1518 + }
1519 + if (!jpeg_check_size(ndata + 35, width, height)) {
1520 + ndata += 35 - 1 + splash_size;
1521 + continue;
1522 + }
1523 + if (splash_check_jpeg(ndata + 35, width, height, p->var.bits_per_pixel))
1524 + return -1;
1525 + if (p->splash_data)
1526 + splash_free(p);
1527 + p->splash_data = vmalloc(sizeof(*p->splash_data) + splash_size + 24);
1528 + if (!p->splash_data)
1529 + break;
1530 +
1531 + p->splash_data->oldscreen_base = 0;
1532 + p->splash_data->olddispsw = 0;
1533 + p->splash_data->splash_silentjpeg = 0;
1534 +
1535 + p->splash_data->splash_state = ndata[9];
1536 + p->splash_data->splash_fg_color = ndata[10];
1537 + p->splash_data->splash_color = ndata[11];
1538 + p->splash_data->splash_text_xo = ndata[16] + (ndata[17] << 8);
1539 + p->splash_data->splash_text_yo = ndata[18] + (ndata[19] << 8);
1540 + p->splash_data->splash_text_wi = ndata[20] + (ndata[21] << 8);
1541 + p->splash_data->splash_text_he = ndata[22] + (ndata[23] << 8);
1542 + p->splash_data->splash_percent = 0;
1543 + p->splash_data->splash_overpaintok = 0;
1544 + boxcount = splash_mkpenguin(p->splash_data, ndata[24] + (ndata[25] << 8), ndata[26] + (ndata[27] << 8), ndata[28] + (ndata[29] << 8), ndata[30] + (ndata[31] << 8), ndata[32], ndata[33], ndata[34]);
1545 + splash_start = ndata + 35;
1546 + found = 2;
1547 + break;
1548 + }
1549 + if (*((unsigned int *)(ndata + 4)) == *((unsigned int *)(signature+12))) {
1550 + printk(".");
1551 + unit = ndata[8];
1552 + if (unit >= MAX_NR_CONSOLES)
1553 + continue;
1554 + if (unit)
1555 + vc_allocate(unit);
1556 + p = &fb_display[unit];
1557 + width = p->var.xres;
1558 + height = p->var.yres;
1559 + splash_size = ndata[12] + (ndata[13] << 8) + (ndata[14] << 16) + (ndata[15] << 24);
1560 + if (splash_size == -1) {
1561 + printk(" found, updating values.\n");
1562 + if (p->splash_data) {
1563 + if (ndata[9] != 255)
1564 + p->splash_data->splash_state = ndata[9];
1565 + if (ndata[10] != 255)
1566 + p->splash_data->splash_fg_color = ndata[10];
1567 + if (ndata[11] != 255)
1568 + p->splash_data->splash_color = ndata[11];
1569 + }
1570 + return unit;
1571 + }
1572 + if (splash_size == 0) {
1573 + printk(" found, freeing memory.\n");
1574 + if (p->splash_data)
1575 + splash_free(p);
1576 + return unit;
1577 + }
1578 + boxcount = ndata[24] + (ndata[25] << 8);
1579 + palcnt = ndata[37] * 3;
1580 + if (ndata + 38 + splash_size > end) {
1581 + printk(" found, but truncated!\n");
1582 + return -1;
1583 + }
1584 + if (!jpeg_check_size(ndata + 38 + boxcount * 12 + palcnt, width, height)) {
1585 + ndata += 38 - 1 + splash_size;
1586 + continue;
1587 + }
1588 + if (splash_check_jpeg(ndata + 38 + boxcount * 12 + palcnt, width, height, p->var.bits_per_pixel))
1589 + return -1;
1590 + silentsize = ndata[28] + (ndata[29] << 8) + (ndata[30] << 16) + (ndata[31] << 24);
1591 + if (silentsize)
1592 + printk(" silenjpeg size %d bytes,", silentsize);
1593 + if (silentsize >= splash_size) {
1594 + printk(" bigger than splashsize!\n");
1595 + return -1;
1596 + }
1597 + splash_size -= silentsize;
1598 + if (!splash_usesilent || !p->fb_info->fbops->fb_get_fix ) {
1599 + silentsize = 0;
1600 + } else {
1601 + struct fb_fix_screeninfo fix;
1602 + p->fb_info->fbops->fb_get_fix(&fix, unit, 0);
1603 + if (height * 2 * p->next_line > fix.smem_len) {
1604 + printk(" does not fit into framebuffer.\n");
1605 + silentsize = 0;
1606 + }
1607 + }
1608 +
1609 + sboxcount = ndata[32] + (ndata[33] << 8);
1610 + if (silentsize) {
1611 + char *simage=ndata + 38 + splash_size + 12 * sboxcount;
1612 + if (!jpeg_check_size(simage, width, height) ||
1613 + splash_check_jpeg(simage, width, height, p->var.bits_per_pixel)) {
1614 + printk(" error in silent jpeg.\n");
1615 + silentsize = 0;
1616 + }
1617 + }
1618 + if (p->splash_data)
1619 + splash_free(p);
1620 + p->splash_data = vmalloc(sizeof(*p->splash_data) + splash_size);
1621 + if (!p->splash_data)
1622 + break;
1623 + p->splash_data->oldscreen_base = 0;
1624 + p->splash_data->olddispsw = 0;
1625 + p->splash_data->splash_silentjpeg = 0;
1626 + if (silentsize) {
1627 + p->splash_data->splash_silentjpeg = vmalloc(silentsize);
1628 + if (p->splash_data->splash_silentjpeg) {
1629 + memcpy(p->splash_data->splash_silentjpeg, ndata + 38 + splash_size, silentsize);
1630 + p->splash_data->splash_sboxes = p->splash_data->splash_silentjpeg;
1631 + p->splash_data->splash_silentjpeg += 12 * sboxcount;
1632 + p->splash_data->splash_sboxcount = sboxcount;
1633 + }
1634 + }
1635 + p->splash_data->splash_state = ndata[9];
1636 + p->splash_data->splash_fg_color = ndata[10];
1637 + p->splash_data->splash_color = ndata[11];
1638 + p->splash_data->splash_overpaintok = ndata[36];
1639 + p->splash_data->splash_text_xo = ndata[16] + (ndata[17] << 8);
1640 + p->splash_data->splash_text_yo = ndata[18] + (ndata[19] << 8);
1641 + p->splash_data->splash_text_wi = ndata[20] + (ndata[21] << 8);
1642 + p->splash_data->splash_text_he = ndata[22] + (ndata[23] << 8);
1643 + p->splash_data->splash_percent = ndata[34] + (ndata[35] << 8);
1644 + p->splash_data->splash_percent += p->splash_data->splash_percent > 32767;
1645 + splash_start = ndata + 38;
1646 + found = 3;
1647 + break;
1648 + }
1649 + }
1650 +
1651 + if (!found) {
1652 + printk(" no good signature found.\n");
1653 + return -1;
1654 + }
1655 + if (p->splash_data->splash_text_xo + p->splash_data->splash_text_wi > width || p->splash_data->splash_text_yo + p->splash_data->splash_text_he > height) {
1656 + splash_free(p);
1657 + p->splash_data = 0;
1658 + printk(" found, but has oversized text area!\n");
1659 + return -1;
1660 + }
1661 + if (p->dispsw->setup != fbcon_cfb16.setup) {
1662 + splash_free(p);
1663 + p->splash_data = 0;
1664 + printk(" found, but framebuffer can't handle it!\n");
1665 + return -1;
1666 + }
1667 + printk(" found (%dx%d, %d bytes, v%d).\n", width, height, splash_size, found);
1668 +
1669 + if (found==1) {
1670 + printk(KERN_WARNING "bootsplash: Using deprecated v1 header. Updating your splash utility recommended.\n");
1671 + printk(KERN_INFO "bootsplash: Find the latest version at ftp.suse.com/pub/people/stepan/bootsplash/\n");
1672 + }
1673 +
1674 + /* copy data so that initrd memory can be freed. */
1675 + memcpy((char *)p->splash_data + sizeof(*p->splash_data) + (found < 3 ? boxcount * 12 : 0), splash_start, splash_size);
1676 + p->splash_data->splash_boxcount = boxcount;
1677 + p->splash_data->splash_boxes = (unsigned char *)p->splash_data + sizeof(*p->splash_data);
1678 + p->splash_data->splash_jpeg = (unsigned char *)p->splash_data + sizeof(*p->splash_data) + boxcount * 12 + palcnt;
1679 + p->splash_data->splash_palette = (unsigned char *)p->splash_data + sizeof(*p->splash_data) + boxcount * 12;
1680 + p->splash_data->splash_palcnt = palcnt / 3;
1681 + p->splash_data->splash_dosilent = p->splash_data->splash_silentjpeg != 0;
1682 + return unit;
1683 +}
1684 +
1685 +int splash_verbose(void)
1686 +{
1687 + struct display *p;
1688 +
1689 + p = &fb_display[0];
1690 + if (!p || !p->splash_data || !p->splash_data->splash_state || !p->conp)
1691 + return 0;
1692 + if (fg_console != p->conp->vc_num)
1693 + return 0;
1694 + if (!p->splash_data->splash_silentjpeg || !p->splash_data->splash_dosilent)
1695 + return 0;
1696 + if (!p->splash_data->oldscreen_base)
1697 + return 0;
1698 +
1699 + p->splash_data->splash_dosilent = 0;
1700 +
1701 + splashfill(p->splash_data->oldscreen_base, p->screen_base, p->var.xres, p->var.yres, p->next_line, p->next_line);
1702 + p->screen_base = p->splash_data->oldscreen_base;
1703 +
1704 + return 1;
1705 +}
1706 +
1707 +static void splash_off(struct display *p)
1708 +{
1709 + if (p->splash_data && p->splash_data->oldscreen_base)
1710 + p->screen_base = p->splash_data->oldscreen_base;
1711 + if (p->splash_data && p->splash_data->olddispsw)
1712 + p->dispsw = p->splash_data->olddispsw;
1713 + splash_shown = 0;
1714 +}
1715 +
1716 +int splash_prepare(struct display *p)
1717 +{
1718 + int err;
1719 + int width, height, depth, size, sbytes;
1720 +
1721 + if (!p->splash_data || !p->splash_data->splash_state) {
1722 + if (linux_splash)
1723 + vfree(linux_splash);
1724 + if (decdata)
1725 + vfree(decdata);
1726 + linux_splash = 0;
1727 + decdata = 0;
1728 + linux_splash_size = 0;
1729 + splash_off(p);
1730 + return -1;
1731 + }
1732 +
1733 + width = p->var.xres;
1734 + height = p->var.yres;
1735 + depth = p->var.bits_per_pixel;
1736 + if (depth != 16) { /* Other targets might need fixing */
1737 + splash_off(p);
1738 + return -2;
1739 + }
1740 +
1741 + sbytes = ((width + 15) & ~15) * (depth >> 3);
1742 + size = sbytes * ((height + 15) & ~15);
1743 + if (size != linux_splash_size) {
1744 + if (linux_splash)
1745 + vfree(linux_splash);
1746 + linux_splash_size = 0;
1747 + linux_splash = 0;
1748 + splash_off(p);
1749 + }
1750 + if (!linux_splash)
1751 + linux_splash = vmalloc(size);
1752 +
1753 + if (!linux_splash) {
1754 + linux_splash_size = 0;
1755 + printk(KERN_INFO "Not enough memory for splash screen.\n");
1756 + splash_off(p);
1757 + return -3;
1758 + }
1759 +
1760 + if (!decdata)
1761 + decdata = vmalloc(sizeof(*decdata));
1762 +
1763 + if (!p->splash_data->oldscreen_base)
1764 + p->splash_data->oldscreen_base = p->screen_base;
1765 +
1766 + if (p->splash_data->splash_silentjpeg && p->splash_data->splash_dosilent) {
1767 + printk(KERN_INFO "Got silent jpeg.\n");
1768 + /* fill area after framebuffer with other jpeg */
1769 + if ((err = jpeg_decode(p->splash_data->splash_silentjpeg, linux_splash,
1770 + ((width + 15) & ~15), ((height + 15) & ~15), depth, decdata))) {
1771 + printk(KERN_INFO "Error %d while decompressing silent jpeg.\n", err);
1772 + p->screen_base = p->splash_data->oldscreen_base;
1773 + p->splash_data->splash_dosilent = 0;
1774 + } else {
1775 + if (p->splash_data->splash_sboxcount)
1776 + boxit(linux_splash, sbytes, p->splash_data->splash_sboxes,
1777 + p->splash_data->splash_sboxcount, p->splash_data->splash_percent, 0);
1778 +
1779 + splashfill(p->screen_base, linux_splash, p->var.xres, p->var.yres, p->next_line, sbytes);
1780 + p->screen_base = p->splash_data->oldscreen_base + p->next_line * p->var.yres;
1781 + }
1782 + } else
1783 + p->screen_base = p->splash_data->oldscreen_base;
1784 +
1785 + if ((err = jpeg_decode(p->splash_data->splash_jpeg, linux_splash,
1786 + ((width + 15) & ~15), ((height + 15) & ~15), depth, decdata))) {
1787 + printk(KERN_INFO "Error %d while decompressing splash screen.\n", err);
1788 + vfree(linux_splash);
1789 + linux_splash = 0;
1790 + linux_splash_size = 0;
1791 + splash_off(p);
1792 + return -4;
1793 + }
1794 + linux_splash_size = size;
1795 + splash_bytes = sbytes;
1796 + if (p->splash_data->splash_boxcount)
1797 + boxit(linux_splash, sbytes, p->splash_data->splash_boxes, p->splash_data->splash_boxcount, p->splash_data->splash_percent, 0);
1798 + splash_data = *p->splash_data;
1799 + splash_shown = p->splash_data->splash_state;
1800 + if (splash_shown) {
1801 + if (p->dispsw != &fbcon_splash16)
1802 + p->splash_data->olddispsw = p->dispsw;
1803 + p->dispsw = &fbcon_splash16;
1804 + } else
1805 + splash_off(p);
1806 + return 0;
1807 +}
1808 +
1809 +
1810 +#ifdef CONFIG_PROC_FS
1811 +#include <linux/proc_fs.h>
1812 +
1813 +struct proc_dir_entry *proc_splash;
1814 +int splash_read_proc(char *buffer, char **start, off_t offset, int size,
1815 + int *eof, void *data);
1816 +int splash_write_proc(struct file *file, const char *buffer,
1817 + unsigned long count, void *data);
1818 +
1819 +int splash_read_proc(char *buffer, char **start, off_t offset, int size,
1820 + int *eof, void *data)
1821 +{
1822 + int len = 0;
1823 +
1824 + off_t begin = 0;
1825 + struct display *p = &fb_display[0];
1826 +
1827 + int color = p->splash_data ? p->splash_data->splash_color << 4 |
1828 + p->splash_data->splash_fg_color : splash_default >> 4;
1829 + int status = p->splash_data ? p->splash_data->splash_state & 1 : 0;
1830 + len += sprintf(buffer + len, "Splash screen v%s (0x%02x, %dx%d%s): %s\n",
1831 + SPLASH_VERSION, color, p->var.xres, p->var.yres,
1832 + (p->splash_data ? p->splash_data->splash_dosilent : 0)? ", silent" : "",
1833 + status ? "on" : "off");
1834 + if (offset >= begin + len)
1835 + return 0;
1836 +
1837 + *start = buffer + (begin - offset);
1838 +
1839 + return (size < begin + len - offset ? size : begin + len - offset);
1840 +}
1841 +
1842 +static int splash_recolor(struct display *p)
1843 +{
1844 + if (!p->splash_data)
1845 + return -1;
1846 + if (!p->splash_data->splash_state)
1847 + return 0;
1848 + con_remap_def_color(p->conp->vc_num, p->splash_data->splash_color << 4 | p->splash_data->splash_fg_color);
1849 + if (fg_console == p->conp->vc_num) {
1850 + splash_data = *p->splash_data;
1851 + update_region(fg_console,
1852 + p->conp->vc_origin +
1853 + p->conp->vc_size_row *
1854 + p->conp->vc_top,
1855 + p->conp->vc_size_row *
1856 + (p->conp->vc_bottom -
1857 + p->conp->vc_top) / 2);
1858 + }
1859 + return 0;
1860 +}
1861 +
1862 +static int splash_status(struct display *p)
1863 +{
1864 + printk(KERN_INFO "Splash status on console %d changed to %s\n", p->conp->vc_num, p->splash_data && p->splash_data->splash_state ? "on" : "off");
1865 +
1866 + if (fg_console == p->conp->vc_num)
1867 + splash_prepare(p);
1868 + if (p->splash_data && p->splash_data->splash_state) {
1869 + con_remap_def_color(p->conp->vc_num, p->splash_data->splash_color << 4 | p->splash_data->splash_fg_color);
1870 + /* resize_con also calls con_switch which resets yscroll */
1871 + vc_resize_con(p->splash_data->splash_text_he / fontheight(p),
1872 + p->splash_data->splash_text_wi / fontwidth(p),
1873 + p->conp->vc_num);
1874 + if (fg_console == p->conp->vc_num) {
1875 + update_region(fg_console,
1876 + p->conp->vc_origin +
1877 + p->conp->vc_size_row *
1878 + p->conp->vc_top,
1879 + p->conp->vc_size_row *
1880 + (p->conp->vc_bottom -
1881 + p->conp->vc_top) / 2);
1882 + fbcon_splash16.clear_margins(p->conp, p, 0);
1883 + }
1884 + } else {
1885 + /* Switch bootsplash off */
1886 + con_remap_def_color(p->conp->vc_num, 0x07);
1887 + vc_resize_con(p->var.yres / fontheight(p),
1888 + p->var.xres / fontwidth(p),
1889 + p->conp->vc_num);
1890 + }
1891 + return 0;
1892 +}
1893 +
1894 +int splash_write_proc(struct file *file, const char *buffer,
1895 + unsigned long count, void *data)
1896 +{
1897 + int new, unit;
1898 + struct display *p;
1899 +
1900 + if (!buffer || !splash_default)
1901 + return count;
1902 +
1903 + if (!strncmp(buffer, "show", 4) || !strncmp(buffer, "hide", 4)) {
1904 + int pe;
1905 +
1906 + p = &fb_display[0];
1907 + if (buffer[4] == ' ' && buffer[5] == 'p')
1908 + pe = 0;
1909 + else if (buffer[4] == '\n')
1910 + pe = 65535;
1911 + else
1912 + pe = simple_strtoul(buffer + 5, NULL, 0);
1913 + if (pe < 0)
1914 + pe = 0;
1915 + if (pe > 65535)
1916 + pe = 65535;
1917 + if (*buffer == 'h')
1918 + pe = 65535 - pe;
1919 + pe += pe > 32767;
1920 + if (p->splash_data && p->splash_data->splash_percent != pe) {
1921 + p->splash_data->splash_percent = pe;
1922 + if (fg_console != p->conp->vc_num || !p->splash_data->splash_state)
1923 + return count;
1924 + if (!p->splash_data->splash_overpaintok || p->splash_data->splash_percent == 65536) {
1925 + if (splash_hasinter(p->splash_data->splash_boxes, p->splash_data->splash_boxcount))
1926 + splash_status(p);
1927 + else
1928 + splash_prepare(p);
1929 + } else {
1930 + if (p->splash_data->splash_silentjpeg && p->splash_data->splash_dosilent && p->splash_data->oldscreen_base)
1931 + boxit(p->splash_data->oldscreen_base, p->next_line, p->splash_data->splash_sboxes, p->splash_data->splash_sboxcount, p->splash_data->splash_percent, 1);
1932 + boxit(p->screen_base, p->next_line, p->splash_data->splash_boxes, p->splash_data->splash_boxcount, p->splash_data->splash_percent, 1);
1933 + }
1934 + }
1935 + return count;
1936 + }
1937 + if (!strncmp(buffer,"silent\n",7) || !strncmp(buffer,"verbose\n",8)) {
1938 + p = &fb_display[0];
1939 + if (p->splash_data && p->splash_data->splash_silentjpeg) {
1940 + if (p->splash_data->splash_dosilent != (buffer[0] == 's')) {
1941 + p->splash_data->splash_dosilent = buffer[0] == 's';
1942 + splash_status(p);
1943 + }
1944 + }
1945 + return count;
1946 + }
1947 + if (!strncmp(buffer,"freesilent\n",11)) {
1948 + p = &fb_display[0];
1949 + if (p->splash_data && p->splash_data->splash_silentjpeg) {
1950 + printk(KERN_INFO "bootsplash: freeing silent jpeg\n");
1951 + p->splash_data->splash_silentjpeg = 0;
1952 + vfree(p->splash_data->splash_sboxes);
1953 + p->splash_data->splash_sboxes = 0;
1954 + p->splash_data->splash_sboxcount = 0;
1955 + if (p->splash_data->splash_dosilent)
1956 + splash_status(p);
1957 + p->splash_data->splash_dosilent = 0;
1958 + }
1959 + return count;
1960 + }
1961 +
1962 + if (!strncmp(buffer, signature, 7)) {
1963 + unit = splash_getraw((unsigned char *)buffer, (unsigned char *)buffer + count);
1964 + if (unit >= 0) {
1965 + p = &fb_display[unit];
1966 + splash_status(p);
1967 + }
1968 + return count;
1969 + }
1970 + p = &fb_display[0];
1971 + if (!p->splash_data)
1972 + return count;
1973 + if (buffer[0] == 't') {
1974 + p->splash_data->splash_state ^= 1;
1975 + splash_status(p);
1976 + return count;
1977 + }
1978 + new = simple_strtoul(buffer, NULL, 0);
1979 + if (new > 1) {
1980 + /* expert user */
1981 + p->splash_data->splash_color = new >> 8 & 0xff;
1982 + p->splash_data->splash_fg_color = new >> 4 & 0x0f;
1983 + }
1984 + if ((new & 1) == p->splash_data->splash_state)
1985 + splash_recolor(p);
1986 + else {
1987 + p->splash_data->splash_state = new & 1;
1988 + splash_status(p);
1989 + }
1990 + return count;
1991 +}
1992 +
1993 +int splash_proc_register(void)
1994 +{
1995 + if ((proc_splash = create_proc_entry("splash", 0, 0))) {
1996 + proc_splash->read_proc = splash_read_proc;
1997 + proc_splash->write_proc = splash_write_proc;
1998 + return 0;
1999 + }
2000 + return 1;
2001 +}
2002 +
2003 +int splash_proc_unregister(void)
2004 +{
2005 + if (proc_splash)
2006 + remove_proc_entry("splash", 0);
2007 + return 0;
2008 +}
2009 +#endif
2010 diff -ruN linux-2.4.31/drivers/video/fbcon-splash.h linux-2.4.31-bs/drivers/video/fbcon-splash.h
2011 --- linux-2.4.31/drivers/video/fbcon-splash.h 1970-01-01 01:00:00.000000000 +0100
2012 +++ linux-2.4.31-bs/drivers/video/fbcon-splash.h 2005-05-06 11:25:18.000000000 +0100
2013 @@ -0,0 +1,18 @@
2014 +/*
2015 + * linux/drivers/video/splash.h - splash screen definition.
2016 + *
2017 + * (w) 2001-2003 by Volker Poplawski, <volker@suse.de>
2018 + * Stefan Reinauer, <stepan@suse.de>
2019 + *
2020 + *
2021 + * idea and SuSE screen work by Ken Wimer, <wimer@suse.de>
2022 + */
2023 +
2024 +extern int splash_getraw(unsigned char *, unsigned char *);
2025 +extern int splash_prepare(struct display *);
2026 +
2027 +extern int splash_shown; /* is splash shown? */
2028 +extern struct splash_data splash_data; /* image data, copied over
2029 + from display */
2030 +extern unsigned char *linux_splash; /* decoded pic data */
2031 +extern int splash_bytes; /* bytes per line */
2032 diff -ruN linux-2.4.31/drivers/video/fbcon-splash16.c linux-2.4.31-bs/drivers/video/fbcon-splash16.c
2033 --- linux-2.4.31/drivers/video/fbcon-splash16.c 1970-01-01 01:00:00.000000000 +0100
2034 +++ linux-2.4.31-bs/drivers/video/fbcon-splash16.c 2005-05-06 11:24:19.000000000 +0100
2035 @@ -0,0 +1,488 @@
2036 +/*
2037 + * linux/drivers/video/fbcon-splash16.c -- Low level frame buffer operations for 16 bpp
2038 + * framebuffer operation. Modified to present
2039 + * boot splash screen. 2002/11/7 stepan@suse.de
2040 + *
2041 + * Based on linux/drivers/video/fbcon-cfb16.c, which is
2042 + *
2043 + * Created 5 Apr 1997 by Geert Uytterhoeven
2044 + *
2045 + * This file is subject to the terms and conditions of the GNU General Public
2046 + * License. See the file COPYING in the main directory of this archive for
2047 + * more details.
2048 + */
2049 +
2050 +#include <linux/module.h>
2051 +#include <linux/config.h>
2052 +#include <linux/tty.h>
2053 +#include <linux/console.h>
2054 +#include <linux/string.h>
2055 +#include <linux/fb.h>
2056 +#include <asm/io.h>
2057 +
2058 +#include <video/fbcon.h>
2059 +#include <video/fbcon-cfb16.h>
2060 +
2061 +#include "fbcon-splash.h"
2062 +
2063 + /*
2064 + * 16 bpp packed pixels
2065 + */
2066 +
2067 +static u32 tab_cfb16[] = {
2068 +#if defined(__BIG_ENDIAN)
2069 + 0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
2070 +#elif defined(__LITTLE_ENDIAN)
2071 + 0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
2072 +#else
2073 +#error FIXME: No endianness??
2074 +#endif
2075 +};
2076 +
2077 +void fbcon_splash16_bmove(struct display *p, int sy, int sx, int dy, int dx,
2078 + int height, int width)
2079 +{
2080 + int bytes = p->next_line, linesize = bytes * fontheight(p), rows;
2081 + u8 *src, *dst;
2082 +
2083 + if (sx == 0 && dx == 0 && width * fontwidth(p) * 2 == bytes) {
2084 + fb_memmove(p->screen_base + dy * linesize,
2085 + p->screen_base + sy * linesize,
2086 + height * linesize);
2087 + return;
2088 + }
2089 + if (fontwidthlog(p)) {
2090 + sx <<= fontwidthlog(p)+1;
2091 + dx <<= fontwidthlog(p)+1;
2092 + width <<= fontwidthlog(p)+1;
2093 + } else {
2094 + sx *= fontwidth(p)*2;
2095 + dx *= fontwidth(p)*2;
2096 + width *= fontwidth(p)*2;
2097 + }
2098 + sx += splash_data.splash_text_xo*2 + splash_data.splash_text_yo * bytes;
2099 + dx += splash_data.splash_text_xo*2 + splash_data.splash_text_yo * bytes;
2100 + if (dy < sy || (dy == sy && dx < sx)) {
2101 + src = p->screen_base + sy * linesize + sx;
2102 + dst = p->screen_base + dy * linesize + dx;
2103 + for (rows = height * fontheight(p); rows--;) {
2104 + fb_memmove(dst, src, width);
2105 + src += bytes;
2106 + dst += bytes;
2107 + }
2108 + } else {
2109 + src = p->screen_base + (sy+height) * linesize + sx - bytes;
2110 + dst = p->screen_base + (dy+height) * linesize + dx - bytes;
2111 + for (rows = height * fontheight(p); rows--;) {
2112 + fb_memmove(dst, src, width);
2113 + src -= bytes;
2114 + dst -= bytes;
2115 + }
2116 + }
2117 +}
2118 +
2119 +static inline void rectfill(u8 *dest, int width, int height, u32 data,
2120 + int linesize)
2121 +{
2122 + int i;
2123 +
2124 + data |= data<<16;
2125 +
2126 + while (height-- > 0) {
2127 + u32 *p = (u32 *)dest;
2128 + for (i = 0; i < width/4; i++) {
2129 + fb_writel(data, p++);
2130 + fb_writel(data, p++);
2131 + }
2132 + if (width & 2)
2133 + fb_writel(data, p++);
2134 + if (width & 1)
2135 + fb_writew(data, (u16*)p);
2136 + dest += linesize;
2137 + }
2138 +}
2139 +
2140 +void splashfill(u8 *dest, u8 *src, int width, int height,
2141 + int dest_linesize, int src_linesize)
2142 +{
2143 +
2144 + int i;
2145 +
2146 + while (height-- > 0) {
2147 + u32 *p = (u32 *)dest;
2148 + u32 *q = (u32 *)src;
2149 +
2150 + for (i=0; i < width/4; i++) {
2151 + fb_writel(*q++,p++);
2152 + fb_writel(*q++,p++);
2153 + }
2154 + if (width & 2)
2155 + fb_writel(*q++,p++);
2156 + if (width & 1)
2157 + fb_writew(*(u16*)q,(u16*)p);
2158 + dest += dest_linesize;
2159 + src += src_linesize;
2160 + }
2161 +}
2162 +
2163 +void fbcon_splash16_clear(struct vc_data *conp, struct display *p, int sy, int sx,
2164 + int height, int width)
2165 +{
2166 + u8 *dest;
2167 + int bytes = p->next_line, lines = height * fontheight(p);
2168 + u32 bgx;
2169 + int offset, transparent=0;
2170 +
2171 + dest = p->screen_base + sy * fontheight(p) * bytes + sx * fontwidth(p) * 2;
2172 +
2173 + bgx = ((u16 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
2174 +
2175 + width *= fontwidth(p)/4;
2176 +
2177 + dest += splash_data.splash_text_yo * bytes +
2178 + splash_data.splash_text_xo * 2;
2179 +
2180 + transparent = (splash_data.splash_color == attr_bgcol_ec(p, conp));
2181 +
2182 + if (transparent) {
2183 + offset = (sy * fontheight(p) + splash_data.splash_text_yo) * splash_bytes +
2184 + (sx * fontwidth(p) + splash_data.splash_text_xo) * 2;
2185 +
2186 + if ((width * 8 == bytes && splash_bytes == bytes))
2187 + splashfill(dest,linux_splash + offset, lines * width * 4,
2188 + 1, bytes, splash_bytes);
2189 + else
2190 + splashfill(dest,linux_splash + offset, width*4, lines,
2191 + bytes, splash_bytes);
2192 + } else {
2193 + if (width * 8 == bytes)
2194 + rectfill(dest, lines * width * 4, 1, bgx, bytes);
2195 + else
2196 + rectfill(dest, width * 4, lines, bgx, bytes);
2197 + }
2198 +}
2199 +
2200 +
2201 +/*
2202 + * Helper function to read the background from the splashscreen
2203 + */
2204 +# define SPLASH_BGX(off) \
2205 + if (transparent) { \
2206 + bgx = *(u32*)(splashbgx + (off)); \
2207 + eorx = fgx ^ bgx; \
2208 + }
2209 +
2210 +
2211 +void fbcon_splash16_putc(struct vc_data *conp, struct display *p, int c, int yy,
2212 + int xx)
2213 +{
2214 + u8 *dest, *cdat, bits;
2215 + int bytes = p->next_line, rows;
2216 + u32 eorx, fgx, bgx;
2217 + int transparent = 0;
2218 + u8 *splashbgx = 0;
2219 +
2220 + dest = p->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 2;
2221 +
2222 + fgx = ((u16 *)p->dispsw_data)[attr_fgcol(p, c)];
2223 + bgx = ((u16 *)p->dispsw_data)[attr_bgcol(p, c)];
2224 +
2225 + transparent = (splash_data.splash_color == attr_bgcol(p, c));
2226 +
2227 + dest += splash_data.splash_text_xo * 2 + splash_data.splash_text_yo * bytes;
2228 + splashbgx = linux_splash +
2229 + (yy * fontheight(p) + splash_data.splash_text_yo) * splash_bytes +
2230 + (xx * fontwidth(p) + splash_data.splash_text_xo) * 2;
2231 +
2232 + if (transparent && splash_data.splash_color == 0xf) {
2233 + if (fgx == 0xffea)
2234 + fgx = 0xfe4a;
2235 + else if (fgx == 0x57ea)
2236 + fgx = 0x0540;
2237 + else if (fgx == 0xffff)
2238 + fgx = 0x52aa;
2239 + }
2240 +
2241 + fgx |= (fgx << 16);
2242 + bgx |= (bgx << 16);
2243 + eorx = fgx ^ bgx;
2244 +
2245 + switch (fontwidth(p)) {
2246 + case 4:
2247 + case 8:
2248 + cdat = p->fontdata + (c & p->charmask) * fontheight(p);
2249 + for (rows = fontheight(p); rows--; dest += bytes) {
2250 + bits = *cdat++;
2251 + SPLASH_BGX(0);
2252 + fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
2253 + SPLASH_BGX(4);
2254 + fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
2255 + if (fontwidth(p) == 8) {
2256 + SPLASH_BGX(8);
2257 + fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
2258 + SPLASH_BGX(12);
2259 + fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
2260 + }
2261 +
2262 + splashbgx += splash_bytes;
2263 +
2264 + }
2265 + break;
2266 + case 12:
2267 + case 16:
2268 + cdat = p->fontdata + ((c & p->charmask) * fontheight(p) << 1);
2269 + for (rows = fontheight(p); rows--; dest += bytes) {
2270 + bits = *cdat++;
2271 + SPLASH_BGX(0);
2272 + fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
2273 + SPLASH_BGX(4);
2274 + fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
2275 + SPLASH_BGX(8);
2276 + fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
2277 + SPLASH_BGX(12);
2278 + fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
2279 + bits = *cdat++;
2280 + SPLASH_BGX(16);
2281 + fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest+16);
2282 + SPLASH_BGX(20);
2283 + fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+20);
2284 + if (fontwidth(p) == 16) {
2285 + SPLASH_BGX(24);
2286 + fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+24);
2287 + SPLASH_BGX(28);
2288 + fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+28);
2289 + }
2290 + }
2291 + break;
2292 + }
2293 +}
2294 +
2295 +void fbcon_splash16_putcs(struct vc_data *conp, struct display *p,
2296 + const unsigned short *s, int count, int yy, int xx)
2297 +{
2298 + u8 *cdat, *dest, *dest0;
2299 + u16 c;
2300 + int rows, bytes = p->next_line;
2301 + u32 eorx, fgx, bgx;
2302 + int transparent = 0;
2303 + u8 *splashbgx0 = 0, *splashbgx;
2304 +
2305 + dest0 = p->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p) * 2;
2306 + c = scr_readw(s);
2307 + fgx = ((u16 *)p->dispsw_data)[attr_fgcol(p, c)];
2308 + bgx = ((u16 *)p->dispsw_data)[attr_bgcol(p, c)];
2309 +
2310 + transparent = (splash_data.splash_color == attr_bgcol(p, c));
2311 +
2312 + dest0 += splash_data.splash_text_xo * 2 + splash_data.splash_text_yo * bytes;
2313 + splashbgx0 = linux_splash +
2314 + (yy * fontheight(p) + splash_data.splash_text_yo) * splash_bytes +
2315 + (xx * fontwidth(p) + splash_data.splash_text_xo) * 2;
2316 +
2317 + if (transparent && splash_data.splash_color == 0xf) {
2318 + if (fgx == 0xffea)
2319 + fgx = 0xfe4a;
2320 + else if (fgx == 0x57ea)
2321 + fgx = 0x0540;
2322 + else if (fgx == 0xffff)
2323 + fgx = 0x52aa;
2324 + }
2325 +
2326 + fgx |= (fgx << 16);
2327 + bgx |= (bgx << 16);
2328 + eorx = fgx ^ bgx;
2329 +
2330 + switch (fontwidth(p)) {
2331 + case 4:
2332 + case 8:
2333 + while (count--) {
2334 + c = scr_readw(s++) & p->charmask;
2335 + cdat = p->fontdata + c * fontheight(p);
2336 +
2337 + splashbgx = splashbgx0;
2338 +
2339 + for (rows = fontheight(p), dest = dest0; rows--; dest += bytes) {
2340 + u8 bits = *cdat++;
2341 + SPLASH_BGX(0);
2342 + fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
2343 + SPLASH_BGX(4);
2344 + fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
2345 + if (fontwidth(p) == 8) {
2346 + SPLASH_BGX(8);
2347 + fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
2348 + SPLASH_BGX(12);
2349 + fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
2350 + }
2351 + splashbgx += splash_bytes;
2352 + }
2353 +
2354 + dest0 += fontwidth(p)*2;
2355 + splashbgx0 += fontwidth(p) * 2;
2356 + }
2357 +
2358 + break;
2359 + case 12:
2360 + case 16:
2361 + while (count--) {
2362 + c = scr_readw(s++) & p->charmask;
2363 + cdat = p->fontdata + (c * fontheight(p) << 1);
2364 +
2365 + splashbgx = splashbgx0;
2366 +
2367 + for (rows = fontheight(p), dest = dest0; rows--; dest += bytes) {
2368 + u8 bits = *cdat++;
2369 + SPLASH_BGX(0);
2370 + fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest);
2371 + SPLASH_BGX(4);
2372 + fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+4);
2373 + SPLASH_BGX(8);
2374 + fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+8);
2375 + SPLASH_BGX(12);
2376 + fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+12);
2377 + bits = *cdat++;
2378 + SPLASH_BGX(16);
2379 + fb_writel((tab_cfb16[bits >> 6] & eorx) ^ bgx, dest+16);
2380 + SPLASH_BGX(20);
2381 + fb_writel((tab_cfb16[bits >> 4 & 3] & eorx) ^ bgx, dest+20);
2382 + if (fontwidth(p) == 16) {
2383 + SPLASH_BGX(24);
2384 + fb_writel((tab_cfb16[bits >> 2 & 3] & eorx) ^ bgx, dest+24);
2385 + SPLASH_BGX(28);
2386 + fb_writel((tab_cfb16[bits & 3] & eorx) ^ bgx, dest+28);
2387 + }
2388 + splashbgx += splash_bytes;
2389 + }
2390 +
2391 + dest0 += fontwidth(p)*2;
2392 + splashbgx0 += fontwidth(p) * 2;
2393 + }
2394 +
2395 + break;
2396 + }
2397 +}
2398 +
2399 +void fbcon_splash16_revc(struct display *p, int xx, int yy)
2400 +{
2401 + u8 *dest;
2402 + int bytes = p->next_line, rows;
2403 +
2404 + dest = p->screen_base + yy * fontheight(p) * bytes + xx * fontwidth(p)*2;
2405 + dest += splash_data.splash_text_yo * bytes + splash_data.splash_text_xo * 2;
2406 +
2407 + for (rows = fontheight(p); rows--; dest += bytes) {
2408 + switch (fontwidth(p)) {
2409 + case 16:
2410 + fb_writel(fb_readl(dest+24) ^ 0xffffffff, dest+24);
2411 + fb_writel(fb_readl(dest+28) ^ 0xffffffff, dest+28);
2412 + /* FALL THROUGH */
2413 + case 12:
2414 + fb_writel(fb_readl(dest+16) ^ 0xffffffff, dest+16);
2415 + fb_writel(fb_readl(dest+20) ^ 0xffffffff, dest+20);
2416 + /* FALL THROUGH */
2417 + case 8:
2418 + fb_writel(fb_readl(dest+8) ^ 0xffffffff, dest+8);
2419 + fb_writel(fb_readl(dest+12) ^ 0xffffffff, dest+12);
2420 + /* FALL THROUGH */
2421 + case 4:
2422 + fb_writel(fb_readl(dest+0) ^ 0xffffffff, dest+0);
2423 + fb_writel(fb_readl(dest+4) ^ 0xffffffff, dest+4);
2424 + }
2425 + }
2426 +}
2427 +
2428 +void fbcon_splash16_clear_margins(struct vc_data *conp, struct display *p,
2429 + int bottom_only)
2430 +{
2431 + int bytes = p->next_line;
2432 + u32 bgx;
2433 +
2434 + unsigned int right_start = conp->vc_cols*fontwidth(p);
2435 + unsigned int bottom_start = conp->vc_rows*fontheight(p);
2436 + unsigned int right_width, bottom_width;
2437 +
2438 + int left_margin_width = splash_data.splash_text_xo;
2439 + int text_width = conp->vc_cols * fontwidth(p);
2440 + int right_margin_width = p->var.xres - text_width - left_margin_width;
2441 + int top_margin_height = splash_data.splash_text_yo;
2442 + int text_height = conp->vc_rows * fontheight(p);
2443 + int bottom_margin_height = p->var.yres - text_height - top_margin_height;
2444 +
2445 + bgx = ((u16 *)p->dispsw_data)[attr_bgcol_ec(p, conp)];
2446 +
2447 + if (bottom_only == -1) {
2448 + printk(KERN_DEBUG "Called with bottom-only\n");
2449 + splashfill(p->screen_base, linux_splash, p->var.xres, p->var.yres, bytes, splash_bytes);
2450 + return;
2451 + }
2452 +
2453 + if (!bottom_only && (right_width = p->var.xres-right_start)) {
2454 + /* left margin */
2455 + splashfill(p->screen_base + top_margin_height * bytes,
2456 + linux_splash + top_margin_height *
2457 + splash_bytes, left_margin_width,
2458 + text_height, bytes, splash_bytes);
2459 +
2460 + /* right margin */
2461 + splashfill(p->screen_base + left_margin_width*2 + text_width*2 +
2462 + top_margin_height * bytes, linux_splash +
2463 + left_margin_width*2 + text_width*2 + top_margin_height *
2464 + splash_bytes, right_margin_width, text_height,
2465 + bytes, splash_bytes);
2466 + }
2467 +
2468 + if ((bottom_width = p->var.yres-bottom_start))
2469 + /* bottom margin */
2470 + splashfill(p->screen_base + (top_margin_height + text_height) *
2471 + bytes, linux_splash + (top_margin_height +
2472 + text_height) * splash_bytes, p->var.xres,
2473 + bottom_margin_height, bytes, splash_bytes);
2474 +
2475 + /* top margin */
2476 + splashfill(p->screen_base, linux_splash,
2477 + p->var.xres, top_margin_height,
2478 + bytes, splash_bytes);
2479 +
2480 + /* leave function if work is done */
2481 + return;
2482 +}
2483 +
2484 +
2485 + /*
2486 + * `switch' for the low level operations
2487 + */
2488 +
2489 +struct display_switch fbcon_splash16 = {
2490 + bmove: fbcon_splash16_bmove,
2491 + clear: fbcon_splash16_clear,
2492 + putc: fbcon_splash16_putc,
2493 + putcs: fbcon_splash16_putcs,
2494 + revc: fbcon_splash16_revc,
2495 + clear_margins: fbcon_splash16_clear_margins,
2496 + fontwidthmask: FONTWIDTH(4)|FONTWIDTH(8)|FONTWIDTH(12)|FONTWIDTH(16)
2497 +};
2498 +
2499 +
2500 +#ifdef MODULE
2501 +MODULE_LICENSE("GPL");
2502 +
2503 +int init_module(void)
2504 +{
2505 + return 0;
2506 +}
2507 +
2508 +void cleanup_module(void)
2509 +{}
2510 +#endif /* MODULE */
2511 +
2512 +
2513 + /*
2514 + * Visible symbols for modules
2515 + */
2516 +
2517 +EXPORT_SYMBOL(fbcon_splash16);
2518 +EXPORT_SYMBOL(fbcon_splash16_bmove);
2519 +EXPORT_SYMBOL(fbcon_splash16_clear);
2520 +EXPORT_SYMBOL(fbcon_splash16_putc);
2521 +EXPORT_SYMBOL(fbcon_splash16_putcs);
2522 +EXPORT_SYMBOL(fbcon_splash16_revc);
2523 +EXPORT_SYMBOL(fbcon_splash16_clear_margins);
2524 diff -ruN linux-2.4.31/drivers/video/fbcon.c linux-2.4.31-bs/drivers/video/fbcon.c
2525 --- linux-2.4.31/drivers/video/fbcon.c 2004-11-17 11:54:21.000000000 +0000
2526 +++ linux-2.4.31-bs/drivers/video/fbcon.c 2005-05-06 11:21:29.000000000 +0100
2527 @@ -76,6 +76,7 @@
2528 #include <linux/smp.h>
2529 #include <linux/init.h>
2530 #include <linux/pm.h>
2531 +#include <linux/vmalloc.h>
2532
2533 #include <asm/irq.h>
2534 #include <asm/system.h>
2535 @@ -104,6 +105,23 @@
2536 #include <video/fbcon-mac.h> /* for 6x11 font on mac */
2537 #include <video/font.h>
2538
2539 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2540 +#include <video/fbcon-cfb16.h> /* for fbcon_cfb16 */
2541 +#include "fbcon-splash.h"
2542 +
2543 +extern void con_remap_def_color(int currcons, int new_color);
2544 +
2545 +extern int splash_default;
2546 +extern int splash_shown;
2547 +
2548 +extern struct display_switch fbcon_splash16;
2549 +
2550 +#ifdef CONFIG_PROC_FS
2551 +int splash_proc_register(void);
2552 +int splash_proc_unregister(void);
2553 +#endif
2554 +#endif
2555 +
2556 #ifdef FBCONDEBUG
2557 # define DPRINTK(fmt, args...) printk(KERN_DEBUG "%s: " fmt, __FUNCTION__ , ## args)
2558 #else
2559 @@ -478,6 +496,10 @@
2560 }
2561
2562
2563 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2564 +static int splash_registered=0;
2565 +#endif
2566 +
2567 static void fbcon_init(struct vc_data *conp, int init)
2568 {
2569 int unit = conp->vc_num;
2570 @@ -501,6 +523,26 @@
2571 fb_display[unit].cmap.green = 0;
2572 fb_display[unit].cmap.blue = 0;
2573 fb_display[unit].cmap.transp = 0;
2574 +
2575 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2576 + if (!splash_registered && fb_display[unit].var.bits_per_pixel == 16 ) {
2577 + if (unit == 0 && !fb_display[unit].splash_data) {
2578 + extern unsigned long initrd_start, initrd_end;
2579 +
2580 + if (initrd_start && !splash_getraw((unsigned char *)initrd_start, (unsigned char *)initrd_end) && fb_display[unit].splash_data)
2581 + fb_display[unit].splash_data->splash_state = splash_default & 1;
2582 + }
2583 + splash_registered = 1;
2584 +#ifdef CONFIG_PROC_FS
2585 + splash_proc_register();
2586 +#endif
2587 + }
2588 + if (fb_display[unit].splash_data && fb_display[unit].var.bits_per_pixel != 16 ) {
2589 + vfree(fb_display[unit].splash_data);
2590 + fb_display[unit].splash_data = 0;
2591 + }
2592 +#endif
2593 +
2594 fbcon_setup(unit, init, !init);
2595 /* Must be done after fbcon_setup to prevent excess updates */
2596 conp->vc_display_fg = &info->display_fg;
2597 @@ -517,6 +559,15 @@
2598 fbcon_free_font(p);
2599 p->dispsw = &fbcon_dummy;
2600 p->conp = 0;
2601 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2602 + if (splash_registered) {
2603 +#ifdef CONFIG_PROC_FS
2604 + splash_proc_unregister();
2605 +#endif
2606 + splash_registered = 0;
2607 + }
2608 +#endif
2609 +
2610 }
2611
2612
2613 @@ -658,6 +709,14 @@
2614 nr_cols = p->var.xres/fontwidth(p);
2615 nr_rows = p->var.yres/fontheight(p);
2616
2617 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2618 + if (p->splash_data && p->splash_data->splash_state) {
2619 + nr_cols = p->splash_data->splash_text_wi / fontwidth(p);
2620 + nr_rows = p->splash_data->splash_text_he / fontheight(p);
2621 + logo = 0;
2622 + }
2623 +#endif
2624 +
2625 if (logo) {
2626 /* Need to make room for the logo */
2627 int cnt, step, erase_char;
2628 @@ -735,6 +794,12 @@
2629 p->fgcol = p->var.bits_per_pixel > 2 ? 7 : (1<<p->var.bits_per_pixel)-1;
2630 p->bgcol = 0;
2631
2632 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2633 + if(p->splash_data && p->splash_data->splash_state)
2634 + con_remap_def_color(con, p->splash_data->splash_color << 4 | p->splash_data->splash_fg_color);
2635 +#endif
2636 +
2637 +
2638 if (!init) {
2639 if (conp->vc_cols != nr_cols || conp->vc_rows != nr_rows)
2640 vc_resize_con(nr_rows, nr_cols, con);
2641 @@ -1324,6 +1389,9 @@
2642 if (softback_top)
2643 fbcon_softback_note(conp, t, count);
2644 if (logo_shown >= 0) goto redraw_up;
2645 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2646 + if (splash_shown) goto redraw_up;
2647 +#endif
2648 switch (p->scrollmode & __SCROLL_YMASK) {
2649 case __SCROLL_YMOVE:
2650 p->dispsw->bmove(p, t+count, 0, t, 0, b-t-count,
2651 @@ -1384,6 +1452,9 @@
2652 case SM_DOWN:
2653 if (count > conp->vc_rows) /* Maximum realistic size */
2654 count = conp->vc_rows;
2655 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2656 + if (splash_shown) goto redraw_down;
2657 +#endif
2658 switch (p->scrollmode & __SCROLL_YMASK) {
2659 case __SCROLL_YMOVE:
2660 p->dispsw->bmove(p, t, 0, t+count, 0, b-t-count,
2661 @@ -1500,6 +1571,13 @@
2662 }
2663 return;
2664 }
2665 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2666 + if (splash_shown && sy == dy) {
2667 + /* must use slower redraw bmove to keep background pic intact */
2668 + fbcon_redraw_bmove(p, real_y(p, sy), sx, real_y(p, dy), dx, height, width);
2669 + return;
2670 + }
2671 +#endif
2672 p->dispsw->bmove(p, real_y(p, sy), sx, real_y(p, dy), dx, height, width);
2673 }
2674
2675 @@ -1510,6 +1588,10 @@
2676 struct display *p = &fb_display[unit];
2677 struct fb_info *info = p->fb_info;
2678
2679 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2680 + splash_prepare(p);
2681 +#endif
2682 +
2683 if (softback_top) {
2684 int l = fbcon_softback_size / conp->vc_size_row;
2685 if (softback_lines)
2686 @@ -1570,13 +1652,40 @@
2687 struct display *p = &fb_display[conp->vc_num];
2688 struct fb_info *info = p->fb_info;
2689
2690 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2691 + struct display_switch *olddispsw=NULL;
2692 + char *oldscreen_base=NULL;
2693 +#endif
2694 +
2695 if (blank < 0) /* Entering graphics mode */
2696 return 0;
2697
2698 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2699 +
2700 + if (p->splash_data && p->splash_data->oldscreen_base) {
2701 + oldscreen_base = p->screen_base;
2702 + p->screen_base = p->splash_data->oldscreen_base;
2703 + }
2704 + if (p->splash_data && p->splash_data->olddispsw) {
2705 + olddispsw = p->dispsw;
2706 + p->dispsw = p->splash_data->olddispsw;
2707 + }
2708 +#endif
2709 +
2710 fbcon_cursor(p->conp, blank ? CM_ERASE : CM_DRAW);
2711
2712 if (!p->can_soft_blank) {
2713 if (blank) {
2714 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2715 + if (p->splash_data && p->splash_data->oldscreen_base) {
2716 + oldscreen_base = p->screen_base;
2717 + p->screen_base = p->splash_data->oldscreen_base;
2718 + }
2719 + if (p->splash_data && p->splash_data->olddispsw) {
2720 + olddispsw = p->dispsw;
2721 + p->dispsw = p->splash_data->olddispsw;
2722 + }
2723 +#endif
2724 if (p->visual == FB_VISUAL_MONO01) {
2725 if (p->screen_base)
2726 fb_memset255(p->screen_base,
2727 @@ -1584,20 +1693,33 @@
2728 p->var.bits_per_pixel>>3);
2729 } else {
2730 unsigned short oldc;
2731 - u_int height;
2732 + u_int height, width;
2733 u_int y_break;
2734
2735 oldc = conp->vc_video_erase_char;
2736 conp->vc_video_erase_char &= p->charmask;
2737 height = conp->vc_rows;
2738 + width = conp->vc_cols;
2739 y_break = p->vrows-p->yscroll;
2740 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2741 + if (splash_shown) {
2742 + width=p->var.xres/fontwidth(p);
2743 + height=p->var.yres/fontheight(p);
2744 + }
2745 +#endif
2746 if (height > y_break) {
2747 - p->dispsw->clear(conp, p, real_y(p, 0), 0, y_break, conp->vc_cols);
2748 - p->dispsw->clear(conp, p, real_y(p, y_break), 0, height-y_break, conp->vc_cols);
2749 + p->dispsw->clear(conp, p, real_y(p, 0), 0, y_break, width);
2750 + p->dispsw->clear(conp, p, real_y(p, y_break), 0, height-y_break, width);
2751 } else
2752 - p->dispsw->clear(conp, p, real_y(p, 0), 0, height, conp->vc_cols);
2753 + p->dispsw->clear(conp, p, real_y(p, 0), 0, height, width);
2754 conp->vc_video_erase_char = oldc;
2755 }
2756 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2757 + if(oldscreen_base)
2758 + p->screen_base=oldscreen_base;
2759 + if(olddispsw)
2760 + p->dispsw=olddispsw;
2761 +#endif
2762 return 0;
2763 } else {
2764 /* Tell console.c that it has to restore the screen itself */
2765 @@ -1763,13 +1885,21 @@
2766
2767 if (resize) {
2768 struct vc_data *conp = p->conp;
2769 + __u32 xres = p->var.xres, yres = p->var.yres;
2770 +
2771 /* reset wrap/pan */
2772 p->var.xoffset = p->var.yoffset = p->yscroll = 0;
2773 p->vrows = p->var.yres_virtual/h;
2774 - if ((p->var.yres % h) && (p->var.yres_virtual % h < p->var.yres % h))
2775 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2776 + if (p->splash_data && p->splash_data->splash_state) {
2777 + xres = p->splash_data->splash_text_wi;
2778 + yres = p->splash_data->splash_text_he;
2779 + }
2780 +#endif
2781 + if ((yres % h) && (p->var.yres_virtual % h < p->var.yres % h))
2782 p->vrows--;
2783 updatescrollmode(p);
2784 - vc_resize_con( p->var.yres/h, p->var.xres/w, unit );
2785 + vc_resize_con( yres/h, xres/w, unit );
2786 if (CON_IS_VISIBLE(conp) && softback_buf) {
2787 int l = fbcon_softback_size / conp->vc_size_row;
2788 if (l > 5)
2789 @@ -2193,6 +2323,9 @@
2790 if (p->fb_info->fbops->fb_rasterimg)
2791 p->fb_info->fbops->fb_rasterimg(p->fb_info, 1);
2792
2793 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2794 + if (!splash_shown) {
2795 +#endif
2796 for (x = 0; x < smp_num_cpus * (LOGO_W + 8) &&
2797 x < p->var.xres - (LOGO_W + 8); x += (LOGO_W + 8)) {
2798
2799 @@ -2454,7 +2587,9 @@
2800 }
2801 #endif
2802 }
2803 -
2804 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2805 + }
2806 +#endif
2807 if (p->fb_info->fbops->fb_rasterimg)
2808 p->fb_info->fbops->fb_rasterimg(p->fb_info, 0);
2809
2810 diff -ruN linux-2.4.31/include/video/fbcon.h linux-2.4.31-bs/include/video/fbcon.h
2811 --- linux-2.4.31/include/video/fbcon.h 2003-08-25 12:44:44.000000000 +0100
2812 +++ linux-2.4.31-bs/include/video/fbcon.h 2005-05-18 11:02:36.000000000 +0100
2813 @@ -42,6 +42,35 @@
2814 unsigned int fontwidthmask; /* 1 at (1 << (width - 1)) if width is supported */
2815 };
2816
2817 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2818 +struct splash_data {
2819 + int splash_state; /* show splash? */
2820 + int splash_color; /* transparent color */
2821 + int splash_fg_color; /* foreground color */
2822 + int splash_width; /* width of image */
2823 + int splash_height; /* height of image */
2824 + int splash_text_xo; /* text area origin */
2825 + int splash_text_yo;
2826 + int splash_text_wi; /* text area size */
2827 + int splash_text_he;
2828 + int splash_showtext; /* silent/verbose mode */
2829 + int splash_boxcount;
2830 + int splash_percent;
2831 + int splash_overpaintok; /* is it ok to overpaint boxes */
2832 + int splash_palcnt;
2833 + struct display_switch *olddispsw; /* old dispsw, normally &fbcon_cfb16*/
2834 + char *oldscreen_base; /* pointer to top of virtual screen */
2835 + unsigned char *splash_boxes;
2836 + unsigned char *splash_jpeg; /* jpeg */
2837 + unsigned char *splash_palette; /* palette for 8-bit */
2838 +
2839 + int splash_dosilent; /* show silent jpeg */
2840 + unsigned char *splash_silentjpeg;
2841 + unsigned char *splash_sboxes;
2842 + int splash_sboxcount;
2843 +};
2844 +#endif
2845 +
2846 extern struct display_switch fbcon_dummy;
2847
2848 /*
2849 @@ -95,6 +124,11 @@
2850 short yscroll; /* Hardware scrolling */
2851 unsigned char fgshift, bgshift;
2852 unsigned short charmask; /* 0xff or 0x1ff */
2853 +
2854 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2855 + struct splash_data *splash_data;
2856 +#endif
2857 +
2858 };
2859
2860 /* drivers/video/fbcon.c */
2861 diff -ruN linux-2.4.31/kernel/panic.c linux-2.4.31-bs/kernel/panic.c
2862 --- linux-2.4.31/kernel/panic.c 2004-11-17 11:54:22.000000000 +0000
2863 +++ linux-2.4.31-bs/kernel/panic.c 2005-05-18 11:08:01.000000000 +0100
2864 @@ -83,6 +83,13 @@
2865 * We can't use the "normal" timers since we just panicked..
2866 */
2867 printk(KERN_EMERG "Rebooting in %d seconds..",panic_timeout);
2868 +
2869 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2870 + {
2871 + extern int splash_verbose(void);
2872 + (void)splash_verbose();
2873 + }
2874 +#endif
2875 mdelay(panic_timeout*1000);
2876 /*
2877 * Should we run the reboot notifier. For the moment Im
2878 @@ -103,6 +110,12 @@
2879 disabled_wait(caller);
2880 #endif
2881 sti();
2882 +#ifdef CONFIG_FBCON_SPLASHSCREEN
2883 + {
2884 + extern int splash_verbose(void);
2885 + (void)splash_verbose();
2886 + }
2887 +#endif
2888 for(;;) {
2889 #if defined(CONFIG_X86) && defined(CONFIG_VT)
2890 extern void panic_blink(void);