LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   Configuring X to use an external monitor with nVidia drivers (https://www.linuxquestions.org/questions/slackware-14/configuring-x-to-use-an-external-monitor-with-nvidia-drivers-618163/)

Hangdog42 02-02-2008 09:06 AM

Configuring X to use an external monitor with nVidia drivers
 
I think that I've pretty much ended up confusing myself, so some pointers would be appreciated.

I've got a laptop with a docking station in my office. What I would like to happen is when I run startx, if the laptop is docked, it uses the LCD attached to the docking station. If not, it would use the laptop screen. What I'm NOT trying to do is set up dual screens (which is probably why I've confused myself since there is a lot of information out there on this).

I've been trying to set up a second ServerLayout in xorg.conf to handle this, so in theory all I would need to do is run startx --layout External when I'm docked, and it should use the external monitor. However, no dice. No matter how I've messed with the various options, whenever I run startx, with or without the --layout flag, the laptop only uses the laptop screen. If I activate the external DVI output, the external screen works fine.

So basically, the monitors both work, both are detected by the nVidia driver, but I can't seem to wrap my head around how to get the system to use the external monitor preferentially.


The fine details:

Slackware 12
Video card :nVidia Quadro FX 1600M
Driver: nVidia 100.14.19

Current xorg.conf

Code:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 1.0  (buildmeister@builder3)  Wed Sep 12 14:30:30 PDT 2007

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 1.0  (buildmeister@builder3)  Wed Sep 12 14:29:35 PDT 2007

Section "ServerLayout"
    Identifier    "X.org Configured"
    Screen      0  "Screen0" 0 0
    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "TouchPad" "AlwaysCore"
    InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "ServerLayout"
    Identifier    "External"
    Screen      0  "ExternalScreen" 0 0
#    Screen      0  "Screen0" 0 0
    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "TouchPad" "AlwaysCore"
    InputDevice    "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
    RgbPath        "/usr/share/X11/rgb"
    ModulePath      "/usr/lib/xorg/modules"
    FontPath        "/usr/share/fonts/TTF"
    FontPath        "/usr/share/fonts/OTF"
    FontPath        "/usr/share/fonts/Type1"
    FontPath        "/usr/share/fonts/misc"
    FontPath        "/usr/share/fonts/75dpi/:unscaled"
EndSection

Section "Module"
    Load          "xtrap"
    Load          "glx"
    Load          "dbe"
    Load          "extmod"
    Load          "record"
    Load          "type1"
    Load          "freetype"
    Load          "synaptics"
EndSection

Section "InputDevice"
    Identifier    "Keyboard0"
    Driver        "kbd"
    Option        "XkbModel" "pc105"
    Option        "XkbLayout" "us"
EndSection

Section "InputDevice"
    Identifier    "Mouse0"
    Driver        "mouse"
    Option        "Protocol" "auto"
    Option        "Device" "/dev/input/mice"
    Option        "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    Identifier    "TouchPad"
    Driver        "synaptics"
    Option        "Device" "/dev/psaux"
    Option        "Protocol" "auto-dev"
    Option        "LeftEdge" "1700"
    Option        "RightEdge" "5300"
    Option        "TopEdge" "1700"
    Option        "BottomEdge" "4200"
    Option        "FingerLow" "25"
    Option        "FingerHigh" "30"
    Option        "MaxTapTime" "180"
    Option        "MaxTapMove" "220"
    Option        "VertScrollDelta" "100"
    Option        "MinSpeed" "0.09"
    Option        "MaxSpeed" "0.18"
    Option        "AccelFactor" "0.0015"
    Option        "SHMConfig" "on"
EndSection

Section "Monitor"
    Identifier    "Monitor0"
    VendorName    "Unknown"
    ModelName      "LPL"
    HorizSync      30.0 - 75.0
    VertRefresh    60.0
    Option        "DPMS" "true"
    #HorizSync      31.5 - 50.0
    #VertRefresh    40.0 - 90.0
    #
    #Added by tdp
    #
    #Modeline "1920x1200_60" 192.16 1920 2048 2256 2592 1200 1201 1204 1242
    #

EndSection

Section "Monitor"
    Identifier    "ExternalMonitor"
    VendorName    "Dell"
    ModelName      "2407"
    Option        "DPMS" "true"
    HorizSync      30.0 - 83.0
    VertRefresh    56.0 - 76.0
#    #
#    #Added by tdp
#    #
#    #Modeline "1920x1200_60" 192.16 1920 2048 2256 2592 1200 1201 1204 1242
#    #
EndSection

Section "Device"

        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option    "SWcursor"                  # [<bool>]
        #Option    "HWcursor"                  # [<bool>]
        #Option    "NoAccel"                    # [<bool>]
        #Option    "ShadowFB"                  # [<bool>]
        #Option    "UseFBDev"                  # [<bool>]
        #Option    "Rotate"                    # [<str>]
        #Option    "VideoKey"                  # <i>
        #Option    "FlatPanel"                  # [<bool>]
        #Option    "FPDither"                  # [<bool>]
        #Option    "CrtcNumber"                # <i>
        #Option    "FPScale"                    # [<bool>]
        #Option    "FPTweak"                    # <i>
        #Option    "DualHead"                  # [<bool>]
        #Option      "ForceMonitors" "crt1, nolvds"
    Identifier    "Card0"
    Driver        "nvidia"
    VendorName    "nVidia Corporation"
    BoardName      "Unknown Board"
    Option        "AddARGBGLXVisuals" "true"
    Option        "TripleBuffer" "true"
        #Option        "RenderAccel"        "true"
    Option        "AllowGLXWithComposite" "true"
    Option        "nvAGP" "1"
    Screen        0
#The nvAGP was added for suspend reasons
EndSection

Section "Device"

        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option    "SWcursor"                  # [<bool>]
        #Option    "HWcursor"                  # [<bool>]
        #Option    "NoAccel"                    # [<bool>]
        #Option    "ShadowFB"                  # [<bool>]
        #Option    "UseFBDev"                  # [<bool>]
        #Option    "Rotate"                    # [<str>]
        #Option    "VideoKey"                  # <i>
        #Option    "FlatPanel" "True"                  # [<bool>]
        #Option          "MonitorLayout" "CRT,NONE"
        #Option    "FPDither"                  # [<bool>]
        #Option    "CrtcNumber"                # <i>
        #Option    "FPScale"                    # [<bool>]
        #Option    "FPTweak"                    # <i>
        #Option    "DualHead"                  # [<bool>]
        #Option      "ForceMonitors" "crt1, nolvds"
    Identifier    "ExternalCard"
    Driver        "nvidia"
    VendorName    "nVidia Corporation"
    BoardName      "Unknown Board"
    Option        "MonitorLayout" "CRT,NONE"
    Option        "AddARGBGLXVisuals" "true"
    Option        "TripleBuffer" "true"
        #Option        "RenderAccel"        "true"
    Option        "AllowGLXWithComposite" "true"
    Option        "nvAGP" "1"
#The nvAGP was added for suspend reasons
    Screen  1
EndSection

Section "Device"
    Identifier    "Videocard0"
    Driver        "nvidia"
    VendorName    "NVIDIA Corporation"
    BoardName      "Quadro FX 1600M"
EndSection


Section "Screen"
    Identifier    "Screen0"
    Device        "Videocard0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection    "Display"
        Depth      24
    EndSubSection
EndSection

Section "Screen"
    Identifier    "ExternalScreen"
    Device        "ExternalCard"
    Monitor        "ExternalMonitor"
    DefaultDepth    24
    SubSection    "Display"
        Viewport    0 0
        Depth      1
    EndSubSection
    SubSection    "Display"
        Viewport    0 0
        Depth      4
    EndSubSection
    SubSection    "Display"
        Viewport    0 0
        Depth      8
    EndSubSection
    SubSection    "Display"
        Viewport    0 0
        Depth      15
    EndSubSection
    SubSection    "Display"
        Viewport    0 0
        Depth      16
    EndSubSection
    SubSection    "Display"
        Viewport    0 0
        Depth      24
    EndSubSection
EndSection

Section "Extensions"
    Option        "Composite" "enable"
EndSection


jong357 02-02-2008 11:07 AM

Have you tried using the control panel to set it up?

H_TeXMeX_H 02-02-2008 12:54 PM

Try using 'nvidia-settings', yes, the control panel.

Hangdog42 02-02-2008 01:38 PM

I've been messing with the nvidia-settings control panel, and if anything that has left me more confused than messing with xorg.conf...

I've had them set up in the control panel as separate X screens, but I've never been able to get the behavior I'm after. The best I managed was to have both screens working, but the laptop LCD was :0 while the external monitor was :1, which isn't what I'm after. The only thing I can think is that I need to be using TwinView, but given that I only want one screen active at a time, I don't think that is what I'm after.

jong357 02-02-2008 03:29 PM

I don't know too much about this stuff but it seems a little difficult to do what you want to do. I've always been under the impression that you would have to kill the X server and restart it in order to completely disable a screen. Dunno.

I take it you want to save the life of your laptop screen if your not using it. Correct? Seems there would have to be a way to disable screens on the fly without a restart of X... X windows has never really been my cup of tea I'm afraid...

Do you have brightness/backlit functions for your laptop? If so, does backing all the way down affect your second screen? I would think not. It's manual but might give you something to work with until you figure out the correct way to do it.

Hangdog42 02-03-2008 08:44 AM

Quote:

I don't know too much about this stuff but it seems a little difficult to do what you want to do. I've always been under the impression that you would have to kill the X server and restart it in order to completely disable a screen. Dunno.
Actually, I'm looking for something a little different, I want to tell X what screen to use when I start it. If I understand the --layout flag properly, that is exactly what it is supposed to do. My problem is that I've not got my xorg.conf written properly and I'm at a loss as to what is wrong there.

Quote:

I take it you want to save the life of your laptop screen if your not using it. Correct? Seems there would have to be a way to disable screens on the fly without a restart of X... X windows has never really been my cup of tea I'm afraid...
I'm in the same boat, I've never had to delve into the guts of X before, so I'm a little lost. I'm not really trying to save the laptop screen, its just that when it is on the docking station it is tucked on a shelf under my desk and it seems more than a little pointless to have the screen running. Besides, Windows will do what I want, and I refuse to believe that Windows can do something that X can't.

Hangdog42 02-03-2008 11:11 AM

Solved - sort of
 
Well, I finally figured out a workable solution. I'm not sure how elegant it is, but it seems to work.

It turns out I was wrong about TwinView, you do actually need to enable it, at least for the way I did it. I started out by using the nVidia control pane (nvidia-settings) to set up the two monitors as clones. I then saved the settings to xorg.conf. When I looked at the xorg.conf changes, I saw that it had defined a new Screen section:

Code:

Section "Screen"
    Identifier    "Screen0"
    Device        "Videocard0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option        "TwinView" "1"
    Option        "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-2: nvidia-auto-select +0+0"

    SubSection    "Display"
        Depth      24
    EndSubSection
EndSection

That is the first time I had seen the monitors refered to by any identifier in xorg.conf (DFP-0 is the laptop screen and DFP-2 is the external LCD screen). I was playing with this line:
Code:

    Option        "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-2: nvidia-auto-select +0+0"
And for a lark removed the reference to DFP-0 to make this:


Code:

    Option        "metamodes" "DFP-2: nvidia-auto-select +0+0"
Lo and Behold, IT WORKS! When I run startx when the laptop is attached to the docking station, the external LCD monitor is used, and the laptop monitor is off. If I take it off the docking station, running startx uses the laptop monitor.

What is weird is that if I run nvidia-settings now, TwinView appears to be disabled. Like I said, this may not be the most elegant solution, but it does what I want. If anyone cares, here is the full blown xorg.conf:

Code:

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 1.0  (buildmeister@builder3)  Wed Sep 12 14:30:30 PDT 2007

Section "ServerLayout"
    Identifier    "X.org Configured"
    Screen      0  "Screen0" 0 0
    InputDevice    "Mouse0" "CorePointer"
    InputDevice    "TouchPad" "AlwaysCore"
    InputDevice    "Keyboard0" "CoreKeyboard"
EndSection


Section "Files"
    RgbPath        "/usr/share/X11/rgb"
    ModulePath      "/usr/lib/xorg/modules"
    FontPath        "/usr/share/fonts/TTF"
    FontPath        "/usr/share/fonts/OTF"
    FontPath        "/usr/share/fonts/Type1"
    FontPath        "/usr/share/fonts/misc"
    FontPath        "/usr/share/fonts/75dpi/:unscaled"
EndSection

Section "Module"
    Load          "xtrap"
    Load          "glx"
    Load          "dbe"
    Load          "extmod"
    Load          "record"
    Load          "type1"
    Load          "freetype"
    Load          "synaptics"
EndSection

Section "ServerFlags"
    Option        "Xinerama" "0"
EndSection

Section "InputDevice"
    Identifier    "Keyboard0"
    Driver        "kbd"
    Option        "XkbModel" "pc105"
    Option        "XkbLayout" "us"
EndSection

Section "InputDevice"
    Identifier    "Mouse0"
    Driver        "mouse"
    Option        "Protocol" "auto"
    Option        "Device" "/dev/input/mice"
    Option        "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    Identifier    "TouchPad"
    Driver        "synaptics"
    Option        "Device" "/dev/psaux"
    Option        "Protocol" "auto-dev"
    Option        "LeftEdge" "1700"
    Option        "RightEdge" "5300"
    Option        "TopEdge" "1700"
    Option        "BottomEdge" "4200"
    Option        "FingerLow" "25"
    Option        "FingerHigh" "30"
    Option        "MaxTapTime" "180"
    Option        "MaxTapMove" "220"
    Option        "VertScrollDelta" "100"
    Option        "MinSpeed" "0.09"
    Option        "MaxSpeed" "0.18"
    Option        "AccelFactor" "0.0015"
    Option        "SHMConfig" "on"
EndSection

Section "Monitor"

    #VertRefresh    40.0 - 90.0
    #
    #Added by tdp
    #
    #Modeline "1920x1200_60" 192.16 1920 2048 2256 2592 1200 1201 1204 1242
    #
    Identifier    "Monitor0"
    VendorName    "Unknown"
    ModelName      "LPL"
    HorizSync      30.0 - 75.0
    VertRefresh    60.0
    Option        "DPMS" "true"
EndSection

Section "Device"

        ### Available Driver options are:-
        ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
        ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
        ### [arg]: arg optional
        #Option    "SWcursor"                  # [<bool>]
        #Option    "HWcursor"                  # [<bool>]
        #Option    "NoAccel"                    # [<bool>]
        #Option    "ShadowFB"                  # [<bool>]
        #Option    "UseFBDev"                  # [<bool>]
        #Option    "Rotate"                    # [<str>]
        #Option    "VideoKey"                  # <i>
        #Option    "FlatPanel"                  # [<bool>]
        #Option    "FPDither"                  # [<bool>]
        #Option    "CrtcNumber"                # <i>
        #Option    "FPScale"                    # [<bool>]
        #Option    "FPTweak"                    # <i>
        #Option    "DualHead"                  # [<bool>]
        #Option      "ForceMonitors" "crt1, nolvds"
#The nvAGP was added for suspend reasons
    Identifier    "Card0"
    Driver        "nvidia"
    VendorName    "nVidia Corporation"
    BoardName      "Unknown Board"
    Option        "AddARGBGLXVisuals" "true"
    Option        "TripleBuffer" "true"
        #Option        "RenderAccel"        "true"
    Option        "AllowGLXWithComposite" "true"
    Option        "nvAGP" "1"
    Screen          0
EndSection

Section "Device"
    Identifier    "Videocard0"
    Driver        "nvidia"
    VendorName    "NVIDIA Corporation"
    BoardName      "Quadro FX 1600M"
EndSection

Section "Screen"
    Identifier    "Screen0"
    Device        "Videocard0"
    Monitor        "Monitor0"
    DefaultDepth    24
    #Option        "metamodes" "DFP-0: nvidia-auto-select +0+0, DFP-2: nvidia-auto-select +0+0"
    Option        "TwinView" "1"
    Option        "metamodes" "DFP-2: nvidia-auto-select +0+0"
    SubSection    "Display"
        Depth      24
    EndSubSection
EndSection


Section "Extensions"
    Option        "Composite" "enable"
EndSection



All times are GMT -5. The time now is 05:32 AM.