一直不知道i915的显卡还能使用MergedFB,原来在试验双显示器的时候,只用过Xinerama,但Xinerama使用后会禁止DRI,导致不能使用硬件加速以及AIGLX和XGL等三维效果。

主要的配置都在/etc/X11/xorg.conf的文件里。
关键的部分,一个是在Device节里:

Option "MergedFB" "true"

另外一个部分是在Screen节里:

SubSection "Display"
Depth 24
Virtual 1560 1024
EndSubSection

SubSection "Display"
Depth 24
Modes "1400x1050 1280x1024 1024x768"
EndSubSection

要添加一个Virtual的桌面大小定义。通常这个Virtual的桌面就是两个显示器的分辨率之和。
我的xorg.conf配置:

Section "Files"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
# path to defoma fonts
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/input/wacom"
Option "Type" "eraser"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/input/wacom"
Option "Type" "cursor"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "Device"
Identifier "Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller"
Driver "i810"
BusID "PCI:0:2:0"
VideoRam 131072
# Screen 0
Option "No2048Limit" "true"
Option "DRI" "true"
Option "MergedFB" "true"
Option "DDCMode" "true"
Option "MonitorLayout" "CRT,LFP"
Option "SecondPosition" "LeftOf"
Option "MetaModes" "1024x768-1280x1024 1024x768"
Option "MergedNonRectangular" "ture"
Option "XAANoOffscreenPixmaps" "true"
Option "MergedXinerama" "true"
Option "crt2hsync" "30-82"
Option "crt2vrefresh" "50-85"
EndSection

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 28-51
VertRefresh 43-60
EndSection

Section "Screen"
Identifier "Default Screen"
Device "Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Virtual 2048 1024
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "MergedFB"
Screen 0 "Default Screen" 0 0
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "stylus" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
EndSection

Section "DRI"
Mode 0666
EndSection

郁闷的是,No2048Limit参数不起作用,不知道什么原因,导致我最大只能使用2048的宽度,在两个屏幕中间会有重合的部分,不爽。
还有,我一开始看库里还有一个xserver-xorg-video-intel的包,这个的版本更新一些,就稀里糊涂地装上,导致后面很长时间都没搞定,还是最后恢复成xserver-xorg-video-i810才搞定,还没搞清楚这两个包有什么关系。

参考:
1 http://dri.freedesktop.org/wiki/MergedFB
2 http://ubuntuforums.org/showthread.php?t=221174