Uvesafb

From ArchWiki
Revision as of 21:53, 2 January 2010 by Rway (talk | contribs)
Jump to navigation Jump to search

Template:I18n links start Template:I18n entry Template:I18n entry Template:I18n links end A new framebuffer driver has been added to kernel 2.6.24. It has many more features than the standard vesafb, including: 1) proper blanking and hardware suspension after delay; 2) support for custom resolutions as in the system BIOS. It should support as much hardware as vesafb.

The virtualizing daemon

In contrast with other framebuffer drivers, uvesafb needs a userspace virtualizing daemon, called v86d. It may seem foolish to emulate x86 code on a x86, but this is important if one wants to use the framebuffer code on other architectures (notably non-x86 ones). The Template:Package Official package includes an initcpio HOOK (called v86d), which load the uvesafb module and runs the virtualizing daemon when needed.

You need to add the v86d in the HOOKS array in /etc/mkinitcpio.conf. It should be somewhere after base and before keymap (in the case you use the keymap hook). Then you need to regenerate your initramfs with mkinitcpio (adjust the following command to your setup):

mkinitcpio -p kernel26

PLEASE NOTE that v86d requires that klibc has been compiled against a kernel tree including uvesafb. So you need to update klibc to a recent version (the actual version in the core repo is fine).

Remove the kernel boot parameters

Remember to remove any framebuffer-related kernel boot parameter from the bootloader configuration: the vga=<foo> would force the old vesafb to load; the video=<foo> parameter would not be used when uvesafb is compiled as a module (as in the Arch Linux stock kernel).

The options for uvesafb

The options for uvesafb can be defined in Template:Filename or in the general Template:Filename. The default file in the v86d package makes the syntax explicit and tells you where to look for further infos:

# This file sets the parameters for uvesafb module.
# The following format should be used:
# options uvesafb mode=<xres>x<yres>[-<bpp>][@<refresh>] scroll=<ywrap|ypan|redraw> ...
#
# For more details see:
# http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;f=Documentation/fb/uvesafb.txt
#
options uvesafb mode=1280x800-32 scroll=ywrap

From 2.6.27 and up you have to type:

...
options uvesafb mode_option=1280x800-32 scroll=ywrap

Uvesafb compiled into the kernel

If you compile your own kernel, then you can also compile uvesafb into the kernel and run v86d later, e.g. from /etc/rc.local. In this case, the options can be passed as kernel boot parameters in the format video=uvesafb:<options>. Please note that this solution is not viable in the case you want to combine uvesafb with 915resolution as suggested below.

The homepage of uvesafb

The home page of uvesafb is http://dev.gentoo.org/~spock/projects/uvesafb where you can find some detailed informations (you can ignore any information concerning patches for the kernel, because uvesafb is now in the vanilla kernel; moreover some informations in the site assume that uvesafb is compiled in the kernel, while it is a module in the archlinux stock binary kernel).

Uvesafb and 915resolution

In the following, we address a more complex scenario. Many intel video chipsets for widescreen laptops are known to have a buggish bios, which does not support the main, native resolution of the wide screen! For this reason, 915resolution was created to patch the bios at boot time and allowed the x server to use the widescreen resolution. Nowadays, the xserver is able to do this without the help of 915resolution. However, 915resolution can be combined with uvesafb in order to obtain a widescreen framebuffer, without any need to launch X at all. In this case, we need to load uvesafb after having run 915resolution, so that uvesafb can resort to the proper resolution.

915resolution-static

In this scenario, 915resolution needs to be compiled statically (since it is going to be in an initramfs, it can not be linked to external libraries). Thus you CAN NOT use the 915resolution package in the community repo. Look instead for 915resolution-static in AUR unsupported. It compiles 915 resolution statically and provides a 915 resolution hook, so you can run 915resolution before loading uvesafb and get the patched resolution. So install 915resolution-static via makepkg and pacman.

The resolution

You need to edit the 915resolution hook in order to define the BIOS mode you want to replace and and the resolution you want to get. You can get infos about all the options for 915resolution with:

915resolution -h

So edit /lib/initcpio/hooks/915resolution and modify the options for 915resolution:

run_hook ()
{
   msg -n ":: Patching the VBIOS..."
   /usr/sbin/915resolution 5c 1280 800
   msg "done."
}

In the default, 5c is the code of the BIOS mode to replace. You can get a list of the available BIOS video modes with '915resolution -l': NOTE that you want to choose the code of a mode that you DO NOT need (neither in the framebuffer nor in X), because 915resolution will replace it with a new user-defined mode. '1280 800' is the new desired resolution.

V86d

Install v86d via pacman.

Modify /etc/modprobe.d/uvesafb

Modify the options for uvesafb in /etc/modprobe.d/uvesafb, so that it uses the resolution you need, e.g.:

options uvesafb mode=1280x800-32 scroll=ywrap

From 2.6.27 and up you have to type:

...
options uvesafb mode_option=1280x800-32 scroll=ywrap


List the hooks

Add the 915resolution hook and, after it, the v86d hook to HOOKS in mkinitcpio.conf. Put them before the hooks for the keymap, the resume from suspension and the filesystems.

HOOKS="base udev v86d ..."

or if you need 915resolution

HOOKS="base udev 915resolution v86d ..."

Finalize

Regenerate your initcpio (for example mkinitcpio -p kernel26), reboot and enjoy your widescreen framebuffer.