LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1256|回复: 6

使用r300_dri.so打开ATI R300以上的Direct Rendering

[复制链接]
发表于 2006-9-25 14:19:10 | 显示全部楼层 |阅读模式
转载请注明出处

0. 前言

对于ATI用户,安装fglrx可能更是一个痛苦的过程:每次内核升级都可能会使老版本驱动的内核模块无法编译;某些发行版的用户还会因为某些组建的升级而导致fglrx不得不被卸载。从实用性的角度来看,fglrx可能还要逊于Xorg的ati驱动。以下节录自gentoo-wiki:

"fglrx driver... Uses an ancient version of the DRI driver API that can't work with the new driver loader. "

Xorg的驱动官方支持Radeon 7000到9250的Direct Rendering。因此,9500以上的用户只能无奈的选择fglrx。但是,通过r300_dri.so是能够打开9500以上显卡的Direct Rendering的!只不过DRI支持被默认关闭了而已。

本文所述的方法在Mobility Radeon 9600和Radeon X550上试验成功(感谢师父种草得草的协助)。

警告:对9500以上显卡的Direct Rendering目前是处于试验阶段,实际性能相当凄惨。虽然Direct Rendering可以打开,并且可以获得很高的glxgears FPS,也足以达到不错的compiz效果,但是实际3D应用的性能不能令人满意,如鄙人MR9600的google-earth只能3秒种刷一帧……因此,需要使用3D应用的同志们(如游戏)还是请继续使用fglrx。

1. 环境

1.1 内核选项

内核需要2.6.14版本以上,并且请保证以下内核选项已选为y或M,且模块已被正确加载。
  1. CONFIG_AGP=y
  2. CONFIG_AGP_INTEL=y
  3. CONFIG_DRM=y
  4. CONFIG_DRM_RADEON=y
复制代码

并打开内核AGP支持,以Intel芯片组为例:
  1.     Device Drivers --->
  2.         Character devices --->
  3.             <M> /dev/agpgart (AGP Support)
  4.             <M> Intel 440LX/BX/GX, I8xx and E7x05 chipset support
复制代码
如果一切正常,请确保/dev/dri/card0设备存在。

1.2 Mesa

Mesa需要至少6.3.2。请确保系统中能找到r300_dri.so,类似以下位置:
/usr/lib/X11/modules/dri/r300_dri.so

2 X设置

首先检查dri已被加载
  1. Section "Module"
  2.         ...
  3.         module "dri"
  4.         ...
  5. EndSection
复制代码
注:GLcore在xorg 7.0 cvs以后不再需要。

接着修改Device段。这一部分是打开DRI的关键。请确保至少以下选项被正确设置。
[php]
Section "Device"
        ...
        Option        "AGPFastWrite"        "off"        # 我的系统使用"on"会死掉。各位不妨on看看,不行再改回来。
        Option        "AGPMode"        "4"        # 8x的就写8
        Option        "DynamicClocks"        "on"
        Option        "ColorTiling"        "on"
        ...
EndSection
[/php]
注:我这里Driver选ati或radeon均可。希望各位能加以反馈。

好了,现在可以重启X。由于系统间的不同,可能会由于r300_dri.so的位置和查找位置不同导致失败。请使用以下命令检查:

$ LIBGL_DEBUG=verbose glxinfo

如果"Direct Rendering: No",看看最开始是否有因找不到r300_dri.so而加载失败的错误,在其查找的位置建立r300_dri.so的符号连接即可。

3 后记
X的Device段还有很多设置可以修改以改善效果。贴出鄙人的设置以供参考。
[php]
Section "ServerLayout"
        Identifier     "X.org Configured"
        Screen      0  "Screen0" 0 0
        InputDevice    "Mouse0" "CorePointer"
        InputDevice    "Synaptics Mouse" "AlwaysCore"
        InputDevice    "Keyboard0" "CoreKeyboard"
        Option         "AIGLX" "true"
EndSection

Section "Files"
        RgbPath      "/usr/lib/X11/rgb"
        ModulePath   "/usr/lib/X11/modules"
        FontPath     "/usr/lib/X11/fonts/misc/"
        FontPath     "/usr/lib/X11/fonts/TTF/"
        FontPath     "/usr/lib/X11/fonts/OTF"
        FontPath     "/usr/lib/X11/fonts/Type1/"
        FontPath     "/usr/lib/X11/fonts/CID/"
        FontPath     "/usr/lib/X11/fonts/100dpi/"
        FontPath     "/usr/lib/X11/fonts/75dpi/"
        FontPath     "/usr/share/fonts/dejavu/"
EndSection

Section "Module"
        Load  "dbe"
        Load  "record"
        Load  "glx"
        Load  "extmod"
        Load  "xtrap"
        Load  "dri"
        Load  "freetype"
        Load  "type1"
        Load  "synaptics"
EndSection

Section "Extensions"
        Option        "Composite" "true"
EndSection

Section "InputDevice"
        Identifier  "Keyboard0"
        Driver      "kbd"
        Option            "XkbModel" "pc104"
        Option            "XkbLayout" "us"
EndSection

Section "InputDevice"
        Identifier  "Mouse0"
        Driver      "mouse"
        Option            "rotocol" "ImPS/2"
        Option            "Device" "/dev/input/mice"
        Option            "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
  Identifier          "Synaptics Mouse"
  Driver          "synaptics"
  Option         "Device"          "/dev/psaux"
  Option        "rotocol"        "auto-dev"
  Option        "LeftEdge"      "1700"
  Option        "RightEdge"     "5300"
  Option        "TopEdge"       "1700"
  Option        "BottomEdge"    "4200"
  Option        "FingerLow"        "25"
  Option        "FingerHigh"        "30"
  Option        "MaxTapTime"        "180"
  Option        "MaxTapMove"        "220"
  Option        "VertScrollDelta" "100"
  Option        "MinSpeed"        "0.09"
  Option        "MaxSpeed"        "0.18"
  Option        "AccelFactor"        "0.0015"
  Option        "SHMConfig"        "on"
#  Option        "Repeater"        "/dev/ps2mouse"
EndSection

Section "Monitor"
        Identifier   "Monitor0"
        VendorName   "Monitor Vendor"
        ModelName    "Monitor Model"
        HorizSync    31.5 - 48.5
        VertRefresh  50.0 - 70.0
EndSection

Section "Device"

        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option     "NoAccel"                    # [<bool>]
        #Option     "SWcursor"                   # [<bool>]
        #Option     "Dac6Bit"                    # [<bool>]
        #Option     "Dac8Bit"                    # [<bool>]
        #Option     "BusType"                    # [<str>]
        #Option     "CPPIOMode"                  # [<bool>]
        #Option     "CPusecTimeout"              # <i>
        Option     "AGPMode"            "4"        # <i>
        #Option     "AGPFastWrite"       "1"        # [<bool>]
        #Option     "AGPSize"                    # <i>
        Option     "GARTSize"           "64"        # <i>
        #Option     "RingSize"                   # <i>
        #Option     "BufferSize"                 # <i>
        Option     "EnableDepthMoves"   "1"        # [<bool>]
        Option     "EnablePageFlip"     "1"        # [<bool>]
        #Option     "NoBackBuffer"               # [<bool>]
        #Option     "DMAForXv"                   # [<bool>]
        Option     "FBTexPercent"       "50"        # <i>
        #Option     "anelOff"                   # [<bool>]
        #Option     "DDCMode"                    # [<bool>]
        Option     "MonitorLayout"      "LCD, NONE"        # [<str>]
        #Option     "IgnoreEDID"                 # [<bool>]
        #Option     "UseFBDev"                   # [<bool>]
        #Option     "MergedFB"                   # [<bool>]
        #Option     "CRT2HSync"                  # [<str>]
        #Option     "CRT2VRefresh"               # [<str>]
        #Option     "CRT2Position"               # [<str>]
        #Option     "MetaModes"                  # [<str>]
        #Option     "MergedDPI"                  # [<str>]
        #Option     "MergedXinerama"             # [<bool>]
        #Option     "MergedXineramaCRT2IsScreen0"         # [<bool>]
        #Option     "MergedNonRectangular"         # [<bool>]
        #Option     "MergedMouseRestriction"         # [<bool>]
        Option     "DisplayPriority"    "HIGH"        # [<str>]
        #Option     "anelSize"                  # [<str>]
        #Option     "ForceMinDotClock"           # <freq>
        Option     "ColorTiling"        "1"        # [<bool>]
        #Option     "VideoKey"                   # <i>
        #Option     "RageTheatreCrystal"         # <i>
        #Option     "RageTheatreTunerPort"         # <i>
        #Option     "RageTheatreCompositePort"         # <i>
        #Option     "RageTheatreSVideoPort"         # <i>
        #Option     "TunerType"                  # <i>
        #Option     "RageTheatreMicrocPath"         # <str>
        #Option     "RageTheatreMicrocType"         # <str>
        #Option     "RenderAccel"        "1"        # [<bool>]
        Option     "SubPixelOrder"      "RGB"        # [<str>]
        #Option     "ShowCache"                  # [<bool>]
        Option     "DynamicClocks"      "1"        # [<bool>]
        #Option     "BIOSHotkeys"                # [<bool>]
        Option     "VGAAccess"          "0"        # [<bool>]
        #Option     "ReverseDDC"                 # [<bool>]
        #Option     "LVDSProbePLL"               # [<bool>]
        Option     "AccelMethod"        "1"        # <str>
        Option     "ConstantDPI"        "1"        # [<bool>]
        # Newly add
        Option     "XAANoOffscreenPixmaps" "true"
        Option     "DRI" "true"
        # End Newly Add
        Identifier  "Card0"
#        Driver      "ati"
        Driver      "radeon"
        VendorName  "ATI Technologies Inc"
        BoardName   "RV350 [Mobility Radeon 9600 M10]"
        Card        "** ATI Radeon (generic)               [radeon]"
        BusID       "CI:1:0:0"
EndSection

Section "Screen"
        Identifier "Screen0"
        Device     "Card0"
        Monitor    "Monitor0"
        DefaultDepth     24
        SubSection "Display"
                Viewport   0 0
                Depth     1
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     4
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     8
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     15
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     16
        EndSubSection
        SubSection "Display"
                Viewport   0 0
                Depth     24
                Modes    "1024x768" "800x600" "640x480"
        EndSubSection
EndSection

Section "DRI"
        Group        "video"
        Mode         0660
EndSection
[/php]
打开Direct Rendering是改进X显示效果的基础。在此基础上,Intel和ATi显卡可以获得更好的性能,以便使用aiglx(http://fedoraproject.org/wiki/RenderingProject/aiglx),等等。

4 鸣谢

感谢种草得草合作以及销魂,萝莉等的指导。

5 参考资料
http://www.thinkwiki.org/wiki/R300
http://ru.gentoo-wiki.com/HOWTO_ ... for_ATI_Radeon_9600

附:问题在所难免,请各位积极反馈,以便改进。
发表于 2006-9-25 14:22:49 | 显示全部楼层
ft , 楼上的还没有回头是岸……
回复 支持 反对

使用道具 举报

发表于 2006-9-25 14:23:16 | 显示全部楼层
赞啊赞,第一个顶!

可惜我是nv卡。。。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-9-25 14:28:05 | 显示全部楼层
Post by jhuangjiahua
ft , 楼上的还没有回头是岸……

好好学习,天天向上……
回复 支持 反对

使用道具 举报

发表于 2006-9-25 15:23:59 | 显示全部楼层
n卡的还是幸福啊,AIGLX终于可以使用了。
回复 支持 反对

使用道具 举报

发表于 2006-9-25 15:41:21 | 显示全部楼层
据说N卡的新驱动Bug太多,虽然可以用pixel_from_bitmap扩展
回复 支持 反对

使用道具 举报

发表于 2006-10-1 23:15:48 | 显示全部楼层
n卡那个驱动是自己的实现,不是aiglx
beryl现在启动时会作三项检查,依次是xgl, nvidia和aiglx
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表