Re: 编译、安装显卡驱动求救
发表于 : 2009-11-08 13:08
由 gexiaohua
---------------------------------------------------------------------------
VIA Integration Graphic Chip Console Framebuffer Driver
---------------------------------------------------------------------------
Platform
The console framebuffer driver is for Graphics chips of
VIA UniChrome Family (CLE266, KM400, KN400, KM800, KN800, PM800, PN800, CN400, CN700, CN800, CX700M/M2, CN896, VX700M/M2).
---------------------------------------------------------------------------
Driver features
Device: CRT, TV
Support Mode: CRT: 640x480(60,75,85,100,120Hz), 720x480(60Hz),
720x576(60Hz), 800x600(60,75,85,100,120Hz),
848x480(60Hz), 856x480(60Hz), 1024x512(60Hz),
1024x768(60,75,85,100Hz), 1152x864(75Hz),
1280x768(60Hz), 1280x960(60Hz), 1280x1024(60,75,85Hz),
1440x1050(60Hz), 1600x1200(60,75Hz), 1366x768(60Hz),
1280x720(60Hz), 1920x1080(60Hz), 1400x1050(60Hz), 800x480(60Hz)
TV: VT1622, VT1622A, VT1623 (640x480, 800x600, 1024x768, 720x480, 720x576, 848x480)
VT1625 (640x480, 800x600, 1024x768, 720x480, 720x576, 1280x720(HDTV), 1920x1080(HDTV))
IntegratedTV (640x480, 800x600, 1024x768, 720x480, 720x576, 1280x720(HDTV), 1920x1080(HDTV))
color depth : 8 bpp, 16 bpp, 32 bpp
TV encoder : VIA VT1622, VT1622A, VT1623, VT1625, IntegratedTV
TV output : VT1622 (Composite, S-Video, Composite+S-Video, YCBCR)
VT1622A ,VT1623 (Composite, S-Video, Composite+S-Video, RGB, YCBCR)
VT1625 (Composite, S-Video, Composite+S-Video, RGB, YCBCR)
IntegratedTV (Composite, S-Video, RGB, YCBCR)
TV type : VT1622 (NTSC, PAL, 480P, 576P)
VT1622A ,VT1623 (NTSC, PAL, 480P, 576P)
VT1625 (NTSC, PAL, 480P, 576P, 720P, 1080I)
IntegratedTV (NTSC, PAL, 480P, 576P, 720P, 1080I)
Support TV overscan display
Support 2D hardware accelerator for kernel 2.6.
---------------------------------------------------------------------------
Building viafb as a module for Linux kernel 2.4
Make sure you have the kernel sources installed in /usr/src/. For
example, if your kernel version is 2.4.18-3, then there would be /usr/src/linux-2.4.18-3 in your system.
Copy viafb to any directory, and then following below steps:
Step 1: change to viafb directory
# cd viafb/
Step 2: Clear all object file.
# make clean
Step 3: Make source code
# make
Note that if no any error, this step will be produced an object file "viafb.o".
Step 4: Install viafb.o framebuffer driver
# make install
---------------------------------------------------------------------------
Using the viafb module. (for Linux kernel 2.4)
Start viafb with default settings,
#modprobe viafb
Start viafb with with user options,
#modprobe viafb mode=800x600 bpp=16 refresh=60 active_dev=CRT+TV tv_system=1
tv_level=1 tv_out_signal=4 mode1=1024x768 bpp1=16 refresh1=60 SAMM_ON=1
mode :
640x480 (default)
720x480
800x600
1024x768
......
bpp :
8, 16, 32 (default : 32)
refresh :
60, 75, 85, 100, 120 (default : 60)
tv_system :
0 : none
1 : NTSC (default)
2 : PAL
3 : 480P
4 : 576P
5 : 720P
6 : 1080I
tv_level :
VT1622, VT1622A, VT1623
0 : underscan (default)
1 : fitscan (close to fit Industry TV Screen)
2 : overscan
VT1625(ntsc,pal,480p,576p)
0 : underscan (default)
1 : fitscan (close to fit Industry TV Screen)
2 : overscan
VT1625(720p,1080i)
0 : underscan (default)
Other TV Encoders
0 : underscan (default)
1 : overscan
tv_out_signal:
1: Composite
2: S-Video
3: RGB
4: YCBCR (or component)
5: Composite+S-Video (default)
6: RGB+Composite
7: YCBCR+Composite
8: RGB+Composite+S-Video (only for VT1625)
9: YCBCR+Composite+S-Video (only for VT1625)
tv_dedotcrawl:
0: Disable DeDotCrawl Function (default)
1: Enable DeFotCrawl Function
Note that the DeDotCrawl work under NTSC and composite outputting condition, other
conditions don't support this function.
tv_ffilter: To set TV Flicker Filter level
0 ~ 2 : VT1622, VT1622A, VT1623
0 ~ 3 : VT1625
0 ~ 1 : IntegratedTV
tv_brightness:
0 ~ 255 : To set TV output brightness
tv_contrast:
0 ~ 255 : To set TV output contrast
tv_saturation:
0 ~ 65535 : To set TV output saturation
tv_tint:
0 ~ 2047 : To set TV output tint
Note: Different TV encoder have different default values of TV color features
including brightness, contrast, saturation, and tint.
lcd_dsp_method:
0 : expandsion (default)
1 : centering
lcd_mode:
0 : OPEN LDI (default)
1 : SPWG
lcd_panel_id:
0 : Resolution: 640x480, Channel: single, Dithering: Enable
1 : Resolution: 800x600, Channel: single, Dithering: Enable
2 : Resolution: 1024x768, Channel: single, Dithering: Enable (default)
3 : Resolution: 1280x768, Channel: single, Dithering: Enable
4 : Resolution: 1280x1024, Channel: dual, Dithering: Enable
5 : Resolution: 1400x1050, Channel: dual, Dithering: Enable
6 : Resolution: 1600x1200, Channel: dual, Dithering: Enable
9 : Resolution: 1024x768, Channel: dual, Dithering: Enable
10: Resolution: 1024x768, Channel: single, Dithering: Disable
11: Resolution: 1024x768, Channel: dual, Dithering: Disable
12: Resolution: 1280x768, Channel: single, Dithering: Disable
13: Resolution: 1280x1024, Channel: dual, Dithering: Disable
14: Resolution: 1400x1050, Channel: dual, Dithering: Disable
15: Resolution: 1600x1200, Channel: dual, Dithering: Disable
16: Resolution: 1366x768, Channel: single, Dithering: Disable
17: Resolution: 1024x600, Channel: single, Dithering: Enable
18: Resolution: 1280x768, Channel: dual, Dithering: Enable
19: Resolution: 1280x800, Channel: single, Dithering: Enable
accel: (only for kernel 2.6)
0 : No 2D Hardware Acceleration (default)
1 : 2D Hardware Acceleration
SAMM_ON:
0 : SAMM_ON disable (default)
1 : SAMM_ON enable
mode1 :(secondary display device)
640x480 (default)
720x480
800x600
1024x768
......
bpp1 :(secondary display device)
8, 16, 32 (default : 32)
refresh1 :(secondary display device)
60, 75, 85, 100, 120 (default : 60)
active_dev:
This option is used to specify active devices. (CRT, TV, DVI, LCD, CRT+TV, CRT+LCD, CRT+DVI,...)
In SAMM case, the previous of active_dev is primary device, and the following is secondary device.
For example:
To enable one device, such as TV only, we should use:
modprobe viafb active_dev=TV ...
To enable two devices, such as CRT+TV:
For DuoView case, we can use:
modprobe viafb active_dev=CRT+TV ...
OR
modprobe viafb active_dev=TV+CRT ...
For SAMM case:
If CRT is primary and TV is secondary, we should use:
modprobe viafb active_dev=CRT+TV SAMM_ON=1 ...
If TV is primary and CRT is secondary, we should use:
modprobe viafb active_dev=TV+CRT SAMM_ON=1 ...
display_hardware_layout:
This option is uesed to specify display hardware layout for CX700 chip.
1: LCD only
2: DVI only
3: LCD + DVI (default)
4: LCD1 + LCD2 (internal + internal)
16:LCD1 + ExternalLCD2 (internal + external)
second_size:
This option is used to set second device memory size(MB) in SAMM
case. The minimal size is 16.
dual_fb:
This option will apart the frame buffer just like SAMM, and if
this option is set, SAMM_ON will be automaticly set. The different
with SAMM is, the driver will register two frame buffer, with the
first part frame buffer and the second part. So there will be
/dev/fb0 and /dev/fb1
When dual_fb is set, you also should set active_dev, for example:
modprobe viafb dual_fb=1 active_dev=CRT+TV accel=1
For CLE266, if the LCD is assigned as primary device, /dev/fb0 will
be registed with the second part frame buffer, and /dev/fb1 will
be registed with the first part frame buffer.
Otherwise, the fist frame buffer is alway mapped on /dev/fb0, the
second frame buffer is mapped on /dev/fb1.
The Linux console is always use /dev/fb0. So, in most cases, we use
IGA1 to display console output. But IGA2 is also suppoted as the
console output device, even acceleration under 2.6 kernel.
EPIA_DVI:
This option is used to enable DVI on EPIA-M
0 : No DVI on EPIA-M (default)
1 : DVI on EPIA-M
BusWidth:
When using 24-Bit Bus Width Digital Interface, this option should be set.
12 : 12-Bit LVDS or 12-Bit TMDS (default)
24 : 24-Bit LVDS or 24-Bit TMDS
LCDDualEdge:
When using Dual Edge Panel, this option should be set.
0 : No Dual Edge Panel (default)
1 : Dual Edge Panel
video_dev:
This option is used to specify video output devices (CRT, TV, DVI, LCD) for duoview case.
For example:
To output video on TV, we should use:
modprobe viafb video_dev=TV ...
lcd_port:
This option is used to specify lcd output port, available values are "DVP0" "DVP1" "DFP_HIGHLOW"
"DFP_HIGH" "DFP_LOW", for external LCD + external TV on CX700(External LCD is on DVP0),
we should use:
modprobe viafb lcd_port=DVP0 ...
tv_port: This option is used to specify TV output port, available values are "DVP0" "DVP1" "DFP_HIGHLOW"
"DFP_HIGH" "DFP_LOW"
Note :
1. If TV is enabled, the refresh rate will be bound to TV type (NTSC:60Hz, PAL:50Hz).
2. CRT may not display properly for DuoView CRT & TV display at
the "640x480" PAL mode with TV overscan enabled.
3. When SAMM is enable, mode and mode1,bpp and bpp1,refresh and refresh1 can be different.
4. When console is depend on viafbinfo1, dynamically change
resolution and bpp, need call VIAFB specified ioctl interface VIAFB_SET_DEVICE.
Call common ioctl function FBIOPUT_VSCREENINFO will cause sreen crush.
----------------------------------------------------------------------------------------------------------
Use proc file system to adjust DPA setting(kernel 2.6 only)
there are total 6 files under /proc/viafb, they are:
dfph,dfpl,dvp0,dvp1,vt1636,vt1625
file vt1636 and vt1625 only appear when respective chip is used.
the format and value range for dvp0(1) DPA setting is:
clock data_dri clock_dri
0~15 0~3 0~3
the format for dfph(l) DPA setting is:
clock
0~15
the format for vt1636 DPA setting is:
CLK_SEL_ST2 CLK_SEL_ST1
0~15 0~31
the format for vt1625 DPA setting is:
clock
0~15
For example to set DVP0 settings, you can type:
# echo 0 0 0 > /proc/viafb/dvp0
Note: setting for DPA changed through /proc/viafb will not be keeped once you change display mode
---------------------------------------------------------------------------
Configure viafb options with "fbset" tool
"fbset" is an inbox utility of Linux.
1. Inquire current viafb information, type,
# fbset -i
2. Set various resolutions and refresh rates,
# fbset <resolution-vertical_sync>
example,
# fbset "1024x768-75"
or
# fbset -g 1024 768 1024 768 32
Check the file "/etc/fb.modes" to find display modes available.
3. Set the color depth,
# fbset -depth <value>
example,
# fbset -depth 16
---------------------------------------------------------------------------
Building viafb as a module for Linux kernel 2.6
If you have kernel source installed, and hasn't built it, please do the fllowing prepare work, or else, you can skip below procedures.
# cd /usr/src/
# ln -s /usr/src/linux-2.6.xx-x linux
# cd linux
# cp /boot/config-2.6.xx-x .config
# make modules_prepare
If you have not installed kernel source, you can use object files shipped by your vender. First, make sure you have the kernel object files installed.
For FedoraCore serials, they may be
/lib/modules/2.6.xx-x/build/
For SuSE serials, they may be
/usr/src/linux-2.6.xx-x-obj/i386/default/
The directory 2.6.xx-x is depend on your kernel version, i386 maybe changed for your arch. If you installed this file, please do the fllowing prepare work.
# cd /usr/src/
For FedoraCore:
# ln -s /lib/modules/2.6.xx-x/build linux
For SuSE:
# ln -s /usr/src/linux-2.6.xx-x-obj/i386/default linux
As prepare work done, you can build viafb.
Please copy viafb to any directory, and fllowing below steps:
Step 1: change to viafb directory
# cd Linux-FBDev-kernel-src_2.6.00.03/
Step 2: Clear all object file.
# make clean
Step 3: Make source code
# make
Note that if no any error, this step will be produced an object file "viafb.ko".
Step 4: Install viafb.ko framebuffer driver
# make install
---------------------------------------------------------------------------
Using the viafb module. (for Linux kernel 2.6, but NOT for FC2)
It is just like in kernel 2.4
---------------------------------------------------------------------------
Using the viafb module. (for Fedora Core 2)
Using viafb.ko in Fedora Core 2, you need another kernel module, fbcon.ko(framebuffer console module). To build this module, please see next section.
Modprobing viafb will not change the display mode until you modprobe fbcon.
You can see the related steps below.
Step 1: Start viafb with default settings.
# modprobe viafb
Note that you can see the other options from "Using the viafb module. (for Linux kernel 2.4)" section.
Step 2: Modprope fbcon.
# modprobe fbcon
---------------------------------------------------------------------------
Building fbcon.ko for Fedore Core 2 (kernel 2.6.5-1.358)
Building fbcon console module.
Step 1: Install kernel source, you can find it on install CD-3.
# rpm -ivh kernel-source-2.6.5-1.358.i386.rpm
Step 2: Change to folder /usr/src/linux-2.6.5-1.358
# cd /usr/src/inux-2.6.5-1.358
Step 3: Configuring the kernel module
# make menuconfig
Step 4: Select fbcon item to module.
-> Device Drivers-> Graphics support-> Console display driver support-> <M> Framebuffer Console support
Step 5: Save the current setting and quit.
Step 6: Make fbcon module.
# make modules SUBDIRS=./drivers/video/console
Note that if no any error, this step will be produced "fbcon.ko" in /usr/src/linux-2.6./drivers/video/console folder.
Step 7: Copy fbcon.ko to lib folder.
# cp /usr/src/linux-2.6./drivers/video/console/fbcon.ko /lib/modules/2.6./kernel/drivers/video/
---------------------------------------------------------------------------
Building viafb as a built-in driver on FC3/4/6 and Kernel 2.6.20
Built-in driver will be load at kernel booting, and you can parse argument
to viafb driver through kernel parameters.
Step 1: Get kernel source and put them under /usr/src/linux
Step 2: Copy FBDev to proper location.
# cp -a Linux-FBDev-kernel-src_2.6.00.03 /usr/src/linux/drivers/video/via
Step 3: Replace Makefile
# cd /usr/src/linux/drivers/video/via
# mv -f Makefile_26.kernel Makefile
Step 4: Modify Makefile and Kconfig under /usr/src/linux/drivers/video: add line "obj-$(CONFIG_FB_VIA) += via/" to proper position of Makefile;
add below lines to Kconfig (Kernel 2.6.20/FC6)
config FB_VIA
tristate "via acceleration"
depends on FB && PCI
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
help
This is the frame buffer device driver for VIA
or add below lines to Kconfig (FC4)
config FB_VIA
tristate "via acceleration"
depends on FB && PCI
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
select FB_SOFT_CURSOR
help
This is the frame buffer device driver for VIA
or add below lines to Kconfig (FC3)
config FB_VIA
tristate "via acceleration"
depends on FB && PCI
select FB_MODE_HELPERS
help
This is the frame buffer device driver for VIA
Step 5: Select device drivers
# make menuconfig
Enable Device Drivers -> Graphics support -> via acceleration
Disable VESA driver at Drivers -> Graphics support -> VESA VGA graphics
Step 6: Make kernel imgae
# make
# mv arch/i386/boot/bzImage /boot/
Step 7: Test and using built-in viafb driver
Modify /boot/grub/menu.lst,let bzImage be the boot image.
Parameters can be parsed to viafb through kernel parameters:
video=viafb:<options>, for example video=viafb:mode=1280x720,bpp=32,active_dev=
TV+CRT,SAMM:ON,tv_out_signal=9,tv_system=5,mode1=800x600,bpp1=16 and another
sample video=viafb:mode=1280x720,bpp=32,active_dev=CRT+TV,tv_out_signal=9,
tv_system=5. You can see the other options from "Using the viafb module. (for Linux kernel 2.4)" section.