diff options
author | Antonino A. Daplas <adaplas@gmail.com> | 2006-06-26 03:27:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-06-26 12:58:33 -0400 |
commit | 418d1ce61839251004fee6525f58a4581a75239e (patch) | |
tree | 53193cc45088997a7a233b2d6e9648ee59e1b3be /Documentation/fb | |
parent | e614b18dcedb247ce6f848e623cdf2336df2b476 (diff) |
[PATCH] VT binding: fbcon: Update documentation
Update Documentation/fb/fbcon.txt to reflect the following changes:
1. Simple illustration of the binding of the console down to individual
framebuffer drivers
2. Usage of userspace tools to help with recovery of text console
3. How to use the attributes in /sys/class/tty/console to unload fbcon and
the framebuffer drivers
Signed-off-by: Antonino Daplas <adaplas@pol.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'Documentation/fb')
-rw-r--r-- | Documentation/fb/fbcon.txt | 73 |
1 files changed, 50 insertions, 23 deletions
diff --git a/Documentation/fb/fbcon.txt b/Documentation/fb/fbcon.txt index f3a3be087707..b91aea57a98e 100644 --- a/Documentation/fb/fbcon.txt +++ b/Documentation/fb/fbcon.txt | |||
@@ -150,14 +150,42 @@ C. Boot options | |||
150 | 150 | ||
151 | C. Attaching, Detaching and Unloading | 151 | C. Attaching, Detaching and Unloading |
152 | 152 | ||
153 | It's possible to detach/attach the framebuffer console from the vt layer by | 153 | Before going on on how to attach, detach and unload the framebuffer console, an |
154 | echoing anything to the following sysfs attributes found | 154 | illustration of the dependencies may help. |
155 | /sys/class/graphics/fbcon. | ||
156 | 155 | ||
157 | attach - attach framebuffer console to vt layer | 156 | The console layer, as with most subsystems, needs a driver that interfaces with |
158 | detach - detach framebuffer console to vt layer | 157 | the hardware. Thus, in a VGA console: |
159 | 158 | ||
160 | If fbcon is detached from the vt layer, your boot console driver (which is | 159 | console ---> VGA driver ---> hardware. |
160 | |||
161 | Assuming the VGA driver can be unloaded, one must first unbind the VGA driver | ||
162 | from the console layer before unloading the driver. The VGA driver cannot be | ||
163 | unloaded if it is still bound to the console layer. (See | ||
164 | Documentation/console/console.txt for more information). | ||
165 | |||
166 | This is more complicated in the case of the the framebuffer console (fbcon), | ||
167 | because fbcon is an intermediate layer between the console and the drivers: | ||
168 | |||
169 | console ---> fbcon ---> fbdev drivers ---> hardware | ||
170 | |||
171 | The fbdev drivers cannot be unloaded if it's bound to fbcon, and fbcon cannot | ||
172 | be unloaded if it's bound to the console layer. | ||
173 | |||
174 | So to unload the fbdev drivers, one must first unbind fbcon from the console, | ||
175 | then unbind the fbdev drivers from fbcon. Fortunately, unbinding fbcon from | ||
176 | the console layer will automatically unbind framebuffer drivers from | ||
177 | fbcon. Thus, there is no need to explicitly unbind the fbdev drivers from | ||
178 | fbcon. | ||
179 | |||
180 | So, how do we unbind fbcon from the console? Part of the answer is in | ||
181 | Documentation/console/console.txt. To summarize: | ||
182 | |||
183 | Echo the ID number of the 'frame buffer driver' to: | ||
184 | |||
185 | sys/class/tty/console/bind - attach framebuffer console to console layer | ||
186 | sys/class/tty/console/unbind - detach framebuffer console from console layer | ||
187 | |||
188 | If fbcon is detached from the console layer, your boot console driver (which is | ||
161 | usually VGA text mode) will take over. A few drivers (rivafb and i810fb) will | 189 | usually VGA text mode) will take over. A few drivers (rivafb and i810fb) will |
162 | restore VGA text mode for you. With the rest, before detaching fbcon, you | 190 | restore VGA text mode for you. With the rest, before detaching fbcon, you |
163 | must take a few additional steps to make sure that your VGA text mode is | 191 | must take a few additional steps to make sure that your VGA text mode is |
@@ -183,27 +211,26 @@ restored properly. The following is one of the several methods that you can do: | |||
183 | 211 | ||
184 | 5. Now to detach fbcon: | 212 | 5. Now to detach fbcon: |
185 | 213 | ||
186 | vbetool vbestate restore < <vga state file> && \ | 214 | 'cat /sys/class/tty/console/backend' and take note of the ID |
187 | echo 1 > /sys/class/graphics/fbcon/detach | ||
188 | 215 | ||
189 | 6. That's it, you're back to VGA mode. And if you compiled your drivers as | 216 | The above is probably needed only once. Then: |
190 | modules, you can unload them at will. So if you want to change your driver | ||
191 | from xxxfb to yyyfb, you can do this: | ||
192 | 217 | ||
193 | detach fbcon | 218 | vbetool vbestate restore < <vga state file> && \ |
194 | rmmod xxxfb | 219 | echo <ID> > /sys/class/tty/console/unbind |
195 | modprobe yyyfb | ||
196 | 220 | ||
197 | Of course, con2fbmap can do the same thing but will not work if xxxfb | 221 | 6. That's it, you're back to VGA mode. And if you compiled fbcon as a module, |
198 | and yyyfb are not compatible (ie, cannot be loaded at the same time). | 222 | you can unload it by 'rmmod fbcon' |
199 | 223 | ||
200 | 7. To reattach fbcon: | 224 | 7. To reattach fbcon: |
201 | 225 | ||
202 | echo 1 > /sys/class/graphics/fbcon/attach | 226 | echo <ID> > /sys/class/tty/console/bind |
203 | 227 | ||
204 | 8. Once the framebuffer console is detached, and if it is compiled as a module, | 228 | 8. Once fbcon is unbound, all drivers registered to the system will also |
205 | the module can be unloaded with 'rmmod fbcon'. This feature is great for | 229 | become unbound. This means that fbcon and individual framebuffer drivers |
206 | developers. | 230 | can be unloaded or reloaded at will. Reloading the drivers or fbcon will |
231 | automatically bind the console, fbcon and the drivers together. Unloading | ||
232 | all the drivers without unloading fbcon will make it impossible for the | ||
233 | console to bind fbcon. | ||
207 | 234 | ||
208 | Notes for vesafb users: | 235 | Notes for vesafb users: |
209 | ======================= | 236 | ======================= |
@@ -227,11 +254,11 @@ Variation 1: | |||
227 | c. Attach fbcon | 254 | c. Attach fbcon |
228 | 255 | ||
229 | vbetool vbestate restore < <vesa state file> && \ | 256 | vbetool vbestate restore < <vesa state file> && \ |
230 | echo 1 > /sys/class/graphics/fbcon/attach | ||
231 | |||
232 | Variation 2: | 257 | Variation 2: |
233 | 258 | ||
234 | a. Before detaching fbcon, do: | 259 | a. Before detaching fbcon, do: |
260 | echo <ID> > /sys/class/tty/console/bind | ||
261 | |||
235 | 262 | ||
236 | vbetool vbemode get | 263 | vbetool vbemode get |
237 | 264 | ||
@@ -242,7 +269,7 @@ Variation 2: | |||
242 | c. Attach fbcon: | 269 | c. Attach fbcon: |
243 | 270 | ||
244 | vbetool vbemode set <mode number> && \ | 271 | vbetool vbemode set <mode number> && \ |
245 | echo 1 > /sys/class/graphics/fbcon/attach | 272 | echo <ID> > /sys/class/tty/console/bind |
246 | 273 | ||
247 | -- | 274 | -- |
248 | Antonino Daplas <adaplas@pol.net> | 275 | Antonino Daplas <adaplas@pol.net> |