Jump to content


Photo
- - - - -

Dual Monitors on a Thinkpad T40


  • Please log in to reply
2 replies to this topic

#1 systems_glitch

systems_glitch

    Dangerous free thinker

  • Moderating Team
  • 1,636 posts
  • Gender:Male

Posted 18 July 2007 - 05:19 PM

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:

http://roback.cc/howtos/2micehowto.php

(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:

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

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. This site 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:

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

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

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

Edited by systems_glitch, 18 July 2007 - 05:25 PM.


#2 BigBrother

BigBrother

    Hakker addict

  • Members
  • 524 posts
  • Location:36° 12' N 95° 54' W

Posted 18 July 2007 - 10:22 PM

Very awesome job. I wonder how much tweaking this would take to use with an intel card.

#3 systems_glitch

systems_glitch

    Dangerous free thinker

  • Moderating Team
  • 1,636 posts
  • Gender:Male

Posted 19 July 2007 - 10:39 AM

Very awesome job. I wonder how much tweaking this would take to use with an intel card.


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!




BinRev is hosted by the great people at Lunarpages!