mathr / blog / #

Dual-head and TV-out on an ASUS W3H00N

Ensure that /usr/src/linux is symlinked to the kernel version that you want to compile the driver for. And backup your /etc/X11/xorg.conf file, it will be overwritten! Then follow these instructions: Gentoo HOWTO ATI Drivers. I varied the instructions by unmasking only eselect and eselect-opengl, and instead of recompiling the kernel I just ran "rmmod drm" (otherwise I got operation not permitted when trying to "modprobe fglrx"). Then edit the generated /etc/X11/xorg.conf to configure the input devices, monitors, server layout, etc. Gentoo HOWTO Dual Monitors has some useful tips.

Whew, but what is the result? Well, it depends what is plugged in - it seems there is some automagic detection. When I set it up for the first time, the VGA out was displaying Screen "External". I then plugged in the TV out to the TV in on my other computer - no signal. Then I restarted X, or rebooted, or something..., and the VGA out now displayed a copy of "Internal", and the TV out displayed "External". This is pretty much what I want, of course 3 independent displays would be even more awesome, but I don't know whether it is possible.

The next stage was configuring my window manager of choice to NOT manage windows on "External" - this is so there are no window decorations (title bar, border, close/resize gadgets, etc), and if the window is the right size then it displays full-screen! This is why I chose a resolution of 640x480, visuals at higher resolutions would be pushing it for Gridflow. It turns out that it is possible, although undocumented in the usual places like "fluxbox -h" or "man fluxbox". The solution is "fluxbox -screen 0", the default is "fluxbox -screen all", and you can use syntax like "fluxbox -screen 0,2" to have fluxbox manage screens 0 and 2 (but not 1 or any others).

I'm very happy that I got this working, it'll be perfect for Make Art, among others. And it was suprisingly easy, too.

For reference, here's the configuration:

# xorg.conf

Section "dri"
    Group 27    # access by video group only
    Mode 0660
EndSection

Section "Module"
    Load        "dbe"  	# Double buffer extension
    SubSection  "extmod"
#      Option    "omit xfree86-dga" 
    EndSubSection
    Load        "type1"
    Load        "freetype"
    Load        "glx"   # libglx.a
    Load        "dri"   # libdri.a
    Load        "synaptics"  # touchpad
EndSection

Section "Files"
    RgbPath	"/usr/X11R6/lib/X11/rgb"
    FontPath   "/usr/X11R6/lib/X11/fonts/local/"
    FontPath   "/usr/X11R6/lib/X11/fonts/misc/"
    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"
    FontPath   "/usr/X11R6/lib/X11/fonts/Type1/"
    FontPath   "/usr/X11R6/lib/X11/fonts/75dpi/"
    FontPath   "/usr/X11R6/lib/X11/fonts/100dpi/"
EndSection

Section "ServerFlags"
    Option "DontZoom"  # turn off key-sequences that change resolution
    Option "DisableVidModeExtension"
EndSection

Section "InputDevice"
    Identifier	"Keyboard1"
    Driver	"kbd"
    Option "AutoRepeat" "500 30"
    Option "XkbRules"	"xfree86"
    Option "XkbModel"	"pc101"
    Option "XkbLayout"	"gb"
EndSection

Section "InputDevice"
    Identifier	"Touchpad"
    Driver "synaptics"
    Option "Protocol"   "Auto"
    Option "Device"     "/dev/psaux"
    Option "Protocol" "auto-dev"
    Option "Emulate3Buttons"
EndSection

Section "Monitor"
    Identifier  "ASUS W3H00N WXGA"
    HorizSync   28-49
    VertRefresh 43-72
    Option "DPMS"
    Modeline "1280x768@60" 80.14 1280 1344 1480 1680 768 769 772 795
EndSection


Section "Monitor"
    Identifier  "ASUS W3H00N SVGA Out"
    HorizSync   31.5 - 60.0
    VertRefresh 50 - 70
    Option "DPMS"
EndSection

Section "Device"
    Identifier  "Standard VGA"
    VendorName  "Unknown"
    BoardName   "Unknown"
    Driver      "vga"
EndSection

# === ATI device section ===

Section "Device"
    Identifier                          "ATI Graphics Adapter connector 0"
    Driver                              "fglrx"
# ### generic DRI settings ###
# === disable PnP Monitor  ===
    #Option                              "NoDDC"
# === disable/enable XAA/DRI ===
    Option "no_accel"                   "no"
    Option "no_dri"                     "no"
# === misc DRI settings ===
    Option "mtrr"                       "off" # disable DRI mtrr mapper, driver has its own code for mtrr
# ### FireGL DDX driver module specific settings ###
# === Screen Management ===
    Option "DesktopSetup"               "0x00000000" 
    Option "MonitorLayout"              "AUTO, AUTO"
    Option "IgnoreEDID"                 "off"
    Option "HSync2"                     "31.5 - 60.0" 
    Option "VRefresh2"                  "50 - 70" 
    Option "ScreenOverlap"              "0" 
# === TV-out Management ===
    Option "NoTV"                       "no"     
    Option "TVStandard"                 "PAL-I"     
    Option "TVHSizeAdj"                 "0"     
    Option "TVVSizeAdj"                 "0"     
    Option "TVHPosAdj"                  "0"     
    Option "TVVPosAdj"                  "0"     
    Option "TVHStartAdj"                "0"     
    Option "TVColorAdj"                 "0"     
    Option "GammaCorrectionI"           "0x00000000"
    Option "GammaCorrectionII"          "0x00000000"
# === OpenGL specific profiles/settings ===
    Option "Capabilities"               "0x00000000"
#    Option "Capabilities"               "0x00000800" # sync OpenGL drawing to video refresh - makes glxgears run *slow*
# === Video Overlay for the Xv extension ===
    Option "VideoOverlay"               "on"
# === OpenGL Overlay ===
# Note: When OpenGL Overlay is enabled, Video Overlay
#       will be disabled automatically
    Option "OpenGLOverlay"              "off"
# === Center Mode (Laptops only) ===
    Option "CenterMode"                 "off"
# === Pseudo Color Visuals (8-bit visuals) ===
    Option "PseudoColorVisuals"         "off"
# === QBS Management ===
    Option "Stereo"                     "off"
    Option "StereoSyncEnable"           "1"
# === FSAA Management ===
    Option "FSAAEnable"                 "no"
    Option "FSAAScale"                  "1"
    Option "FSAADisableGamma"           "yes"
    Option "FSAACustomizeMSPos"         "no"
    Option "FSAAMSPosX0"                "0.000000"
    Option "FSAAMSPosY0"                "0.000000"
    Option "FSAAMSPosX1"                "0.000000"
    Option "FSAAMSPosY1"                "0.000000"
    Option "FSAAMSPosX2"                "0.000000"
    Option "FSAAMSPosY2"                "0.000000"
    Option "FSAAMSPosX3"                "0.000000"
    Option "FSAAMSPosY3"                "0.000000"
    Option "FSAAMSPosX4"                "0.000000"
    Option "FSAAMSPosY4"                "0.000000"
    Option "FSAAMSPosX5"                "0.000000"
    Option "FSAAMSPosY5"                "0.000000"
# === Misc Options ===
    Option "UseFastTLS"                 "2"
    Option "BlockSignalsOnLock"         "on"
    Option "UseInternalAGPGART"         "yes"
    Option "ForceGenericCPU"            "no"
    BusID "PCI:1:0:0"    # vendor=1002, device=4e50
    Screen 0
EndSection

Section "Device"
    Identifier                          "ATI Graphics Adapter connector 1"
    Driver                              "fglrx"
    BusID "PCI:1:0:0"    # vendor=1002, device=4e50
    Screen 1
EndSection

Section "Screen"
    Identifier  "Internal"
    Device      "ATI Graphics Adapter connector 0"
    Monitor     "ASUS W3H00N WXGA"
    DefaultDepth 24
    Subsection "Display"
        Depth       24
        Modes       "1280x768@60"
        ViewPort    0 0  # initial origin if mode is smaller than desktop
    EndSubsection
EndSection

Section "Screen"
    Identifier  "External"
    Device      "ATI Graphics Adapter connector 1"
    Monitor     "ASUS W3H00N SVGA Out"
    DefaultDepth 24
    Subsection "Display"
        Depth       24
        Modes       "640x480"
        ViewPort    0 0  # initial origin if mode is smaller than desktop
    EndSubsection
EndSection

Section "ServerLayout"
    Identifier  "Server Layout"
    Screen "Internal"
    Screen "External" Below "Internal"
    InputDevice "Touchpad" "CorePointer"
    InputDevice "Keyboard1" "CoreKeyboard"
EndSection

# EOF