Linux – how to prevent Xorg using the Linux laptop’s display panel

gnomelinuxxorg

I have a laptop (~5 year old HP compaq nc6400 running Fedora Linux) that I use most of the time as a desktop machine. It is plugged into a docking station with its lid closed and connected through that by DVI cable to a large external LCD display.

For various reasons (login greeter appears on closed display, limited graphics card cannot do 3D to both displays at once) I would like to prevent the laptop's integrated display panel being used by X at all. While docked and on my desk (which is how I use it about 97% of the time) I would like it to simply not use the integrated laptop panel. Booting is not a particular problem, as by default everything is mirrored between the two displays. Also, I don't mind a 'manual' solution, such that I have to undo settings on those rare occasions when I am using the laptop away from my desk.

Once logged in I can configure Gnome so that it only uses the external monitor and the laptop panel is marked "off", however this has no effect on the initial auto-configured state of X and the pre-login greeter display. Surprisingly the laptop does not appear to have a lid sensor, so opening or closing the lid does not appear to trigger any events. I can use xrandr -display :0 --output LVDS1 --off --output DVI1 --auto on a separate VC before login, but this is still after the fact of X having started and discovered and deciding to use both displays.

I tried configuring Xorg by creating a file /etc/X11/xorg.conf.d/01-turn-off-laptop-display.conf which contains:

Section "Monitor"
    Identifier  "laptop panel"
    Option  "Monitor-LVDS1" "laptop panel"
    Option  "Enable" "no"
EndSection
Section "Monitor"
    Identifier  "big display"
    Option  "Monitor-DVI1" "big display"
EndSection

Section "Screen"
    Identifier  "main"
    Device  "Default"
    Monitor "big display"
EndSection

However that did not have a useful effect.
The video card is Intel 945GM:

[dan@khorium ~]$ sudo lspci -v -s 0:2
00:02.0 VGA compatible controller: Intel Corporation Mobile 945GM/GMS, 943/940GML Express Integrated Graphics Controller (rev 03) (prog-if 00 [VGA controller])
    Subsystem: Hewlett-Packard Company Device 30ad
    Flags: bus master, fast devsel, latency 0, IRQ 16
    Memory at f4600000 (32-bit, non-prefetchable) [size=512K]
    I/O ports at 4000 [size=8]
    Memory at e0000000 (32-bit, prefetchable) [size=256M]
    Memory at f4680000 (32-bit, non-prefetchable) [size=256K]
    Expansion ROM at <unassigned> [disabled]
    Capabilities: [90] MSI: Enable- Count=1/1 Maskable- 64bit-
    Capabilities: [d0] Power Management version 2
    Kernel driver in use: i915
    Kernel modules: i915

00:02.1 Display controller: Intel Corporation Mobile 945GM/GMS/GME, 943/940GML Express Integrated Graphics Controller (rev 03)
    Subsystem: Hewlett-Packard Company Device 30ad
    Flags: bus master, fast devsel, latency 0
    Memory at f4700000 (32-bit, non-prefetchable) [size=512K]
    Capabilities: [d0] Power Management version 2

The machine has been running various versions of Fedora Linux (x86_64) since about version 10/11). I'm currently trying Fedora 15 beta (which includes Gnome 3), but the problem has existed in previous OS releases.

Best Answer

I was able to achieve the desired aim with the following xorg.conf:

Section "Monitor"
        Identifier      "laptop panel"
        Option  "ignore"        "true"
EndSection
Section "Monitor"
        Identifier      "big display"
EndSection    
Section "Device"
        Identifier      "onboard"
        Option  "Monitor-LVDS1" "laptop panel"
        Option  "Monitor-DVI1" "big display"
EndSection

the critical element being Option "Ignore" "true". I might be able to simplify this further, but it works. I don't yet know what will happen when/if I use the laptop away from the external display, possibly X will exit with an error - not a perfect solution but I can move the configuration out of the way in that event.

Related Question