debian下X61T的 965GM显卡驱动安装

/之前已经安装了xserver-xorg-video-intel
//并且在/etc/X11/xorg.conf里加了这些
Section "Module"
    Load    "bitmap"
    Load    "ddc"
    Load    "dri"
    Load    "extmod"
    Load    "freetype"
    Load    "glx"
    Load    "int10"
    Load    "vbe"
EndSection

Section "Device"
    Identifier    "Intel Corporation Mobile GM965"
    Driver        "intel"
        BusID           "PCI:0:2:0"
        Option          "monitor-VGA"  "VGA"
        Option          "monitor-TV"   "TV"
#         Option "NoXVideo"    "true"
        Option          "DRI"          "true"
        Option  "VideoRam"      "65536"
        Option  "CacheLines"    "1980"
        Option "LinearAlloc" "8160"
EndSection

Section "dri"
   Mode 0666
EndSection

//可以跑起来,但是direct rendering没有打开
CHEUNG:~# glxinfo
name of display: :0.0
display: :0 screen: 0
direct rendering: No

//而且glxgears的结果也不理想
CHEUNG:~# glxgears -iacknowledgethatthistoolisnotabenchmark
2325 frames in 5.0 seconds = 462.741 FPS
2300 frames in 5.0 seconds = 457.795 FPS
2500 frames in 5.0 seconds = 498.404 FPS
2520 frames in 5.0 seconds = 500.218 FPS
2500 frames in 5.0 seconds = 499.846 FPS
2540 frames in 5.0 seconds = 505.110 FPS
2500 frames in 5.0 seconds = 498.765 FPS
2480 frames in 5.0 seconds = 495.993 FPS
2500 frames in 5.0 seconds = 499.181 FPS
2340 frames in 5.0 seconds = 467.943 FPS
2280 frames in 5.0 seconds = 454.361 FPS

//查看/var/log/Xorg.0.log 发现问题
CHEUNG:~# cat /var/log/Xorg.0.log | grep direct
(II) intel(0): direct rendering: Enabled
(EE) AIGLX error: dlopen of /usr/lib/dri/i965_dri.so failed (/usr/lib/dri/i965_dri.so: cannot open shared object file: No such file or directory)

//所以到intel.com看了一下,又到www.intellinuxgraphics.org逛了一下
//然后还到www.freedesktop.org看了一下资料,大概解决了问题

//关键就是在于mesa

//先按www.freedesktop.org的wiki安装mesa 7.1,如果不是debian用户使用官方方法如下
CHEUNG:~# apt-get install git-core

CHEUNG:~# git-clone git://git.freedesktop.org/git/mesa/drm
CHEUNG:~# cd drm
CHEUNG:~/drm# ./autogen.sh
CHEUNG:~/drm# make
CHEUNG:~/drm# make install

CHEUNG:~/drm# cd ..
CHEUNG:~# git-clone git://git.freedesktop.org/git/xorg/proto/dri2proto
CHEUNG:~# cd dri2proto
CHEUNG:~/dri2proto# ./autogen.sh
CHEUNG:~/dri2proto# make install

CHEUNG:~/dri2proto# cd ..
CHEUNG:~# wget http://xorg.freedesktop.org/releases/individual/proto/xf86vidmodeproto-2.2.2.tar.bz2
CHEUNG:~# tar xvf xf86vidmodeproto-2.2.2.tar.bz2
CHEUNG:~# cd xf86vidmodeproto-2.2.2
CHEUNG:~/xf86vidmodeproto-2.2.2# ./autogen.sh
CHEUNG:~/xf86vidmodeproto-2.2.2# make install

CHEUNG:~/xf86vidmodeproto-2.2.2# cd ..
CHEUNG:~# git-clone git://git.freedesktop.org/git/xorg/lib/libXxf86vm
CHEUNG:~# cd libXxf86vm
CHEUNG:~/libXxf86vm# ./autogen.sh
CHEUNG:~/libXxf86vm# make
CHEUNG:~/libXxf86vm# make install

CHEUNG:~/libXxf86vm# cd ..
CHEUNG:~# wget http://xorg.freedesktop.org/releases/individual/proto/damageproto-1.1.0.tar.bz2
CHEUNG:~# tar xvf damageproto-1.1.0.tar.bz2
CHEUNG:~# cd damageproto-1.1.0
CHEUNG:~/damageproto-1.1.0# ./autogen.sh
CHEUNG:~/damageproto-1.1.0# make install

CHEUNG:~/damageproto-1.1.0# cd ..
CHEUNG:~# git-clone git://git.freedesktop.org/git/xorg/lib/libXdamage
CHEUNG:~# cd libXdamage
CHEUNG:~/libXdamage# ./autogen.sh
CHEUNG:~/libXdamage# make
CHEUNG:~/libXdamage# make install

CHEUNG:~/libXdamage# cd ..
CHEUNG:~# apt-get install x11proto-gl-dev
CHEUNG:~# git-clone git://anongit.freedesktop.org/git/mesa/mesa
CHEUNG:~# cd mesa
CHEUNG:~/mesa# ./autogen.sh –with-dri-drivers=”i915 i965″
CHEUNG:~/mesa# make
CHEUNG:~/mesa# make install

//如果是debian用户可以直接用sid源安装最新的 libgl1-mesa-dri
//免去上面那么复杂
CHEUNG:~# apt-get update
CHEUNG:~# apt-get install libgl1-mesa-dri libgl1-mesa-glx

//再重启X试试
CHEUNG:~# cat /var/log/Xorg.0.log | grep AIGLX
(==) AIGLX enabled
(WW) AIGLX: 3D driver claims to not support visual 0×23
(WW) AIGLX: 3D driver claims to not support visual 0×24
(WW) AIGLX: 3D driver claims to not support visual 0×25
(WW) AIGLX: 3D driver claims to not support visual 0×26
(WW) AIGLX: 3D driver claims to not support visual 0×27
(WW) AIGLX: 3D driver claims to not support visual 0×28
(WW) AIGLX: 3D driver claims to not support visual 0×29
(WW) AIGLX: 3D driver claims to not support visual 0×2a
(WW) AIGLX: 3D driver claims to not support visual 0×2b
(WW) AIGLX: 3D driver claims to not support visual 0×2c
(WW) AIGLX: 3D driver claims to not support visual 0×2d
(WW) AIGLX: 3D driver claims to not support visual 0×2e
(WW) AIGLX: 3D driver claims to not support visual 0×2f
(WW) AIGLX: 3D driver claims to not support visual 0×30
(WW) AIGLX: 3D driver claims to not support visual 0×31
(WW) AIGLX: 3D driver claims to not support visual 0×32
(II) AIGLX: Loaded and initialized /usr/lib/dri/i965_dri.so

//总算是成功加载并且启用drm
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 9, (OK)
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 9, (OK)
drmOpenByBusid: Searching for BusID pci:0000:00:02.0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 9, (OK)
drmOpenByBusid: drmOpenMinor returns 9
drmOpenByBusid: drmGetBusid reports pci:0000:00:02.0
(II) [drm] DRM interface version 1.3
(II) [drm] DRM open master succeeded.
(II) intel(0): [drm] Using the DRM lock SAREA also for drawables.
(II) intel(0): [drm] framebuffer mapped by ddx driver
(II) intel(0): [drm] added 1 reserved context for kernel
(II) intel(0): X context handle = 0×1
(II) intel(0): [drm] installed DRM signal handler
(**) intel(0): Framebuffer compression disabled
(**) intel(0): Tiling enabled
(==) intel(0): VideoRam: 262144 KB
(**) intel(0): Requested 1980 cache lines
(II) intel(0): Attempting memory allocation with tiled buffers.
(II) intel(0): Tiled allocation successful.
(II) intel(0): [drm] Registers = 0xfc000000
(II) intel(0): [drm] ring buffer = 0xd0000000
(II) intel(0): [drm] mapped front buffer at 0xd0100000, handle = 0xd0100000
(II) intel(0): [drm] mapped back buffer at 0xd1a00000, handle = 0xd1a00000
(II) intel(0): [drm] mapped depth buffer at 0xd2040000, handle = 0xd2040000
(II) intel(0): [drm] mapped classic textures at 0xd2680000, handle = 0xd2680000
(II) intel(0): [drm] Initialized kernel agp heap manager, 33554432
(II) intel(0): [dri] visual configs initialized
(II) intel(0): Page Flipping disabled

//最后确定一下,终于看到了“yes”
CHEUNG:~# glxinfo |grep direct
direct rendering: Yes

//再测试一下,呵呵,很明显,比之前快多了,一倍都不止
CHEUNG:~# glxgears -iacknowledgethatthistoolisnotabenchmark
5236 frames in 5.0 seconds = 1047.103 FPS
5609 frames in 5.0 seconds = 1121.781 FPS
5596 frames in 5.0 seconds = 1119.156 FPS
5612 frames in 5.0 seconds = 1122.285 FPS
5601 frames in 5.0 seconds = 1120.121 FPS
5610 frames in 5.0 seconds = 1121.820 FPS
5601 frames in 5.0 seconds = 1120.085 FPS
5602 frames in 5.0 seconds = 1120.340 FPS