Xorg가 Linux 노트북의 디스플레이 패널을 사용하지 못하도록 하려면 어떻게 해야 합니까?

Xorg가 Linux 노트북의 디스플레이 패널을 사용하지 못하도록 하려면 어떻게 해야 합니까?

나는 대부분의 시간을 데스크톱으로 사용하는 노트북(약 5년 전 Fedora Linux를 실행하는 HP compaq nc6400)을 가지고 있습니다. 덮개를 닫은 채로 도킹 스테이션에 연결하고 DVI 케이블을 통해 대형 외부 LCD 모니터에 연결합니다.

여러 가지 이유로(로그인 인사말이 꺼진 모니터에 표시되고 제한된 그래픽 카드가 두 모니터에서 동시에 3D를 수행할 수 없음) X가 노트북의 통합 디스플레이 패널을 사용하는 것을 완전히 방지하고 싶습니다. 베이스에 부착하고 책상에 앉았을 때(제가 약 97%의 시간을 사용하는 방법입니다) 통합 노트북 패널을 전혀 사용하지 않았으면 좋겠습니다. 기본적으로 모든 것이 두 모니터 간에 미러링되므로 실행은 특별한 문제가 아닙니다. 또한, 책상 밖에서 노트북을 사용할 때 드물게 설정을 취소해야 하는 "수동" 솔루션도 마음에 들지 않습니다.

로그인한 후 외부 모니터만 사용하고 노트북 패널을 "꺼짐"으로 표시하도록 Gnome을 구성할 수 있지만 이는 X의 초기 자동 구성 상태와 사전 로그인 환영 디스플레이에는 영향을 미치지 않습니다. 놀랍게도 노트북에는 덮개 센서가 없는 것 같아서 덮개를 열거나 닫아도 아무런 이벤트가 발생하지 않는 것 같습니다. 로그인하기 전에 별도의 VC에서 작업 할 수 있지만 xrandr -display :0 --output LVDS1 --off --output DVI1 --autoX가 부팅되어 두 모니터를 모두 사용하기로 결정한 후에도 마찬가지입니다.

/etc/X11/xorg.conf.d/01-turn-off-laptop-display.conf다음 내용이 포함된 파일을 생성하여 Xorg 구성을 시도했습니다 .

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

그러나 이것은 유용한 효과가 없었습니다. 그래픽 카드는 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

이 머신은 버전 10/11부터 다양한 버전의 Fedora Linux(x86_64)를 실행하고 있습니다. 현재 Fedora 15 베타(Gnome 3 포함)를 사용 중이지만 이전 OS 버전에서도 이 문제가 발생했습니다.

답변1

다음 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

핵심 요소는 Option "Ignore" "true"아마도 더 단순화할 수 있지만 작동합니다. 외부 모니터와 떨어져서 노트북을 사용할 때 어떤 일이 일어날지 아직 모르겠습니다. X가 오류와 함께 종료될 수도 있습니다. 이는 완벽한 솔루션은 아니지만 이 경우 구성을 이동할 수 있습니다.

답변2

저는 노트북을 노트북처럼 사용하려는 드문 경우에 더 유연할 수 있는 약간 다른 접근 방식을 권장합니다.

디스플레이 관리자(GDM, KDM 또는 LightDM일 수 있음)에 따라 디스플레이 관리자가 시작될 때 스크립트를 실행할 수 있습니다. xorg.conf 파일을 전혀 수정할 필요가 없습니다. 스크립트의 위치는 다음과 같습니다 (1).

  • KDM: /etc/kde/kdm/Xsetup (하단)
  • SDDM: /etc/X11/xdm/Xsetup(하단)
  • XDM: /etc/X11/xdm/Xsetup(하단)
  • GDM: /etc/gdm/Init/Default - "/sbin/initctl" 줄 바로 위에 스크립트 코드를 배치합니다. (1)
  • LightDM: /etc/lightdm/lightdm.conf - "display-setup-script="는 원하는 스크립트의 위치를 ​​가리킵니다. 스크립트의 첫 번째 줄이 다음과 같은지 확인하세요.#!/bin/sh그리고 실행 가능합니다.

스크립트는 다음과 같습니다. 모니터 이름을 컴퓨터에 적합한 이름으로 바꿔야 합니다. 위의 xorg.conf를 기반으로 추측을 시도했습니다.

/usr/bin/xrandr --current | grep "DVI1 connected "
if [ $? -eq 0 ]; then
  echo "DVI found"
  sleep 1s 
  /usr/bin/xrandr --output LVDS1 --off
  /usr/bin/xrandr --output DVI1 --auto --primary
fi

DVI 모니터가 연결되어 있는지, 내장 모니터 대신 활성화되어 있는지 테스트합니다. 내 노트북 ​​도크에 적합하면서도 다른 곳에서도 계속 사용할 수 있는 좀 더 정교한 버전이 있습니다. 저는 직장에서 5개의 화면을 사용하기 때문에 이것이 더 복잡합니다.

(1) 일부 파일 위치 정보http://forum.xfce.org/viewtopic.php?pid=25026#p25026

답변3

이전 기사에서 약간 수정된 xorg.conf 버전

Section "Monitor"
   Identifier "hdmi out"
   Option "ignore" "true"
EndSection

Section "Monitor"
   Identifier "big display"
EndSection

Section "Device"
   Identifier "onboard"
   Option "Monitor-LVDS1" "hdmi out"
   Option "Monitor-VGA1" "big display"
EndSection

인텔 NM10 칩에서 작동하는 것 같습니다. 상자에는 "대형 모니터"용 VGA 포트가 있습니다.

답변4

Option "ignore" "true"in을 사용하면 /etc/X11/xorg.conf해당 출력을 전혀 사용할 수 없습니다(또는 도구에 따라 다름). xrandr이 구성에서는 HDMI 출력을 비활성화했습니다.

Section "Monitor"
        Identifier "My-DVI-D"
        Option "Primary" "true"
        Option "PreferredMode" "1920x1080x60.0"
EndSection

Section "Monitor"
        Identifier "My-HDMI"
        Option "Enable" "false"
        Option "RightOf" "My-DVI-D"
EndSection

Section "Device"
        Identifier "onboard"
        Option "Monitor-HDMI1" "My-DVI-D"
        Option "Monitor-HDMI2" "My-HDMI"
EndSection

DVI-D(전체 해상도)를 활성화하고 HDMI를 비활성화하려면 각 구성 라인이 필요합니다.

출력을 찾으려면 적절하게 실행 xrandr -q하고 Option "Monitor-...조정하십시오. 관련 맨페이지 섹션은 다음과 같습니다.

   Option "Enable" "bool"
          This optional entry specifies whether the monitor should be turned on at  startup.   By  default,  the  server  will
          attempt to enable all connected monitors.  (RandR 1.2-supporting drivers only)
...
   Option "PreferredMode" "name"
          This optional entry specifies a mode to be marked as the preferred initial mode of the monitor.  (RandR 1.2-support‐
          ing drivers only)
...
   Option "Primary" "bool"
          This optional entry specifies that the monitor should be treated as the primary monitor. (RandR 1.2-supporting driv‐
          ers only)
...
   With RandR 1.2-enabled drivers, monitor sections may be tied to specific outputs of the video card.  Using the name of  the
   output  defined by the video driver plus the identifier of a monitor section, one associates a monitor section with an out‐
   put by adding an option to the Device section in the following format:

   Option "Monitor-outputname" "monitorsection"

   (for example, Option "Monitor-VGA" "VGA monitor" for a VGA output)

관련 정보