linux Framebuffer分类(uvesafb、vesafb、sisfb)

转载 2011年04月22日 15:46:00

原文见:http://en.gentoo-wiki.com/wiki/Framebuffer#vesafb

 

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

 


 

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
			...
			<*> 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 withConnector - unified userspace <-> kernelspace linker and Userspace VESA VGA graphics support enabled. Next we need the sys-apps/v86d userspace helper,

emerge -av v86d

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,

Note: If you need to add v86d to an already existing initramfs source directory, look in /usr/share/v86d/initramfsand copy the files listed there.
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.

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
			...
			[*] VESA VGA graphics support

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
			...
			[*] 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

Kernel Command Line Options

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.

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.

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.

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 you should be aware that these number might not work on your particular hardware. A better way to see the modes you can set is to run:

hwinfo --vbe|grep Mode

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.

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.

Other Options

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.

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.

 

FrameBuffer

在做USB摄像头采集数据并显示到屏幕上的时候,由于之前没有学过openCV之类的界面编程,所以只能使用FrameBuffer进行显示了。下面对FrameBuffer进行一下总结。     Frame...
  • Buyi_Shizi
  • Buyi_Shizi
  • 2016-04-20 15:07:12
  • 953

Framebuffer的配置及应用——先转载留着,以后一定要弄懂

借助于framebuffer,我们能够在console下面作很多事情。首先下载framebuffer的配置工具fbset: # apt-get install fbset 下载完毕后,配置文件/et...
  • TJU355
  • TJU355
  • 2011-10-17 15:17:14
  • 2108

一、 FrameBuffer 原理、实现与应用 写屏(转)

一、FrameBuffer 原理、实现与应用  一、FrameBuffer的原理    FrameBuffer 是出现在 2.2.xx 内核当中的一种驱动程序接口。    Linux是工作在保护...
  • yu704645129
  • yu704645129
  • 2016-05-31 17:22:53
  • 4537

linux Framebuffer分类(uvesafb、vesafb、sisfb)

A framebuffer enables the kernel to display graphics on an otherwise text only console. These driver...
  • tangy110
  • tangy110
  • 2011-04-22 15:46:00
  • 3506

Framebuffer HOWTO

Alex Buell, alex.buell@tahallah.clara.co.uk v1.2, 27 Feb 2000 1. History 2. Contributors 3. What is ...
  • youyoufengxinzi
  • youyoufengxinzi
  • 2007-02-27 18:41:00
  • 1391

linux framebuffer打开图片

  • 2011年07月30日 00:13
  • 2KB
  • 下载

Ubuntu 10.04下修改分辨率

1.开启内核对framebuffer的支持我发现有很多种framebuffer模式,不太明白它们之间有什么区别,不过我的机器在Ubuntu 10.04下,vesafb和nvidiafb都没搞好,能用,...
  • wanjie518
  • wanjie518
  • 2010-11-04 20:30:00
  • 1704

自己写 bootloader

想想 uboot 的代码量,我们说自己写一个 bootloader 是不是口出狂言了?然而并没有,bootloader 的唯一目的只有一个,那便是启动内核。内核就是一大段可执行程序,我们只要跳转到它的...
  • lizuobin2
  • lizuobin2
  • 2016-07-27 15:55:22
  • 4816

让你的gentoo快若刀锋

* 20051204: 注意, 这篇文章里涉及一些具体步骤的操作已经过时了, 所以请不要再按步就班地跟着做. 但是, 里面一些内容, 比如分区的考虑, 配置 make.conf 的思路等, 还是可以参...
  • sailor201211
  • sailor201211
  • 2012-12-31 01:15:31
  • 2192

Linux FrameBuffer分析之编写基于FrameBuffer接口的应用程序

作者:刘昊昱  博客:http://blog.csdn.net/liuhaoyutz 测试环境:Ubuntu 12.04终端模式   在网上找到一个很不错的介绍FrameBuffer相关知识的帖子,原...
  • liuhaoyutz
  • liuhaoyutz
  • 2014-07-23 16:12:08
  • 5008
收藏助手
不良信息举报
您举报文章:linux Framebuffer分类(uvesafb、vesafb、sisfb)
举报原因:
原因补充:

(最多只允许输入30个字)