2006年05月12日

Radeon Manual Page
镭驱动使用手册
From MorLUG
Contents
内容
[hide]

    * 1 RADEON
          o 1.1 NAME
          o 1.2 SYNOPSIS
          o 1.3 DESCRIPTION
          o 1.4 SUPPORTED HARDWARE
          o 1.5 CONFIGURATION DETAILS
          o 1.6 SEE ALSO
          o 1.7 AUTHORS
          o 1.8 Index

[edit]
RADEON

Section: XFree86 (4x)
Updated: Version

#Index


[edit]
NAME

radeon – ATI Radeon video driver
[edit]
SYNOPSIS

Section Device
     Identifier devname
     Driver radeon
     …
EndSection

[edit]
DESCRIPTION

radeon

is an XFree86 driver for the ATI Radeon family of video cards. The driver fully supports 2D hardware acceleration, and provides support for framebuffer depths of 8, 15, 16, and 24. All visual types are supported for depth 8; TrueColor and DirectColor visuals are supported for the other depths. Multi-head configurations are supported. The X-Video extension is supported.
[edit]
SUPPORTED HARDWARE

The radeon

driver supports most Radeon cards. In particular, the following cards are known to work (FIXME: check list):

ATI Radeon 8500 series

    All-In-Wonder Radeon 8500

    All-In-Wonder Radeon 8500DV

    Radeon 8500 128MB

    Radeon 8500 64MB

    Radeon 8500LE


ATI Radeon 7500 series

    All-In-Wonder Radeon 7500

    Radeon 7500


ATI Radeon 7000 series

    Radeon 7000 (also known as the Radeon VE)


ATI Radeon series

    Radeon All-In-Wonder

    Radeon 64MB DDR (VIVO)

    Radeon 64MB SDR

    Radeon 32MB DDR

    Radeon 32MB SDR


ATI Radeon Mobility series

    Radeon Mobility M6

    Radeon Mobility M7


3D hardware acceleration is supported for most (but not all) cards.


If you have a Radeon card not on the above list, don’t assume the card is unsupported; if it is only a minor variation of one of the supported cards, then it may

still work. In either case, if you have a Radeon card not listed above, please report whether it works for you to the XFree86 developers. (FIXME: say how to report.)


Note that the following cards are known not

to work with the radeon

driver. Support for these cards will be added in a future release of XFree86 (FIXME: check both of these assertions): </p>

ATI Radeon 9700 series

    ATI Radeon 9700


ATI Radeon 9000 series

    ATI Radeon 9000 Pro

    ATI Radeon 9000

[edit]
CONFIGURATION DETAILS

Please refer to XF86Config (5x) for general configuration details, as this section documents only the Options

which are specific to the radeon

driver.


For all cards, the driver auto-detects the specific card and the amount of video memory (RAM) present.


Unless otherwise noted, all number values given are in decimal (base 10).


The following Options

apply to all (or mostly all) Radeon cards:

Option Dac6Bit boolean

    If set to true,

    6 bits per color component are used when in 8 bpp mode. This setting emulates VGA mode. The default is false

    (meaning, all 8 bits per color component are used).


        (FIXME: why would one want to set this?)

Option Dac8Bit boolean

    This Option

    is recognized for backward compatibility, but setting it has no effect. Use the Dac6Bit

    Option

    to control whether 6 or 8 bits per color component are used when 8 bpp mode.


Option DDCMode boolean

    If set to false,

    (the default), then XFree86 will not attempt to query the monitor to discover the various video modes it supports. Rather, for each screen resolution (mode) defined in XF86Config (5x), XFree86 will pick the best matching Video Electronics Standards Association (VESA) standard mode timing which the monitor is capable of (according to its HorizSync

    and VertRefresh

    settings in XF86Config(5x). (XFree86 has a built-in list of all VESA standard mode timings.)


        If set to true,

        then instead of relying VESA standard mode timings, XFree86 will attempt to query the monitor using the VESA Display Data Channel Command Interface (DDC/CI) standard. If the display device can be successfully queried, then XFree86 will read the list of mode timings which the monitor claims to support. For each mode defined in XF86Config(5x), XFree86 will pick the best matching mode timing from the list of mode timings the monitor returns.

        Note that not all monitors and not all Radeon cards support the VESA DDC/CI standard. If DDCMode

        is enabled, but the monitor and/or card does not support the VESA DDC/CI standard, then XFree86 will emit a warning message and use the standard VESA mode timings instead.

        The advantage of not using DDCMode

        is that the VESA standard mode timings are supported by virtually all monitors. Additionally, a monitor which does not

        support the VESA standard mode timings will almost certainly not support the VESA DDC/CI standard.


        The advantage of using DDCMode

        is that your particular monitor may support non-standard (i.e., non-VESA) mode timings which are better (e.g., a higher refresh rate) than the VESA standard mode timings. Additionally, for flat panel displays being used in analog mode, DDCMode

        will avoid using unstable modes (some VESA standard modes don’t really work with these panels).

Option NoAccel boolean

    If set to true,

    all hardware acceleration is disabled (e.g., for debugging purposes). The default is false

    (meaning, hardware acceleration is enabled).


Option NoLineAccel boolean

    If set to true,

    hardware line acceleration is disabled (e.g., for debugging purposes). The default is false

    (meaning, hardware line acceleration is enabled).


        Setting this Option

        has no effect if the NoAccel

        Option

        is set to true.

Option SWcursor boolean

    If set to true,

    the software cursor is used; if false,

    the hardware cursor is used. The default is false

    (meaning, the hardware cursor is used).


        (FIXME: what is the cursor? What is the difference between software and hardware? What are the advantages and disadvantages of each?

Option UseFBDev boolean

    If set to true,

    XFree86 will attempt to use use an OS-specific framebuffer interface. See fbdevhw(4x) for further information. The default is false

    (meaning, an OS-specific framebuffer interface will not be used).


        Note that OS-specific framebuffer interfaces are not supported on all operating systems.

Option VideoKey integer

    This Option

    can be used to override the default video key value of 30.


        (FIXME: what does the video key do? Why would one want to override the default value?)


The following Options

are designed for Radeon cards with multiple video ports, such as desktop Radeon cards with both Video Graphics Array (VGA) and Digital Video Interface (DVI) connectors, and integrated laptop Radeon cards which support both a flat panel display and an external VGA connector. For desktop Radeon cards, the Cathode Ray Tube (CRT) port drives the VGA connector, and the DVI port drives the DVI connector (in either analog or digital mode); for integrated laptop Radeon cards, the CRT port drives the external VGA connector, and the DVI port drives the laptop display in digital mode).


If both ports are enabled, the DVI port will be treated as the primary port (the first screen in XF86Config(5x)), and the CRT port will be treated as the secondary port (the second screen in XF86Config(5x)). If only one screen is specified in XF86Config(5x), and the DVI port has a display connected to it, the screen will be used for the DVI port. If only one screen is specified in the XF86Config(5x), and the DVI port does not

have a display connected to it, the screen will be used for the CRT port.


Specifying these Options

for cards without multiple video ports will have no effect. (FIXME: is this true?)
</p>

The Options are:

Option CloneDisplay boolean
    If set to true, then the DVI port will be cloned onto the CRT port. The default is false (meaning, the DVI port will not be cloned onto the CRT port).

    Although two screens can be configured in XF86Config (5x) such that the same content is displayed on both screens, this scenario has problems with the cursor, overlay, and DRI. If the goal is to have only a single screen definition in XF86Config (5x), but have the contents of the screen replicated on both the DVI port and the CRT port, use the CloneDisplay Option. FIXME: the "Here is a hack for cloning first display on the second head" comments in radeon_driver.c (in the RADEONPreInitModes function) seem to imply that if both the DVI and CRT ports are being used, and both have displays connected to them, and only one screen is defined in XF86Config(5x), and CloneDisplay isn’t being used, then the monitor connected to the CRT port will be driven according to the capability of the monitor/panel connected to the DVI port. But the "VE and M6 have both DVI and CRT ports" comments (in the RADEONGetBIOSParameters function) seem to imply that if both the DVI and CRT ports are being used, and both have displays connected to them, and only one screen is defined in XF86Config(5x), then the screen will be used for the DVI port, and the CRT port won’t be used. These sets of comments seem incongruous with each other; what’s the real deal? See also the PanelOff Option.

Option PanelOff boolean
    This Option works in conjunction with the CloneDisplay option. If CloneDisplay is set to true, and PanelOff is also set to true, then the only device XFree86 will use is the CRT port instead of the DVI port, regardless of whether the DVI port has a display connected to it. The default is false (meaning, XFree86 will use both the DVI port and the CRT port, if both are enabled).

    The PanelOff Option is intended for laptop systems (which is why it’s named "PanelOff" instead of something like "DVIOff"). Unlike desktop Radeon cards, on laptops, it isn’t possible to disconnect the flat panel display from the DVI port. Because XFree86 prefers the DVI port over the CRT port if both ports have monitors connected to them (and only a single screen is defined in XF86Config(5x)), without the PanelOff Option, it wouldn’t be possible to use exclusively the external VGA connector on laptops. The PanelOff Option has no effect unless the CloneDisplay Option is set to true. </p>

Option CloneMode string
    When operating in CloneDisplay mode, the cloned display inherits the display modes from the primary display. The CloneMode Option can be used to add a single additional display mode to the display modes inherited by the cloned display from the primary display. The string argument must be a single display mode (e.g., "1280×1024").

    The CloneMode Option has no effect unless the CloneDisplay Option is set to true. See also the CloneHSync and CloneVRefresh Options.

Option CloneHSync string
    When operating in CloneDisplay mode, the CloneHSync Option can be used to specify the horizontal sync range for the monitor attached to the cloned display.

    Note that unlike the HorizSync and VertRefresh Options, which allow great flexibility in how frequency ranges are specified (see the descriptions in XF86Config(5x)), the argument to the CloneHSync Option is a string, in the form of lower-upper, where lower and upper are floating-point numbers. (For example, "30-95.5" would be a valid argument to the CloneHSync Option.) The CloneHSync Option has no effect unless the CloneDisplay Option is set to true. See also the CloneMode and CloneVRefresh Options.

Option CloneVRefresh string
    When operating in CloneDisplay mode, the CloneVRefresh Option can be used to specify the vertical refresh range for the monitor attached to the cloned display.

    Note that unlike the HorizSync and VertRefresh Options, which allow great flexibility in how frequency ranges are specified (see the descriptions in XF86Config(5x)), the argument to the CloneVRefresh Option is a string, in the form of lower-upper, where lower and upper are floating-point numbers. (For example, "48.5-160" would be a valid argument to the CloneVRefresh Option.) The CloneVRefresh Option has no effect unless the CloneDisplay Option is set to true. See also the CloneMode and CloneHSync Options.

The following Options can be used to override default values for Direct Rendering Interface (DRI) support. The default values do not typically need to be overridden. The radeon driver does not currently support DRI on all Radeon cards. If DRI is not supported on a particular card, DRI support will not be enabled, and all DRI-related Options will be silently ignored. The Options are:

Option ForcePCIMode boolean

    This Option

    can be used to force DRI to use the PCI bus, instead of the AGP bus. The default is false

    (meaning, DRI will use the AGP bus).


        Note that DRI currently supports the PCI bus only on the alpha

        architecture. If you set ForcePCIMode

        on any other architecture, DRI support will be disabled.


        (FIXME: I’m probably misunderstanding this option. How would one force an AGP Radeon card to work on the PCI bus? Or a PCI Radeon card (are there any?) to work on the AGP bus? Are there "dual-bus" integrated Radeon cards floating around, which can sit on either the PCI or AGP bus?)

Option CPPIOMode boolean

    This Option

    can be used to force the CP into Programmable I/O (PIO) mode instead of BM mode. The default is false

    (meaning, the CP will use BM mode).


        (FIXME: What is CP? What is BM? What are the advantages and disadvantages of using PIO versus BM?) </p>

Option CPusecTimeout integer

    This Option

    can be used to override the default CPusecTimeout value of 10000. (FIXME: what does this do? Why would one want to override the default value?)


Option AGPMode integer

    This Option

    controls the transmission rate of the AGP bus. The default value (used if the AGPMode

    Option

    isn’t specified) is 1.

    Setting AGPMode

    to 2

    will double the transmission rate; setting AGPMode

    to 4

    will quadruple the transmission rate.


        Higher rates usually offer at least slightly better performance, but the desired rate must be supported by both your system and your particular Radeon card. (Note that some systems can have stability problems with higher rates.)


        Legal values for the AGPMode

        Option

        are 1

        through 4,

        inclusive. (Note that although 3

        is accepted as a legal value, very few systems will support it.)


        (FIXME: on PCs, does XFree86 actually override the AGP mode as set in the system BIOS?)

Option AGPSize integer

    This Option

    sets the AGP aperture size, in units of megabytes. The default value (used if the AGPSize

    Option

    isn’t specified) is 8.


        Legal values for AGPSize

        are 4

        through 256,

        inclusive, in powers of two. (I.e., 4,

        8,

        16,

        32,

        64,

        128,

        and 256.)

        The AGP aperture size is the maximum amount of system RAM that the AGP bus can appropriate (e.g. for storing textures). The more video RAM an AGP card has, the less likely it is that the card will run out of video RAM and have to "steal" system RAM.


        Typically reasonable values for the AGP aperture size are 64

        and 128.

        The larger the AGP aperture size, the larger the Graphics Address Remapping Table (GART) table will be, so setting the AGP aperture size to an arbitrarily high value isn’t a good idea, especially as high values will not improve performance.


        (FIXME: on PCs, does XFree86 actually override the AGP aperture size as set in the system BIOS?)

Option RingSize integer

    This Option

    controls the size of the ring buffer, in units of megabytes. The default value (used if the RingSize

    Option

    isn’t specified) is 1.


        Legal values for RingSize

        are 1

        through AGPSize,

        inclusive.


        (FIXME: what does this do? In PCs, does this correspond to one of the common AGP-related BIOS options? If so, does XFree86 actually override the value set in the system BIOS?) </p>

Option BufferSize integer

    This Option

    controls the size of the vertex/indirect buffers, in units of megabytes. The default value (used if the BufferSize

    Option

    isn’t specified) is 2.


        Legal values for BufferSize

        are 1

        and 2.

        (If a value greater than 2

        is specified, it will be noisily clamped to 2.)

        BufferSize

        must also be less than AGPSize.

        Finally, the sum of RingSize,

        BufferSize,

        and the AGP texture size (1 MB; not customizable) must be less than or equal to AGPSize.


        (FIXME: is this explanation correct? In PCs, does this correspond to one of the common AGP-related BIOS options? If so, does XFree86 actually override the value set in the system BIOS?) </p>

Option EnableDepthMoves boolean

    If set to true,

    then depth moves are enabled. Since depth moves are extremely slow, the default is false

    (meaning, depth moves are disabled).


        (FIXME: what are depth moves? Find out and flush out this explanation more.)

[edit]
SEE ALSO

XFree86</a>(1)

XF86Config(5x)

xf86config(1)

Xserver(1)

X (7x)

fbdevhw(4x)
[edit]
AUTHORS

Authors include: Kevin E. Martin, Rickard E. Faith, Alan Hourihane. Patches have been contributed by many others.

Initial credits to Ani Joshi, for providing source code to his Radeon driver.
[edit]
Index

#NAME
#SYNOPSIS
#DESCRIPTION
#SUPPORTED HARDWARE
#CONFIGURATION DETAILS
#SEE ALSO
#AUTHORS

This document was created by man2html, using the manual pages.
Time: 22:27:36 GMT, November 12, 2002

前一段时间给我的Linux安装上了DRI驱动。但是有两个问题一直没有解决,一个是agp aperture太小,被限制到了8M;一个是agp的速度太低,被限制到了1x。今天在网上查到一个文档
Radeon Manual Page(use keywords:dri agp aperture option)
根据这篇文档,只需要在
Drivers "radeon"
后面添加
Option "AGPMode" "4"
Option "AGPSize" "256"
Option "RingSize" "32"
#Option "BufferSize" "2"
就可以解决。

其中AGPSize就是传说中的AGP Aperture的大小,DRI不会读取BIOS或者VRAM中的aperture的设置。我们必须
用agpsize参数设置它。
RingSize控制Ring Buffer的大小。最好不要超过aperture的1/8,不然会引起OpenGL程序Crash。
BufferSize控制Vertex/Indirect Buffer的大小。最大只能设置为2M,(最小只能设为1),超过了DRI会忽略它。
基本上ring buffer + vertex/indirect buffer + texture buffer = agp aperture
这一点可以通过查阅X的启动记录来确定(/var/log/Xorg.0.log)
根据常识(熟悉BIOS的人都知道的),AGP Aperture不要超过主存总容量的1/2。

心情太激动了,要马上去试一试。

2006年05月07日

经历了简单的学习xhtml+css,和对页面模型进行分析之后。鄙人的第一个自制Blog theme终于诞生了。那,就是你现在看到的这个绿油油的家伙。
感谢亲爱的小卞同志提供网络接入服务,当然他的小鸡炖蘑菇也非常好吃。祝愿他早日将心上人追到手。
第一期工程只定义了
.header{
}

body{
}
的background-image,
以后会慢慢添加别的东西。

由于FC将字符编码统一成了UTF8,原来在gb18030下建立的ext3分区中的文件和目录,一挂载到FC上就显示成乱码。google遍整个互联网,说对于目录名和文件名,有一个叫convmv的软件可以对其进行自动转换。
今日下载了convmv,摸索了一套使用方法如下:
convmv -f code1 -t code2 -r <dir>
code1:分区原来使用的字符集编码。支持gb2312、gbk、big5,不支持gb18030和big5-hkscs。
code2:预转换到的字符集编码。对于FC,这里填写utf8
-r 参数:转换子目录。
dir:要转换的目录,当前目录用./表示。
回车执行,这个时候convmv会显示执行的结果,但不会真正对文件进行修改。并提示使用–replace参数进行修改。

在linux下驱动显卡基本上有两个选择:
一个就是官方的驱动,比如ATi和NVidia都有自己的linux驱动程序;
另一个选择,就是DRI项目了。

在这里我不想讲太多的原理,只想记录一下自己安装r300的过程。
现介绍一下我的电脑:
CPU:Celeron M 1.5GHz (Banias familys)
RAM:768M PC333 DDR
Disk:40G Samsung MP0402H
Card:Mobility Radeon 9700 (pciid:0×4E52)
MotherBoard:Intel 855PM
OS:Fedora core 5

这里需要说明一下OpenGL, mesa, DRI和r300之间的关系。
OpenGL是一个著名的API标准,其主要作用是依据照相机的设置,将指定图元绘制到帧缓冲中去。目前版本是2.0
Mesa是OpenGL的一个具体实现,目前版本是6.4.2。
DRI的全称是直接选然架构(Direct Rander Infrustructure)。Mesa对于OpenGL的实现是纯软件的。DRI提供了一个安全的接口,让Mesa(以及其他OpenGL实现)可以安全的使用显卡提供的硬件加速功能。
r300是DRI的一个子项目,针对ATi的代号r300及以上(9500及以上)的显卡提供支持。其原始网站在http://r300.sf.net,现在全部代码以加入DRI的代码树中。

巧妇难为无米之炊,先去下载需要的东西:

r300

http://dri.freedesktop.org/snapshots/r300-20060403-linux.i386.tar.bz2


然后,安装kernel-devel包,在FC5的安装光盘里可以找到这个东西。
有两个,
一个是kernel-devel-2.6.15-1.2054_FC5.i586.rpm,
另一个是kernel-devel-2.6.15-1.2054_FC5.i686.rpm
具体需要安装那个用命令
uname -p -r
确定。选择错了也没关系,可以卸了重装。不过编译的模块,在载入时会出现"invalid module format"的错误。
安装好kernel-devel以后,到/lib/module/2.6.15-1.2054_FC5目录下,确定一下build和source两个链接的指向是否正确。

开始编译
$tar -xjvf r300-20060403-linux.i386.tar.bz2
$cd r300-20060403-linux.i386/drm/linux-core
$make
安装
$su
#cp drm.ko radeon.ko /lib/module/2.6.15-1.2054_FC5/kernel/drivers/char/drm -f
#cd ../../r300
#cp ati_drv.so radeon_drv.so /usr/lib/xorg/modules/drivers -f
#cp r300_dri.so /usr/lib/dri -f
#cd /lib/module/2.6.15-1.2054_FC5
#demod -ae
载入
#depmod radeon
然后重启X,就OK了
可以用
$glxinfo |grep direct
确认DRI是否起作用了,起作用时显示:
direct rendering: Yes
否则显示
direct rendering: No

其他:
1、如果在drm/linux-core目录下执行过make clean……
如果在drm/linux-core目录下执行过make clean,那么再次执行make的时候,会提示缺少../script目录下的一些文件。这个文件可以cvs dri项目的drm目录来得到。或者
===============create_linux_pci_list.sh==============
#! /bin/bash
#
# Script to output Linux compatible pci ids file
#  – Copyright Dave Airlie 2004 (airlied@linux.ie)
#
OUTFILE=drm_pciids.h

finished=0

cat > $OUTFILE <<EOF
/*
   This file is auto-generated from the drm_pciids.txt in the DRM CVS
   Please contact dri-devel@lists.sf.net to add new cards to this list
*/
EOF

while read pcivend pcidev attribs pciname
do
    if [ "x$pcivend" = "x" ]; then
        if [ "$finished" = "0" ]; then
            finished=1
            echo "    {0, 0, 0}" >> $OUTFILE
            echo >> $OUTFILE
        fi
    else
   
        cardtype=`echo "$pcivend" | cut -s -f2 -d’[' | cut -s -f1 -d']‘`
        if [ "x$cardtype" = "x" ];
        then
            echo "    {$pcivend, $pcidev, PCI_ANY_ID, PCI_ANY_ID, 0, 0, $attribs}, \\" >> $OUTFILE
        else
            echo "#define "$cardtype"_PCI_IDS \\" >> $OUTFILE
            finished=0
        fi
    fi
done

if [ "$finished" = "0" ]; then
    echo "    {0, 0, 0}" >> $OUTFILE
fi
======================end============================

2、发现AGP工作在1x状态下,这个用dmesg可以查看,解决方法暂时不知道。正在看DRI的文档。
3、发现AGP aperture被设定成只有8M,在运行一些程序的时候,出现out of vertex memory的现象。暂时也无法解决。