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