Messages in this thread Patch in this message | | | Date | Tue, 18 May 1999 18:17:17 +0100 | From | Daniel Silverstone <> | Subject | [framebuffer-generic] patch |
| |
Hi
I am learning about kernel hacking, and decided that i would like a fix to the kernel framebuffer code to allow me to have: 1. Any size logo (not just 80x80) 2. That logo centered on the screen if I so choose 3. Any logo I want
As such, 1 and 2 I have implemented as a set of patches to the kernel source, including a bit of cleanup in the framebuffer code.
It is a patch against 2.2.8 (but should work on most 2.2 kernels)
It basically does the following:
Moves some definitions out of drivers/video/fbcon.c into the include/asm-*/linux_logo.h files Adds support for CONFIG_FB_CENTER_LOGO to drivers/video/Config.in and fbcon.c
Whilst this in itself isn't much, it cleans up the code and makes it more flexible.
I am also working on a userland program to turn jpegs (initially) into asm-xxx/linux_logo.h and linux/linux_logo.h files for building different logos.
I would appreciate feedback on the patch - especially checking if it works with architectures other than i386
to apply the patch, do the following patch -p0 < nameofpatchfile in the /usr/src directory it patches the linux/* tree, so make sure that the symlink is set properly
Many thanks
Dan
diff -u --recursive --new-file linux-2.2.8.tree/linux/drivers/video/Config.in linux/drivers/video/Config.in --- linux-2.2.8.tree/linux/drivers/video/Config.in Wed Mar 17 17:17:22 1999 +++ linux/drivers/video/Config.in Tue May 18 13:07:28 1999 @@ -5,6 +5,7 @@ if [ "$CONFIG_FB" = "y" ]; then define_bool CONFIG_DUMMY_CONSOLE y if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then + bool 'Center logo at top of screen' CONFIG_FB_CENTER_LOGO if [ "$CONFIG_AMIGA" = "y" -o "$CONFIG_PCI" = "y" ]; then bool 'Permedia2 support (experimental)' CONFIG_FB_PM2 if [ "$CONFIG_FB_PM2" = "y" ]; then diff -u --recursive --new-file linux-2.2.8.tree/linux/drivers/video/fbcon.c linux/drivers/video/fbcon.c --- linux-2.2.8.tree/linux/drivers/video/fbcon.c Fri Apr 23 03:30:08 1999 +++ linux/drivers/video/fbcon.c Tue May 18 14:31:58 1999 @@ -30,6 +30,8 @@ * Jakub Jelinek (jj@ultra.linux.cz) * * Random hacking by Martin Mares <mj@ucw.cz> + * Logo placement, size & area cleaning added by Daniel Silverstone + * (D.Silverstone@ucl.ac.uk) * * * The low level operations for the various display memory organizations are @@ -104,10 +106,6 @@ # define DPRINTK(fmt, args...) #endif -#define LOGO_H 80 -#define LOGO_W 80 -#define LOGO_LINE (LOGO_W/8) - struct display fb_display[MAX_NR_CONSOLES]; static int logo_lines; static int logo_shown = -1; @@ -212,7 +210,7 @@ #ifdef CONFIG_MAC /* - * On the Macintoy, there may or may not be a working VBL int. We need to prob + * On the Macintoy, there may or may not be a working VBL int. We need to probe */ static int vbl_detected = 0; @@ -1361,6 +1359,7 @@ p->dispsw->clear_margins(conp, p, 0); if (logo_shown == -2) { logo_shown = fg_console; + fbcon_clear(conp, 0, 0, LOGO_H, p->var.xres); /* cleans logo area */ fbcon_show_logo(); /* This is protected above by initmem_freed */ update_region(fg_console, conp->vc_origin + conp->vc_size_row * conp->vc_top, @@ -1956,7 +1955,7 @@ unsigned char *fb = p->screen_base; unsigned char *logo; unsigned char *dst, *src; - int i, j, n, x1, y1, x; + int i, j, n, x1, y1, x, xOfs; int logo_depth, done = 0; /* Return if the frame buffer is not mapped */ @@ -2018,7 +2017,13 @@ if (p->fb_info->fbops->fb_rasterimg) p->fb_info->fbops->fb_rasterimg(p->fb_info, 1); - for (x = 0; x < smp_num_cpus * (LOGO_W + 8) && + xOfs = 0; + +#if defined(CONFIG_FB_CENTER_LOGO) + xOfs = (p->var.xres - (smp_num_cpus * (LOGO_W + 8)))/2; +#endif + + for (x = xOfs; (x-xOfs) < smp_num_cpus * (LOGO_W + 8) && x < p->var.xres - (LOGO_W + 8); x += (LOGO_W + 8)) { #if defined(CONFIG_FBCON_CFB16) || defined(CONFIG_FBCON_CFB24) || \ diff -u --recursive --new-file linux-2.2.8.tree/linux/include/asm-alpha/linux_logo.h linux/include/asm-alpha/linux_logo.h --- linux-2.2.8.tree/linux/include/asm-alpha/linux_logo.h Thu Oct 1 18:02:22 1998 +++ linux/include/asm-alpha/linux_logo.h Tue May 18 14:11:45 1999 @@ -25,6 +25,10 @@ #define LINUX_LOGO_COLORS 214 +#define LOGO_W 80 +#define LOGO_H 80 +#define LOGO_LINE (LOGO_W/8) + #ifdef INCLUDE_LINUX_LOGO_DATA #define INCLUDE_LINUX_LOGOBW diff -u --recursive --new-file linux-2.2.8.tree/linux/include/asm-arm/linux_logo.h linux/include/asm-arm/linux_logo.h --- linux-2.2.8.tree/linux/include/asm-arm/linux_logo.h Thu Dec 17 17:05:43 1998 +++ linux/include/asm-arm/linux_logo.h Tue May 18 14:11:36 1999 @@ -13,6 +13,10 @@ #define LINUX_LOGO_COLORS 214 +#define LOGO_W 80 +#define LOGO_H 80 +#define LOGO_LINE (LOGO_W/8) + #ifdef INCLUDE_LINUX_LOGO_DATA #define INCLUDE_LINUX_LOGOBW diff -u --recursive --new-file linux-2.2.8.tree/linux/include/asm-i386/linux_logo.h linux/include/asm-i386/linux_logo.h --- linux-2.2.8.tree/linux/include/asm-i386/linux_logo.h Tue May 11 18:35:44 1999 +++ linux/include/asm-i386/linux_logo.h Tue May 18 16:51:36 1999 @@ -25,6 +25,10 @@ #define LINUX_LOGO_COLORS 214 +#define LOGO_W 80 +#define LOGO_H 80 +#define LOGO_LINE (LOGO_W/8) + #ifdef INCLUDE_LINUX_LOGO_DATA #define INCLUDE_LINUX_LOGOBW diff -u --recursive --new-file linux-2.2.8.tree/linux/include/asm-m68k/linux_logo.h linux/include/asm-m68k/linux_logo.h --- linux-2.2.8.tree/linux/include/asm-m68k/linux_logo.h Mon Oct 5 21:54:39 1998 +++ linux/include/asm-m68k/linux_logo.h Tue May 18 14:11:25 1999 @@ -28,6 +28,10 @@ #define LINUX_LOGO_COLORS 95 +#define LOGO_W 80 +#define LOGO_H 80 +#define LOGO_LINE (LOGO_W/8) + #ifdef INCLUDE_LINUX_LOGO_DATA unsigned char linux_logo_red[] __initdata = { diff -u --recursive --new-file linux-2.2.8.tree/linux/include/asm-mips/linux_logo.h linux/include/asm-mips/linux_logo.h --- linux-2.2.8.tree/linux/include/asm-mips/linux_logo.h Wed Aug 5 00:06:57 1998 +++ linux/include/asm-mips/linux_logo.h Tue May 18 14:11:18 1999 @@ -25,6 +25,10 @@ #define LINUX_LOGO_COLORS 212 +#define LOGO_W 80 +#define LOGO_H 80 +#define LOGO_LINE (LOGO_W/8) + #ifdef INCLUDE_LINUX_LOGO_DATA unsigned char linux_logo_red[] __initdata = { diff -u --recursive --new-file linux-2.2.8.tree/linux/include/asm-ppc/linux_logo.h linux/include/asm-ppc/linux_logo.h --- linux-2.2.8.tree/linux/include/asm-ppc/linux_logo.h Wed Sep 30 18:14:33 1998 +++ linux/include/asm-ppc/linux_logo.h Tue May 18 14:11:06 1999 @@ -24,9 +24,9 @@ #define linux_logo_banner "Linux/PPC version " UTS_RELEASE -#define LINUX_LOGO_HEIGHT 80 -#define LINUX_LOGO_WIDTH 80 -#define LINUX_LOGO_COLORS 214 +#define LOGO_W 80 +#define LOGO_H 80 +#define LOGO_LINE (LOGO_W/8) #ifdef INCLUDE_LINUX_LOGO_DATA diff -u --recursive --new-file linux-2.2.8.tree/linux/include/asm-sparc/linux_logo.h linux/include/asm-sparc/linux_logo.h --- linux-2.2.8.tree/linux/include/asm-sparc/linux_logo.h Wed Sep 30 22:16:33 1998 +++ linux/include/asm-sparc/linux_logo.h Tue May 18 14:07:14 1999 @@ -25,6 +25,10 @@ #define LINUX_LOGO_COLORS 219 +#define LOGO_W 80 +#define LOGO_H 80 +#define LOGO_LINE (LOGO_W/8) + #ifdef INCLUDE_LINUX_LOGO_DATA unsigned char linux_logo_red[] __initdata = { diff -u --recursive --new-file linux-2.2.8.tree/linux/include/asm-sparc64/linux_logo.h linux/include/asm-sparc64/linux_logo.h --- linux-2.2.8.tree/linux/include/asm-sparc64/linux_logo.h Wed Aug 5 00:03:35 1998 +++ linux/include/asm-sparc64/linux_logo.h Tue May 18 14:07:21 1999 @@ -25,6 +25,10 @@ #define LINUX_LOGO_COLORS 219 +#define LOGO_W 80 +#define LOGO_H 80 +#define LOGO_LINE (LOGO_W/8) + #ifdef INCLUDE_LINUX_LOGO_DATA unsigned char linux_logo_red[] __initdata = { | |