Sign in to follow this  
Followers 0
systems_glitch

Dual Monitors on a Thinkpad T40

3 posts in this topic

There don't seem to be too many resources out there for running dual monitors using the integrated graphics card on a laptop, so I thought I'd do a post on it. This should work for any laptop using the ATI Radeon Mobility M7 graphics controller, and probably any other ATI graphics controllers supporting dual monitors on a single card. I currently use Debian Etch, but this should work with any fairly recent release of X.

I use an IBM Thinkpad T40, which has the usual 15-pin D Sub connector for an external monitor. In Windows, I was always given the option of either duplicating the laptop's display, switching only to the external display, or extending the desktop onto the external display as a dual monitor setup. In Linux, though, I can either run it as a duplicate of the laptop display, or as the only display -- no simple way of selecting it as a second monitor to extend to with Xinerama, etc. Most of the guides for running dual monitors under Linux focus on having two different graphics cards rather than just one that supports a dual monitor setup. The card in the T40, an ATI Radeon Mobility M7, does support dual monitors though. I did manage to find one guide for using dual monitors on the M7 card though:

[url="http://roback.cc/howtos/2micehowto.php"]http://roback.cc/howtos/2micehowto.php[/url]

(As warned, dual monitors with the Xorg radeon driver disables DRI)

That guy's xorg.conf file, while intended for a Gateway system, required little modification for use in my system. It doesn't include a proper ServerLayout section though. Here's the clip from my xorg.conf:

[code]Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Screen0"
Screen 1 "Screen1" RightOf "Screen0"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
Option "AIGLX" "on"
EndSection[/code]

This works perfectly with my setup! I modified the second screen specification to run at 1280x1024, the resolution of my external monitor. XFCE is, of course, dual monitor aware, and has no trouble managing it.

There is, however, a problem: things like Google Earth tend to crash the X server when you try to run them in dual monitor mode, at least when using a Radeon Mobility M7 to run both monitors. Also, this is a laptop, so I won't always have dual monitors connected to it. [url="http://blog.dotkam.com/index.php/2007/06/02/switch_between_dual-single_monitor_on_ubuntu_linux/"]This site[/url] suggests a method of switching between the two using Bash aliases and sudo commands. While this works, it's kind've clunky, and requires switching down to a virtual console to switch. There's a simpler way, however, if you use the Gnome Display Manager: I created two shell scripts, stuck them in /usr/local/bin, and made them executable. As suggested in the aforementioned link, they copy one of two alternate xorg.conf files to xorg.conf and reload the display manager with these new settings. This is not on the whole different from the method mentioned, except I then added them as menu items in GDM. You do this by clicking Actions > Configure Display Manager (in GDM itself). You then give the root password, and select the General tab. Click the "Edit Commands" button near the bottom. Drop down the command drop box, and select Custom Command 0 (or higher, if you already have custom commands). Fill out the information, putting the path for one of the switch scripts in there (ex: /usr/local/bin/xsingle for single monitor mode). Repeat with Custom Command 1 for the other option. Now, when you log in under GDM, there will be two options under the Actions menu, for selecting the monitor setup you wish to use. This works out pretty well, since the framebuffer console comes up as duplicating the laptop's screen anyway.

Here's the small script I use to switch to single monitor mode. It copies the single-monitor mode, with the ServerLayout line concerning second screen placement commented out, to xorg.conf:

[code]#!/bin/sh
cp /etc/X11/xorg.conf.single /etc/X11/xorg.conf
/etc/init.d/gdm restart[/code]

In case anyone is interested, here's the whole xorg.conf file. You'll probably need to make changes for your setup.

[code]Section "Files"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/X11R6/lib/X11/fonts/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/X11R6/lib/X11/fonts/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/X11R6/lib/X11/fonts/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/X11R6/lib/X11/fonts/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "/usr/X11R6/lib/X11/fonts/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"
Load "dbe"
EndSection

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

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

Section "InputDevice"
Identifier "Synaptics Touchpad"
Driver "synaptics"
Option "SendCoreEvents" "true"
Option "Device" "/dev/psaux"
Option "Protocol" "auto-dev"
Option "HorizScrollDelta" "0"
EndSection

Section "Monitor"
Identifier "Laptop LCD"
VendorName "IBM"
ModelName "T40"
Option "DPMS" "true"
EndSection

Section "Monitor"
Identifier "External LCD"
VendorName "Samsung"
ModelName "SyncMaster 930B"
HorizSync 30.0 - 110.0
VertRefresh 48.0 - 170.0
Option "DPMS" "true"
EndSection

Section "Device"
Identifier "Internal Port"
Driver "radeon"
VendorName "ATI Technologies Inc"
BoardName "Radeon Mobility M7 LW [Radeon Mobility 7500]"
BusID "PCI:1:0:0"
Option "AGPMode" "4"
Option "AGPFastWrite" "true"
Option "EnableDepthMoves" "true"
Option "EnablePageFlip" "true"
Option "RenderAccel" "true"
Option "BackingStore" "true"
Option "AllowGLXWithComposite" "true"
Option "DPMS" "true"
Option "DDCMode" "true"
Option "Monitor Layout" "LVDS, CRT"
Screen 0
EndSection

Section "Device"
Identifier "External Port"
Driver "radeon"
VendorName "ATI Technologies Inc"
BoardName "Radeon Mobility M7 LW [Radeon Mobility 7500]"
BusID "PCI:1:0:0"
Option "AGPMode" "4"
Option "AGPFastWrite" "true"
Option "EnableDepthMoves" "true"
Option "EnablePageFlip" "true"
Option "RenderAccel" "true"
Option "BackingStore" "true"
Option "AllowGLXWithComposite" "true"
Option "DPMS" "true"
Option "DDCMode" "true"
Option "Monitor Layout" "LVDS, CRT"
Screen 1
EndSection

Section "Screen"
Identifier "Screen0"
Device "Internal Port"
Monitor "Laptop LCD"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1024x768"
EndSubSection
EndSection

Section "Screen"
Identifier "Screen1"
Device "External Port"
Monitor "External LCD"
DefaultDepth 24
SubSection "Display"
Depth 24
Modes "1280x1024"
EndSubSection
EndSection

Section "ServerFlags"
Option "AllowMouseOpenFail" "true"
Option "Xinerama" "true"
EndSection

Section "DRI"
Mode 0666
EndSection

Section "Extensions"
Option "Composite" "false"
Option "RENDER" "true"
EndSection

Section "ServerLayout"
Identifier "Default Layout"
Screen 0 "Screen0"
Screen 1 "Screen1" RightOf "Screen0"
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
Option "AIGLX" "on"
EndSection[/code] Edited by systems_glitch

Share this post


Link to post
Share on other sites
Very awesome job. I wonder how much tweaking this would take to use with an intel card.

Share this post


Link to post
Share on other sites
[quote name='BigBrother' post='270142' date='Jul 18 2007, 11:22 PM']Very awesome job. I wonder how much tweaking this would take to use with an intel card.[/quote]

Not sure...but I plan on testing it with an old Matrox G450 card today, so I'll let you know if the setup was any different for that!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0