Uvesafb

提供: ArchWiki
2018年8月30日 (木) 00:48時点におけるKusakata.bot (トーク | 投稿記録)による版 (Pkg/AUR テンプレートの更新)
ナビゲーションに移動 検索に移動

関連記事

他のフレームバッファドライバーと違って、uvesafb は v86d と呼ばれるユーザースペースの仮想化デーモンを必要とします。x86 の上で x86 のコードをエミュレートするのは馬鹿げているようにも見えますが、他のアーキテクチャでフレームバッファコードを使用したいという場合に大事になります (特に x86 以外のアーキテクチャ)。カーネル 2.6.24 では新しいフレームバッファドライバーが追加されました。標準の vesafb よりも多くの機能が存在します:

  1. 遅延時間後の正しいブランクとハードウェアの復帰
  2. システム BIOS のようにカスタム解像度をサポート。

vesafb と同じ数だけのハードウェアをサポートします。

インストール

AUR から v86dAURインストールしてください。

システムの準備

フレームバッファ関連のカーネルブートパラメータは全てブートローダーの設定から削除して vesafb フレームバッファがロードされないようにしてください。

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

上記のコマンドで何も返ってこないようにする必要があります。vga= オプションを記述している場合は、削除してください。

GRUB

ノート: This might not work.

まず /etc/default/grub を編集して GRUB_GFXPAYLOAD_LINUX=keep 行をコメントアウトしてください。

そして標準のスクリプトを使って grub.cfg を再生成します:

# grub-mkconfig -o /boot/grub/grub.cfg

GRUB legacy

uvesafb が正しく動作するように /boot/grub/menu.lst の kernel 行から vga=xxx という記述を全て削除してください。

Systemd

systemd を使っている場合、v86d フックを /etc/mkinitcpio.conf の HOOKS に追加します。これで uvesafb が起動時に動くようになります。

HOOKS="base udev v86d ..."

uvesafb の設定

解像度の定義

uvesafb の設定は /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:
# https://www.kernel.org/doc/Documentation/fb/uvesafb.txt
#
options uvesafb mode_option=1280x800-32 scroll=ywrap

mode_option のドキュメントは linux.git/tree/Documentation/fb/modedb.txt にあります。

パッケージが更新されたときにカスタマイズした設定が上書きされないように、ファイルを /etc/modprobe.d/uvesafb.conf にコピーしてください:

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

そして /etc/mkinitcpio.conf の FILES セクションのエントリに設定ファイルを追加します:

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

変更を適用するにはカーネルの initramfs イメージを再生成する必要があります。

# mkinitcpio -p linux

システムを再起動して変更が適用されたか確認してください。

解像度の最適化

次のコマンドを使うことで使用できる解像度を全てリストアップできます:

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

返ってきたエントリを使って /usr/lib/modprobe.d/uvesafb.conf を修正しましょう。

現在の解像度のチェック

以下のコマンドを使うことで現在のフレームバッファの解像度を表示できます。設定が反映されているかどうか確認するのに使ってください:

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

Uvesafb をカーネルに組み込む

自分でカーネルをコンパイルする場合、カーネルに uvesafb を組み込んで /etc/rc.local などから v86d を実行することができます。この場合、オプションは video=uvesafb:<options> という形式でカーネルパラメータとして指定します。下で書かれているように uvesafb と 915resolution を組み合わせるときはこの方法を使うことはできないので注意してください。

Uvesafb と 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[リンク切れ: アーカイブ: 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.

解像度

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.

ノート: 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.

HOOKS

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

トラブルシューティング

Uvesafb cannot reserve memory

vga=xxx カーネルパラメータを削除するのを忘れてないか確認してください -- この設定が残っていると UVESA フレームバッファが標準の VESA フレームバッファで上書きされてしまいます。

もしくは video=vesa:off vga=normal をカーネルコマンドラインに追加してください。

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

参照