Difference between revisions of "Uvesafb"

From ArchWiki
Jump to: navigation, search
(GRUB2)
(fixed section fragments (interactive))
(Tag: wiki-scripts)
 
(27 intermediate revisions by 14 users not shown)
Line 1: Line 1:
 +
[[Category:Graphics]]
 
[[Category:Eye candy]]
 
[[Category:Eye candy]]
 
[[it:Uvesafb]]
 
[[it:Uvesafb]]
 +
[[ja:Uvesafb]]
 
[[zh-CN:Uvesafb]]
 
[[zh-CN:Uvesafb]]
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).  A new framebuffer driver has been added to kernel 2.6.24. It has many more features than the standard vesafb, including:
+
{{Related articles start}}
 +
{{Related|Kernel modules}}
 +
{{Related|Kernel parameters}}
 +
{{Related|sysctl}}
 +
{{Related articles end}}
 +
{{Style|Many [[Help:Style]] issues}}
 +
{{Expansion|Since this is the redirect for [[framebuffer]], it should mention what a framebuffer is, what it does, why we care, etc.}}
 +
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).  It was added in kernel 2.6.24 and has many more features than the standard vesafb, including:
 
# Proper blanking and hardware suspension after delay
 
# Proper blanking and hardware suspension after delay
 
# Support for custom resolutions as in the system BIOS.
 
# Support for custom resolutions as in the system BIOS.
Line 9: Line 18:
 
== Installation ==
 
== Installation ==
  
[[pacman|Install]] {{Pkg|v86d}} from the [[official repositories]].
+
[[Install]] the {{aur|v86d}} package.
  
== Prepare the system ==
+
== Configuration ==
  
=== Bootloader modifications ===
+
Remove any framebuffer-related kernel boot parameter from the bootloader configuration to disable the old vesafb framebuffer from loading.
  
Remove any framebuffer-related kernel boot parameter from the bootloader configuration to disable the old vesafb framebuffter for loading.
+
$ grep vga /proc/cmdline
 +
$ grep -ir vga /etc/modprobe.d/
  
==== GRUB2 ====
+
Should return no results. If you do have a {{ic|1=vga=}} option somewhere, you will need to remove it.
  
First edit {{ic|/etc/default/grub}} commenting the {{ic|1=GRUB_GFXPAYLOAD_LINUX=keep}} line.
+
=== Boot manager ===
  
Then regenerate {{ic|grub.cfg}} via the standard script:
+
==== GRUB ====
  
# grub-mkconfig -o /boot/grub/grub.cfg
+
First edit {{ic|/etc/default/grub}} Comment the {{ic|1=GRUB_GFXPAYLOAD_LINUX=keep}} line in {{ic|/etc/default/grub}}, and [[GRUB#Generate the main configuration file]].
 
+
In some cases you will have to disable [[KMS]] before attempting to boot into framebuffer: failure to do so would result in a pitch-black screen, leaving no option but to restart the machine with {{ic|Ctrl+Alt+Del}}. For [[Intel]] cards, this is accomplished by appending {{ic|<nowiki>i915.modeset=0</nowiki>}} to [[GRUB]]'s entry.
+
 
+
{{Warning|Disabling KMS may break X.}}
+
  
 
==== GRUB legacy ====
 
==== GRUB legacy ====
Line 33: Line 39:
 
Remove all references to {{ic|vga<nowiki>=</nowiki>xxx}} from kernel lines in {{ic|/boot/grub/menu.lst}} to allow correct operation of uvesafb.
 
Remove all references to {{ic|vga<nowiki>=</nowiki>xxx}} from kernel lines in {{ic|/boot/grub/menu.lst}} to allow correct operation of uvesafb.
  
=== Add a v86d HOOK ===
+
=== mkinitcpio hook ===
  
Add the v86d hook to HOOKS in {{ic|/etc/mkinitcpio.conf}} to allow uvesafb to take over at boot time.
+
Add the v86d hook to HOOKS in {{ic|/etc/mkinitcpio.conf}}. This allows uvesafb to take over at boot time.
 +
 
  HOOKS="base udev v86d ..."
 
  HOOKS="base udev v86d ..."
 
== Configure uvesafb ==
 
  
 
=== Define a resolution ===
 
=== Define a resolution ===
  
The options for uvesafb are defined in {{ic|/usr/lib/modprobe.d/uvesafb.conf}}:
+
The settings for uvesafb are defined in {{ic|/usr/lib/modprobe.d/uvesafb.conf}}:
  
 
  # This file sets the parameters for uvesafb module.
 
  # This file sets the parameters for uvesafb module.
Line 53: Line 58:
 
  options uvesafb mode_option=1280x800-32 scroll=ywrap
 
  options uvesafb mode_option=1280x800-32 scroll=ywrap
  
To prevent your customizations being overwritten when the package is updated, make any changes and copy this file to {{ic|/etc/modprobe.d/uvesafb.conf}} and then add an entry in the FILES section of {{ic|/etc/mkinitcpio.conf}} pointing to your configuration file, like so:
+
Documentation for {{ic|mode_option}} can be found at [http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/fb/modedb.txt linux.git/tree/Documentation/fb/modedb.txt]
 +
 
 +
To prevent your customizations being overwritten when the package is updated, copy this file to {{ic|/etc/modprobe.d/uvesafb.conf}}:
 +
 
 +
# cp /usr/lib/modprobe.d/uvesafb.conf /etc/modprobe.d/uvesafb.conf
 +
 
 +
and then add an entry in the FILES section of {{ic|/etc/mkinitcpio.conf}} pointing to your configuration file, like so:
 +
 
 
  FILES="/etc/modprobe.d/uvesafb.conf"
 
  FILES="/etc/modprobe.d/uvesafb.conf"
  
=== Regenerate initramfs images ===
+
To make changes take effect you need to regenerate the ''initramfs'' images of the kernel.
  
Changes are commited via booting into the initramfs images. Thus, users need to regenerate the initramfs images for the kernel(s). The following example assumes the default Arch Linux kernel:
 
 
  # mkinitcpio -p linux
 
  # mkinitcpio -p linux
  
=== Reboot ===
+
Reboot the system to see the changes take effect.
  
Reboot the system to see the changes.
+
=== Optimizing Resolution ===
 
+
== Listing resolutions ==
+
  
 
A list of possible resolutions can be generated via the following command:
 
A list of possible resolutions can be generated via the following command:
 +
 
  $ cat /sys/bus/platform/drivers/uvesafb/uvesafb.0/vbe_modes
 
  $ cat /sys/bus/platform/drivers/uvesafb/uvesafb.0/vbe_modes
  
Users can modify {{ic|/usr/lib/modprobe.d/uvesafb.conf}} with any entry returned.
+
Users can then modify {{ic|/usr/lib/modprobe.d/uvesafb.conf}} with any entry returned above.
 +
 
 +
=== Checking Current Resolution ===
  
 
Either of following commands can be used to show the current framebuffer resolution as a sanity check to see that settings are honored:
 
Either of following commands can be used to show the current framebuffer resolution as a sanity check to see that settings are honored:
 +
 
  $ cat /sys/devices/virtual/graphics/fbcon/subsystem/fb0/virtual_size
 
  $ cat /sys/devices/virtual/graphics/fbcon/subsystem/fb0/virtual_size
  
 
  $ cat /sys/class/graphics/fb0/virtual_size
 
  $ cat /sys/class/graphics/fb0/virtual_size
  
== Uvesafb compiled into the kernel ==
+
== kernel module parameters ==
 
+
{{Expansion}}
+
If you compile your own kernel, then you can also compile uvesafb into the kernel and run v86d later, e.g. from {{ic|/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 ==
+
If you compile your own kernel, then you can also compile uvesafb into the kernel and run v86d later, e.g. from {{ic|/etc/rc.local}}. In this case, the options can be passed as [[kernel 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 home page of uvesafb is http://dev.gentoo.org/~spock/projects/uvesafb where you can find some detailed information (you can ignore any information concerning patches for the kernel, because uvesafb is now in the vanilla kernel; moreover some information in the site assumes that uvesafb is compiled in the kernel, while it is a module in the Arch Linux stock binary kernel).
+
  
 
== Uvesafb and 915resolution ==
 
== Uvesafb and 915resolution ==
  
In the following, we address a more complex scenario. Many intel video chipsets for widescreen laptops are known to have a buggy 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 allow the X server to use the widescreen resolution. Nowadays, the X server 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.
+
In the following, we address a more complex scenario. Many intel video chipsets for widescreen laptops are known to have a buggy 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 allow the X server to use the widescreen resolution.  
 +
Nowadays, the X server 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 ===
 
=== 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 {{AUR|915resolution-static}} in the AUR. 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]].
+
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 {{AUR|915resolution-static}}{{Broken package link|{{aur-mirror|915resolution-static}}}} in the AUR. 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 ===
 
=== The resolution ===
Line 98: Line 107:
 
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 information about all the options for 915resolution with:
 
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 information about all the options for 915resolution with:
  
  915resolution -h
+
  $ 915resolution -h
  
So edit {{ic|/lib/initcpio/hooks/915resolution}} and modify the options for 915resolution:
+
Edit {{ic|/lib/initcpio/hooks/915resolution}} and modify the options for 915resolution:
  
 
  run_hook ()
 
  run_hook ()
Line 109: Line 118:
 
  }
 
  }
  
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 {{ic|915resolution -l}}.
+
As default 5c is the code of the BIOS mode to replace. You can get a list of the available BIOS video modes with the command {{ic|915resolution -l}}.
 
{{Note|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. In the above example, {{ic|1280 800}} is the new desired resolution.}}
 
{{Note|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. In the above example, {{ic|1280 800}} is the new desired resolution.}}
  
=== The HOOKS array ===
+
=== The Hooks Array ===
  
 
Add the 915resolution hook and, after it, the v86d hook to HOOKS in {{ic|/etc/mkinitcpio.conf}}. Put them before the hooks for the keymap, the resume from suspension and the filesystems.
 
Add the 915resolution hook and, after it, the v86d hook to HOOKS in {{ic|/etc/mkinitcpio.conf}}. Put them before the hooks for the keymap, the resume from suspension and the filesystems.
Line 123: Line 132:
 
== Troubleshooting ==
 
== Troubleshooting ==
  
===Uvesafb cannot reserve memory===
+
=== Uvesafb cannot reserve memory ===
  
 
Check if you forgot to remove any {{Ic|vga<nowiki>=</nowiki>xxx}} kernel parameter -- this overrides the UVESA framebuffer with a standard VESA one.
 
Check if you forgot to remove any {{Ic|vga<nowiki>=</nowiki>xxx}} kernel parameter -- this overrides the UVESA framebuffer with a standard VESA one.
  
=== pci_root PNP0A08:00 address space collision + Uvesafb cannot reserve memory ===
+
Or try to add "video=vesa:off vga=normal" to kernel cmdline.
 +
 
 +
=== Error: "pci_root PNP0A08:00 address space collision + Uvesafb cannot reserve memory" ===
  
 
This occurs on the Acer Aspire One 751h with the 2.6.34-ARCH kernel; whether it also occurs on other systems is unknown. Even without another framebuffer interfering with the uvesafb setup, uvesafb cannot reserve the necessary memory region.
 
This occurs on the Acer Aspire One 751h with the 2.6.34-ARCH kernel; whether it also occurs on other systems is unknown. Even without another framebuffer interfering with the uvesafb setup, uvesafb cannot reserve the necessary memory region.
Line 134: Line 145:
  
 
  pci=nocrs
 
  pci=nocrs
 +
 +
== See also ==
 +
 +
* [https://www.kernel.org/doc/Documentation/fb/uvesafb.txt Uvesafb Kernel Page]
 +
* [http://dev.gentoo.org/~spock/projects/uvesafb Gentoo's uvesafb Page]
 +
* [http://infosnews.5cz.de/VESA_BIOS_Extensions.html#VBE_mode_numbers VESA mode numbers]

Latest revision as of 20:14, 14 August 2016

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements.Tango-edit-clear.png

Reason: Many Help:Style issues (Discuss in Talk:Uvesafb#)

Tango-view-fullscreen.pngThis article or section needs expansion.Tango-view-fullscreen.png

Reason: Since this is the redirect for framebuffer, it should mention what a framebuffer is, what it does, why we care, etc. (Discuss in Talk:Uvesafb#)

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). It was added in kernel 2.6.24 and 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.

Installation

Install the v86dAUR package.

Configuration

Remove any framebuffer-related kernel boot parameter from the bootloader configuration to disable the old vesafb framebuffer from loading.

$ grep vga /proc/cmdline
$ grep -ir vga /etc/modprobe.d/

Should return no results. If you do have a vga= option somewhere, you will need to remove it.

Boot manager

GRUB

First edit /etc/default/grub Comment the GRUB_GFXPAYLOAD_LINUX=keep line in /etc/default/grub, and GRUB#Generate the main configuration file.

GRUB legacy

Remove all references to vga=xxx from kernel lines in /boot/grub/menu.lst to allow correct operation of uvesafb.

mkinitcpio hook

Add the v86d hook to HOOKS in /etc/mkinitcpio.conf. This allows uvesafb to take over at boot time.

HOOKS="base udev v86d ..."

Define a resolution

The settings for uvesafb are defined in /usr/lib/modprobe.d/uvesafb.conf:

# This file sets the parameters for uvesafb module.
# The following format should be used:
# options uvesafb mode_option=<xres>x<yres>[-<bpp>][@<refresh>] scroll=<ywrap|ypan|redraw> ...
#
# For more details see:
# http://www.kernel.org/doc/Documentation/fb/uvesafb.txt
#
options uvesafb mode_option=1280x800-32 scroll=ywrap

Documentation for mode_option can be found at linux.git/tree/Documentation/fb/modedb.txt

To prevent your customizations being overwritten when the package is updated, copy this file to /etc/modprobe.d/uvesafb.conf:

# cp /usr/lib/modprobe.d/uvesafb.conf /etc/modprobe.d/uvesafb.conf

and then add an entry in the FILES section of /etc/mkinitcpio.conf pointing to your configuration file, like so:

FILES="/etc/modprobe.d/uvesafb.conf"

To make changes take effect you need to regenerate the initramfs images of the kernel.

# mkinitcpio -p linux

Reboot the system to see the changes take effect.

Optimizing Resolution

A list of possible resolutions can be generated via the following command:

$ cat /sys/bus/platform/drivers/uvesafb/uvesafb.0/vbe_modes

Users can then modify /usr/lib/modprobe.d/uvesafb.conf with any entry returned above.

Checking Current Resolution

Either of following commands can be used to show the current framebuffer resolution as a sanity check to see that settings are honored:

$ cat /sys/devices/virtual/graphics/fbcon/subsystem/fb0/virtual_size
$ cat /sys/class/graphics/fb0/virtual_size

kernel module parameters

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 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.

Uvesafb and 915resolution

In the following, we address a more complex scenario. Many intel video chipsets for widescreen laptops are known to have a buggy 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 allow the X server to use the widescreen resolution. Nowadays, the X server 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-staticAUR[broken link: archived in aur-mirror] in the AUR. 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 information about all the options for 915resolution with:

$ 915resolution -h

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."
}

As default 5c is the code of the BIOS mode to replace. You can get a list of the available BIOS video modes with the command 915resolution -l.

Note: 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. In the above example, 1280 800 is the new desired resolution.

The Hooks Array

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

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

Then you need to regenerate your initramfs with mkinitcpio (adjust the following command to your setup):

mkinitcpio -p linux

Troubleshooting

Uvesafb cannot reserve memory

Check if you forgot to remove any vga=xxx kernel parameter -- this overrides the UVESA framebuffer with a standard VESA one.

Or try to add "video=vesa:off vga=normal" to kernel cmdline.

Error: "pci_root PNP0A08:00 address space collision + Uvesafb cannot reserve memory"

This occurs on the Acer Aspire One 751h with the 2.6.34-ARCH kernel; whether it also occurs on other systems is unknown. Even without another framebuffer interfering with the uvesafb setup, uvesafb cannot reserve the necessary memory region.

You can fix this issue by adding the following to the kernel parameters in your bootloader's configuration.

pci=nocrs

See also