Modify it to adjust Tizen IVI enviroment
[platform/upstream/kmscon.git] / fblog / 0001-fblog-new-framebuffer-kernel-log-dummy-driver.patch
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
5
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.
10
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.
15
16 Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
17 ---
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
25
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"
34 -
35 -if VT
36 -       source "drivers/video/console/Kconfig"
37 -endif
38 +source "drivers/video/console/Kconfig"
39  
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 \
47                                       modedb.o fbcvt.o
48  fb-objs                           := $(fb-y)
49  
50 -obj-$(CONFIG_VT)                 += console/
51 +obj-y                            += console/
52  obj-$(CONFIG_LOGO)               += logo/
53  obj-y                            += backlight/
54  
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"
60  
61  config VGA_CONSOLE
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)
65         default y
66         help
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
70  
71  config MDA_CONSOLE
72 -       depends on !M68K && !PARISC && ISA
73 +       depends on VT && !M68K && !PARISC && ISA
74         tristate "MDA text console (dual-headed) (EXPERIMENTAL)"
75         ---help---
76           Say Y here if you have an old MDA or monochrome Hercules graphics
77 @@ -61,14 +61,14 @@ config MDA_CONSOLE
78  
79  config SGI_NEWPORT_CONSOLE
80          tristate "SGI Newport Console support"
81 -        depends on SGI_IP22 
82 +        depends on VT && SGI_IP22
83          help
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.
86  
87  config DUMMY_CONSOLE
88         bool
89 -       depends on VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y 
90 +       depends on VT && (VGA_CONSOLE!=y || SGI_NEWPORT_CONSOLE!=y)
91         default y
92  
93  config DUMMY_CONSOLE_COLUMNS
94 @@ -89,7 +89,7 @@ config DUMMY_CONSOLE_ROWS
95  
96  config FRAMEBUFFER_CONSOLE
97         tristate "Framebuffer Console support"
98 -       depends on FB
99 +       depends on VT && FB
100         select CRC32
101         help
102           Low-level framebuffer-based console driver.
103 @@ -122,16 +122,37 @@ config FRAMEBUFFER_CONSOLE_ROTATION
104  
105  config STI_CONSOLE
106          bool "STI text console"
107 -        depends on PARISC
108 +        depends on VT && PARISC
109          default y
110          help
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.
114  
115 +config FBLOG
116 +       tristate "Framebuffer Kernel Log Driver"
117 +       depends on !VT && FB
118 +       default n
119 +       help
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
124 +         the screen.
125 +
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.
130 +
131 +         If unsure, say N.
132 +
133 +         To compile this driver as a module, choose M here: the module will
134 +         be called fblog.
135 +
136  config FONTS
137         bool "Select compiled-in fonts"
138 -       depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE
139 +       depends on FRAMEBUFFER_CONSOLE || STI_CONSOLE || FBLOG
140         help
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
144  
145  config FONT_8x16
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
150         help
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)
157  
158  # Each configuration option enables a list of files.
159  
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
165 new file mode 100644
166 index 0000000..ea83643
167 --- /dev/null
168 +++ b/drivers/video/console/fblog.c
169 @@ -0,0 +1,55 @@
170 +/*
171 + * Framebuffer Kernel Log Driver
172 + * Copyright (c) 2012 David Herrmann <dh.herrmann@googlemail.com>
173 + */
174 +
175 +/*
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.
180 + */
181 +
182 +/*
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.
195 + *
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>
199 + *
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
202 + * synchronization.
203 + */
204 +
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>
210 +
211 +static int __init fblog_init(void)
212 +{
213 +       return 0;
214 +}
215 +
216 +static void __exit fblog_exit(void)
217 +{
218 +}
219 +
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");
225 -- 
226 1.7.10.4
227