Framebuffer
From Gentoo Linux Wiki
| Installation • Kernel & Hardware • Networks • Portage • Software • System • X Server • Gaming • Non-x86 • Emulators • Misc |
Contents |
[edit] Introduction
A framebuffer enables the kernel to display graphics on an otherwise text only console. These drivers can also be used for other things, such as running a non-accelerated X server or playing video in media players with framebuffer support. Framebuffer support is a requirement for Fbsplash and Qingy.
[edit] Kernel 2.6.x
Make your way to the kernel source directory, cd /usr/src/linux usually gets you there, and run make menuconfig. The relevant entries are located under Device Drivers -> Graphics support as seen here:
| Linux Kernel Configuration: 2.6.x |
Device Drivers ->
Graphics support ->
[*] Support for frame buffer devices
[*] Enable firmware EDID
--- Frame buffer hardware drivers
...
Console display driver support ->
[*] Video mode selection support
<*> Framebuffer Console support
|
You almost definitely want to tick Enable firmware EDID. If you notice that the kernel is taking a long time to load, disable it.
Listed below Frame buffer hardware drivers are the actual hardware drivers.
[edit] Commons
The kernel will only use the framebuffer if it is specifically told to do so. The required kernel command line option here is video= followed by the desired driver, a set of options, resolution, color depth and refresh rate. A uvesafb example is shown below, but keep in mind that how the kernel is told to use the framebuffer differs from driver to driver.
| File: /boot/grub/grub.conf |
... title=Gentoo Linux root(hd0,0) kernel /boot/bzImage root=/dev/hda3 video=uvesafb:ywrap,mtrr:3,1024x768-32@70 ... |
Here we told the kernel to use the uvesafb driver with the ywrap and mtrr:3 options, set the resolution to 1024x768 with a color depth of 32 bits and a refresh rate of 70Hz.
[edit] MTRR
The mtrr option defaults to mtrr:0, meaning that MTRR will be disabled — equivalent to the nomtrr option. The safest option is probably to use mtrr:1 and the most optimal option is most likely mtrr:3. The values represent:
- 0 - Disabled (equivalent to nomtrr) (default)
- 1 - Uncacheable
- 2 - Write-back
- 3 - Write-combining
- 4 - Write-through
Review the kernel documentation for more information.
[edit] ypan, ywrap and redraw
The ypan, ywrap and redraw are scrolling options. They set the way the kernel will handle the scrolling and panning of the framebuffer. If none of these are specified, the redraw option will be used, this is the safest but slowest option. Most modern hardware can handle ywrap, so this is most likely the option you want to use. If that fails you could try ypan, expect flickering using this though.
To clarify, a complete kernel command line in /boot/grub/grub.conf, using the uvesafb driver, with the mtrr:3 and ywrap options using a resolution of 1600x1200, a color depth of 32 bits and a refresh rate of 70 Hz would be:
| File: /boot/grub/grub.conf |
... kernel /boot/bzImage root=/dev/hda3 video=uvesafb:1600x1200-32@70,mtrr:3,ywrap ... |
Review the Kernel Documentation for more information.
[edit] uvesafb
Some tinkering is involved to get the uvesafb driver working. You will need to enable Connector - unified userspace <-> kernelspace linker and Userspace VESA VGA graphics support.
| Linux Kernel Configuration: gentoo-sources-2.6.24-r4 |
Device Drivers -> <*> Connector - unified userspace <-> kernelspace linker ---> ... Graphics support -> <*> Userspace VESA VGA graphics support |
Rebuild the kernel, but don't install it just yet. Emerge the klibc:
# emerge -av klibc
The reason we first needed to build the kernel is that we need klibc to compile against a kernel with Connector - unified userspace <-> kernelspace linker and Userspace VESA VGA graphics support enabled.
Next we need the v86d userspace helper:
# emerge -av v86d
Now, enable Initial RAM filesystem and RAM disk (initramfs/initrd) support in the kernel and set /usr/share/v86d/initramfs as the Initramfs source file(s)
| Linux Kernel Configuration: gentoo-sources-2.6.24-r4 |
General Setup -> [*] Initial RAM filesystem and RAM disk (initramfs/initrd) support (/usr/share/v86d/initramfs) Initramfs source file(s) |
Rebuild the kernel yet again and finally install it.
Add to the kernel line of your /boot/grub/grub.conf, substituting the options to your liking:
| File: /boot/grub/grub.conf |
... kernel /boot/bzimage root=/dev/hda3 video=uvesafb:mtrr:3,ywrap,1024x768-24@60 ... |
You can also create a profile disabling uvesafb using the following:
| File: /boot/grub/grub.conf |
... kernel /boot/bzimage root=/dev/hda3 video=uvesafb:off ... |
According to the UVesaFB website, this is a FAQ and this setting is already known not to be included within the kernel documentation. One reason for disabling UVesaFB, is to avoid known conflicts when using the binary NVidia driver with hibernate/suspend feature.
Review the uvesafb Kernel Documentation or visit the official uvesafb website for more information.
[edit] vesafb
The vesafb driver is a generic VESA driver that works with most VESA compatible cards.
| Linux Kernel Configuration: gentoo-sources-2.6.24-r4 |
Device Drivers -> Graphics support -> [*] VESA VGA graphics support |
If you use the vesafb driver you will need to omit the resolution, color depth and refresh rate from the video= and follow with a vga= parameter. The vga= takes a decimal value (with no preceding 0x), or ask. Setting vga=ask is a good idea if you are unsure what to use, as the kernel will stop and ask you for the desired resolution and color depth.
Valid VGA modes are as follows (mode numbers in this table are in decimal):
| 320×200 | 640×400 | 640×480 | 800×500 | 800×600 | 896×672 | 1024×640 | 1024×768 | 1152×720 | 1280×1024 | 1440×900 | 1600×1200 | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 4 bit | 770 | 772 | 774 | |||||||||
| 8 bit | 768 | 769 | 879 | 771 | 815 | 874 | 773 | 869 | 775 | 864 | 796 | |
| 15-bit | 781 | 801 | 784 | 880 | 787 | 816 | 875 | 790 | 870 | 793 | 865 | 797 |
| 16-bit | 782 | 802 | 785 | 881 | 788 | 817 | 876 | 791 | 871 | 794 | 866 | 798 |
| 24-bit | 783 | 803 | 786 | 882 | 789 | 818 | 877 | 792 | 872 | 795 | 867 | 799 |
| 32-bit | 804 | 809 | 883 | 814 | 819 | 878 | 824 | 873 | 829 | 868 | 834 |
For example, video=vesafb:mtrr:3,ywrap vga=792 would be equivalent to video=uvesafb:mtrr:3,ywrap,1024x768-24@60.
To create a profile for disabling framebuffer, use either vga=normal or vga=nofb (according to documentation is said to work). Or just omit "vga=..." entirely.
Review the vesafb Kernel Documentation for more information.
[edit] sisfb
For users with a SiS card, you want the sisfb driver.
| Linux Kernel Configuration: gentoo-sources-2.6.24-r4 |
Device Drivers -> Graphics support -> <*> SiS/XGI display support |
This driver supports the following SiS cards:
- SiS 300 series: SiS 300/305, 540, 630(S), 730(S)
- SiS 315 series: SiS 315/H/PRO, 55x, (M)65x, 740, (M)661(F/M)X, (M)741(GX)
- SiS 330 series: SiS 330 ("Xabre"), (M)760
The video= parameter differs from other drivers. The uvesafb driver entry video=uvesafb:ypan,mtrr:3,1024x768-32@70 would be video=sisfb:mode:1024x768x32,rate:70,mem:4096 for sisfb.
