Framebuffer
From Gentoo Linux Wiki
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 applications like Fbsplash and Qingy.
Contents |
[edit] Framebuffer Kernel Configuration
[edit] Drivers with Kernel Mode Setting (KMS)
Video card drivers which support KMS do not need specific framebuffer drivers. In fact, building a kernel with them may cause all-black console screen or other graphical artifacts, so they should be disabled. Examples include radeon and Intel_GMA.
You should make sure you disable framebuffer drivers like intelfb, vesafb or uvesafb.
| Linux Kernel Configuration: Framebuffer for Drivers with KMS |
Device Drivers ->
Graphics support ->
[*] Support for frame buffer devices --->
[*] Enable firmware EDID
Console display driver support ->
[*] Video mode handling helpers
Frame buffer hardware drivers
[ ] Userspace VESA VGA graphics support
[ ] VESA VGA graphics support
[ ] SiS/XGI display support
...
|
[edit] Framebuffer-specific Drivers
[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: uvesafb kernel configuration |
Device Drivers ->
<*> Connector - unified userspace <-> kernelspace linker --->
Graphics support ->
[*] Support for frame buffer devices --->
[*] Enable firmware EDID
Console display driver support ->
[*] Video mode selection support
Frame buffer hardware drivers
[*] Userspace VESA VGA graphics support
|
Rebuild the kernel, but don't install it just yet. 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 sys-apps/v86d userspace helper,
Now, read the initramfs kernel configuration chapter for instruction on enabling initramfs support, which is needed to include bits of sys-apps/v86d in the kernel. Set the Initramfs source file(s) to /usr/share/v86d/initramfs,
| Linux Kernel Configuration: uvesafb initramfs configuration |
General Setup ->
(/usr/share/v86d/initramfs) Initramfs source file(s)
|
Rebuild the kernel yet again and finally install it.
[edit] vesafb
The vesafb driver is a generic VESA driver that works with most VESA compatible cards.
| Linux Kernel Configuration: vesafb kernel configuration |
Device Drivers ->
<*> Connector - unified userspace <-> kernelspace linker --->
Graphics support ->
[*] Support for frame buffer devices --->
[*] Enable firmware EDID
Console display driver support ->
[*] Video mode selection support
Frame buffer hardware drivers
[*] VESA VGA graphics support
|
[edit] sisfb
For users with a SiS card, you want the sisfb driver.
| Linux Kernel Configuration: sisfb kernel configuration |
Device Drivers ->
Graphics support ->
[*] Support for frame buffer devices --->
[*] Enable firmware EDID
Console display driver support ->
[*] Video mode selection support
Frame buffer hardware drivers
[*] 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
[edit] Kernel Command Line Options
[edit] With Kernel Mode Setting
[edit] Forcing a Resolution
If you get a black screen instead of console or an incorrect resolution, you can force a resolution on the kernel command-line. This tends to happen when KMS auto detection fails with rare/incorrect EDID from the monitor.
You should use a kernel version >=2.6.32. Read the commit log for further instructions.
When using a driver utilizing Kernel Mode Setting, you do not specify any driver name in the video= parameter. For example, setting the screen resolution to 1280x1024, 24bps at 75Hz would be just:
video=1280x1024-24@75
[edit] Enabling Modesetting
If you didn't set Enable modesetting on <driver> by default in your kernel you will need to pass <driver>.modeset=1 to the kernel.
An example using GRUB where <driver>.modeset=1 gets passed to the kernel,
title Example Linux root (0,0) # Enable modesetting -- edit to select your driver # kernel /example-kernel-2.6.29 root=/dev/root i915.modeset=1 # kernel /example-kernel-2.6.29 root=/dev/root radeon.modeset=1 # Disable modesetting # kernel /example-kernel-2.6.29 root=/dev/root nomodeset
[edit] Without KMS
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.
[edit] uvesafb
Add to the kernel line of your /boot/grub/grub.conf, substituting the options to your liking,
video=uvesafb:mtrr:3,ywrap,1024x768-24@60
You can also create an entry disabling uvesafb using the following,
video=uvesafb:off
One reason for disabling UVesaFB, is to avoid known conflicts when using the binary NVidia driver with hibernate/suspend feature.
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.
... 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] vesafb
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. The Linux video mode numbers can be found here, but know that these number might not work on your perticular hardware. A better way to see that modes you can set it so run:
So, a vesafb example would be,
video=vesafb:mtrr:3,ywrap vga=792
which would be equivalent to a uvesafb of:
video=uvesafb:mtrr:3,ywrap,1024x768-24@60
To create a profile for disabling framebuffer, use either vga=normal or vga=nofb, or just omit vga= entirely.
[edit] sisfb
The video= parameter differs from other drivers.
The uvesafb driver entry,
video=uvesafb:ypan,mtrr:3,1024x768-32@70
would, using sisfb be,
video=sisfb:mode:1024x768x32,rate:70,mem:4096
Make sure you set the memory size of your card in KiB using the mem: option.
[edit] Other Options
[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:
... kernel /boot/bzImage root=/dev/hda3 video=uvesafb:1600x1200-32@70,mtrr:3,ywrap ...
Review the Kernel Documentation for more information.
