1 From 19c80ae416f42991c764501ff2283b0294fd6b5b Mon Sep 17 00:00:00 2001
2 From: David Herrmann <dh.herrmann@googlemail.com>
3 Date: Sat, 16 Jun 2012 22:44:09 +0200
4 Subject: [PATCH 01/10] fblog: new framebuffer kernel log dummy driver
6 Fblog displays all kernel log messages on all connected framebuffers. It
7 replaces fbcon when CONFIG_VT=n is selected. Its main purpose is to debug
8 boot problems by displaying the whole boot log on the screen. This patch
9 provides the first dummy module-init/deinit functions.
11 As is uses all the font and fb functions I placed it in
12 drivers/video/console. However, this means that we need to move the check
13 for CONFIG_VT in Makefile/Kconfig from drivers/video into
14 drivers/video/console as fblog does not depend on CONFIG_VT.
16 Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
18 drivers/video/Kconfig | 5 +---
19 drivers/video/Makefile | 2 +-
20 drivers/video/console/Kconfig | 37 +++++++++++++++++++++------
21 drivers/video/console/Makefile | 1 +
22 drivers/video/console/fblog.c | 55 ++++++++++++++++++++++++++++++++++++++++
23 5 files changed, 87 insertions(+), 13 deletions(-)
24 create mode 100644 drivers/video/console/fblog.c
26 diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig
27 index 0217f74..e8fd53d 100644
28 --- a/drivers/video/Kconfig
29 +++ b/drivers/video/Kconfig
30 @@ -2448,10 +2448,7 @@ source "drivers/video/omap/Kconfig"
31 source "drivers/video/omap2/Kconfig"
32 source "drivers/video/exynos/Kconfig"
33 source "drivers/video/backlight/Kconfig"
36 - source "drivers/video/console/Kconfig"
38 +source "drivers/video/console/Kconfig"
40 if FB || SGI_NEWPORT_CONSOLE
41 source "drivers/video/logo/Kconfig"
42 diff --git a/drivers/video/Makefile b/drivers/video/Makefile
43 index ee8dafb..9f8a7f0 100644
44 --- a/drivers/video/Makefile
45 +++ b/drivers/video/Makefile
46 @@ -11,7 +11,7 @@ fb-y := fbmem.o fbmon.o fbcmap.o fbsysfs.o \
50 -obj-$(CONFIG_VT) += console/
52 obj-$(CONFIG_LOGO) += logo/
55 diff --git a/drivers/video/console/Kconfig b/drivers/video/console/Kconfig
56 index c2d11fe..cfee482 100644
57 --- a/drivers/video/console/Kconfig
58 +++ b/drivers/video/console/Kconfig
59 @@ -6,7 +6,7 @@ menu "Console display driver support"
62 bool "VGA text console" if EXPERT || !X86
63 - depends on !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER)
64 + depends on VT && !4xx && !8xx && !SPARC && !M68K && !PARISC && !FRV && !SUPERH && !BLACKFIN && !AVR32 && !MN10300 && (!ARM || ARCH_FOOTBRIDGE || ARCH_INTEGRATOR || ARCH_NETWINDER)
67 Saying Y here will allow you to use Linux in text mode through a
68 @@ -45,7 +45,7 @@ config VGACON_SOFT_SCROLLBACK_SIZE
69 screenfuls of scrollback buffer
72 - depends on !M68K && !PARISC && ISA
73 + depends on VT && !M68K && !PARISC && ISA
74 tristate "MDA text console (dual-headed) (EXPERIMENTAL)"
76 Say Y here if you have an old MDA or monochrome Hercules graphics
77 @@ -61,14 +61,14 @@ config MDA_CONSOLE
79 config SGI_NEWPORT_CONSOLE
80 tristate "SGI Newport Console support"
82 + depends on VT && SGI_IP22
84 Say Y here if you want the console on the Newport aka XL graphics
85 card of your Indy. Most people say Y here.
89 - depends on VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y
90 + depends on VT && (VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y)
93 config DUMMY_CONSOLE_COLUMNS
94 @@ -89,7 +89,7 @@ config DUMMY_CONSOLE_ROWS
96 config FRAMEBUFFER_CONSOLE
97 tristate "Framebuffer Console support"
102 Low-level framebuffer-based console driver.
103 @@ -122,16 +122,37 @@ config FRAMEBUFFER_CONSOLE_ROTATION
106 bool "STI text console"
108 + depends on VT && PARISC
111 The STI console is the builtin display/keyboard on HP-PARISC
112 machines. Say Y here to build support for it into your kernel.
113 The alternative is to use your primary serial port as a console.
116 + tristate "Framebuffer Kernel Log Driver"
117 + depends on !VT && FB
120 + This driver displays all kernel log messages on all connected
121 + framebuffers. It is mutually exclusive with CONFIG_FRAMEBUFFER_CONSOLE
122 + and CONFIG_VT. It was mainly created for debugging purposes when
123 + CONFIG_VT is not selected but you still want kernel boot messages on
126 + This driver overwrites all other graphics output on the framebuffer as
127 + long as it is active so the kernel log will always be visible. You
128 + need to disable this driver via sysfs to be able to start another
129 + graphics application.
133 + To compile this driver as a module, choose M here: the module will
137 bool "Select compiled-in fonts"
138 - depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE
139 + depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE || FBLOG
141 Say Y here if you would like to use fonts other than the default
142 your frame buffer console usually use.
143 @@ -158,7 +179,7 @@ config FONT_8x8
146 bool "VGA 8x16 font" if FONTS
147 - depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE || STI_CONSOLE || USB_SISUSBVGA_CON
148 + depends on FRAMEBUFFER_CONSOLE || SGI_NEWPORT_CONSOLE || STI_CONSOLE || USB_SISUSBVGA_CON || FBLOG
149 default y if !SPARC && !FONTS
151 This is the "high resolution" font for the VGA frame buffer (the one
152 diff --git a/drivers/video/console/Makefile b/drivers/video/console/Makefile
153 index a862e91..f608c97 100644
154 --- a/drivers/video/console/Makefile
155 +++ b/drivers/video/console/Makefile
156 @@ -20,6 +20,7 @@ font-objs += $(font-objs-y)
158 # Each configuration option enables a list of files.
160 +obj-$(CONFIG_FBLOG) += fblog.o font.o
161 obj-$(CONFIG_DUMMY_CONSOLE) += dummycon.o
162 obj-$(CONFIG_SGI_NEWPORT_CONSOLE) += newport_con.o font.o
163 obj-$(CONFIG_STI_CONSOLE) += sticon.o sticore.o font.o
164 diff --git a/drivers/video/console/fblog.c b/drivers/video/console/fblog.c
166 index 0000000..ea83643
168 +++ b/drivers/video/console/fblog.c
171 + * Framebuffer Kernel Log Driver
172 + * Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
176 + * This program is free software; you can redistribute it and/or modify it
177 + * under the terms of the GNU General Public License as published by the Free
178 + * Software Foundation; either version 2 of the License, or (at your option)
179 + * any later version.
183 + * Framebuffer Kernel Log
184 + * This driver prints the kernel log to all connected display devices. It
185 + * replaces CONFIG_VT and cannot run simultaneously with it. It does not provide
186 + * any virtual-terminal, though. It should only be used to get kernel boot
187 + * messages to debug kernel errors.
188 + * Hence, this driver is neither optimized for speed, nor does it provide any
189 + * fancy features like colored text output. After booting is done, the init
190 + * process should set /sys/class/graphics/fblog/active to 0 which disables this
191 + * driver and you can start using the graphics devices. During shutdown, you can
192 + * set this to 1 to get log messages again.
193 + * This driver forcibly writes to the framebuffer while active, therefore, you
194 + * cannot run other graphics applications simultaneously.
196 + * fblog_redraw_line() is heavily based on the fbcon driver. See bitblit.c for
197 + * the original implementation copyrighted by:
198 + * Copyright (C) 2004 Antonino Daplas <adaplas@pol.net>
200 + * Please note that nearly all functions here must be called with console_lock
201 + * held. This way, we have no locking problems and do not need special
205 +#include <linux/atomic.h>
206 +#include <linux/console.h>
207 +#include <linux/fb.h>
208 +#include <linux/font.h>
209 +#include <linux/module.h>
211 +static int __init fblog_init(void)
216 +static void __exit fblog_exit(void)
220 +module_init(fblog_init);
221 +module_exit(fblog_exit);
222 +MODULE_LICENSE("GPL");
223 +MODULE_AUTHOR("David Herrmann <dh.herrmann@googlemail.com>");
224 +MODULE_DESCRIPTION("Framebuffer Kernel Log Driver");