Commit 418d1ce6 authored by Antonino A. Daplas's avatar Antonino A. Daplas Committed by Linus Torvalds

[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: default avatarAntonino Daplas <adaplas@pol.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e614b18d
...@@ -150,14 +150,42 @@ C. Boot options ...@@ -150,14 +150,42 @@ C. Boot options
C. Attaching, Detaching and Unloading C. Attaching, Detaching and Unloading
It's possible to detach/attach the framebuffer console from the vt layer by Before going on on how to attach, detach and unload the framebuffer console, an
echoing anything to the following sysfs attributes found illustration of the dependencies may help.
/sys/class/graphics/fbcon.
attach - attach framebuffer console to vt layer The console layer, as with most subsystems, needs a driver that interfaces with
detach - detach framebuffer console to vt layer the hardware. Thus, in a VGA console:
If fbcon is detached from the vt layer, your boot console driver (which is console ---> VGA driver ---> hardware.
Assuming the VGA driver can be unloaded, one must first unbind the VGA driver
from the console layer before unloading the driver. The VGA driver cannot be
unloaded if it is still bound to the console layer. (See
Documentation/console/console.txt for more information).
This is more complicated in the case of the the framebuffer console (fbcon),
because fbcon is an intermediate layer between the console and the drivers:
console ---> fbcon ---> fbdev drivers ---> hardware
The fbdev drivers cannot be unloaded if it's bound to fbcon, and fbcon cannot
be unloaded if it's bound to the console layer.
So to unload the fbdev drivers, one must first unbind fbcon from the console,
then unbind the fbdev drivers from fbcon. Fortunately, unbinding fbcon from
the console layer will automatically unbind framebuffer drivers from
fbcon. Thus, there is no need to explicitly unbind the fbdev drivers from
fbcon.
So, how do we unbind fbcon from the console? Part of the answer is in
Documentation/console/console.txt. To summarize:
Echo the ID number of the 'frame buffer driver' to:
sys/class/tty/console/bind - attach framebuffer console to console layer
sys/class/tty/console/unbind - detach framebuffer console from console layer
If fbcon is detached from the console layer, your boot console driver (which is
usually VGA text mode) will take over. A few drivers (rivafb and i810fb) will usually VGA text mode) will take over. A few drivers (rivafb and i810fb) will
restore VGA text mode for you. With the rest, before detaching fbcon, you restore VGA text mode for you. With the rest, before detaching fbcon, you
must take a few additional steps to make sure that your VGA text mode is 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,27 +211,26 @@ restored properly. The following is one of the several methods that you can do:
5. Now to detach fbcon: 5. Now to detach fbcon:
vbetool vbestate restore < <vga state file> && \ 'cat /sys/class/tty/console/backend' and take note of the ID
echo 1 > /sys/class/graphics/fbcon/detach
6. That's it, you're back to VGA mode. And if you compiled your drivers as The above is probably needed only once. Then:
modules, you can unload them at will. So if you want to change your driver
from xxxfb to yyyfb, you can do this:
detach fbcon vbetool vbestate restore < <vga state file> && \
rmmod xxxfb echo <ID> > /sys/class/tty/console/unbind
modprobe yyyfb
Of course, con2fbmap can do the same thing but will not work if xxxfb 6. That's it, you're back to VGA mode. And if you compiled fbcon as a module,
and yyyfb are not compatible (ie, cannot be loaded at the same time). you can unload it by 'rmmod fbcon'
7. To reattach fbcon: 7. To reattach fbcon:
echo 1 > /sys/class/graphics/fbcon/attach echo <ID> > /sys/class/tty/console/bind
8. Once the framebuffer console is detached, and if it is compiled as a module, 8. Once fbcon is unbound, all drivers registered to the system will also
the module can be unloaded with 'rmmod fbcon'. This feature is great for become unbound. This means that fbcon and individual framebuffer drivers
developers. can be unloaded or reloaded at will. Reloading the drivers or fbcon will
automatically bind the console, fbcon and the drivers together. Unloading
all the drivers without unloading fbcon will make it impossible for the
console to bind fbcon.
Notes for vesafb users: Notes for vesafb users:
======================= =======================
...@@ -227,11 +254,11 @@ Variation 1: ...@@ -227,11 +254,11 @@ Variation 1:
c. Attach fbcon c. Attach fbcon
vbetool vbestate restore < <vesa state file> && \ vbetool vbestate restore < <vesa state file> && \
echo 1 > /sys/class/graphics/fbcon/attach
Variation 2: Variation 2:
a. Before detaching fbcon, do: a. Before detaching fbcon, do:
echo <ID> > /sys/class/tty/console/bind
vbetool vbemode get vbetool vbemode get
...@@ -242,7 +269,7 @@ Variation 2: ...@@ -242,7 +269,7 @@ Variation 2:
c. Attach fbcon: c. Attach fbcon:
vbetool vbemode set <mode number> && \ vbetool vbemode set <mode number> && \
echo 1 > /sys/class/graphics/fbcon/attach echo <ID> > /sys/class/tty/console/bind
-- --
Antonino Daplas <adaplas@pol.net> Antonino Daplas <adaplas@pol.net>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment