Xrandr 显示 HDMI1 断开连接,HDMI2 作为主显示器,且只有一个显示器

Xrandr 显示 HDMI1 断开连接,HDMI2 作为主显示器,且只有一个显示器

我不确定为什么 Xrandr 的输出显示 HDMI1 断开连接而 HDMI2 连接为主端口。我当前的设置中只有一个显示器和一个 HDMI 端口。根据下面的代码片段,我使用的是带有 i915 驱动程序的 Intel HD Graphics 500 芯片组。我是否遗漏了 HDMI1 断开连接的原因,甚至没有注意到为什么有 HDMI2?

Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
HDMI1 disconnected (normal left inverted right x axis y axis)
HDMI2 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 260mm x 140mm
   1280x720      60.00 +  50.00    59.94  
   1920x1080     60.00*   50.00    59.94  
   1920x1080i    60.00    50.00    59.94  
   1280x1024     60.02  
   1360x768      59.95  
   1024x768      60.00  
   800x600       60.32  
   720x576       50.00  
   720x576i      50.00  
   720x480       60.00    59.94  
   720x480i      60.00    59.94  
   640x480       60.00    59.94  
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

monitors.xml 文件的内容:

    <monitors version="1">
  <configuration>
      <clone>no</clone>
      <output name="HDMI1">
          <vendor>LSB</vendor>
          <product>0x0030</product>
          <serial>0x00000001</serial>
          <width>1920</width>
          <height>1080</height>
          <rate>60</rate>
          <x>0</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>yes</primary>
      </output>
      <output name="HDMI2">
          <vendor>LSB</vendor>
          <product>0x0030</product>
          <serial>0x00000001</serial>
          <width>1920</width>
          <height>1080</height>
          <rate>60</rate>
          <x>0</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>yes</primary>
      </output>
      <output name="VIRTUAL1">
      </output>
  </configuration>
  <configuration>
      <clone>no</clone>
      <output name="HDMI-1">
          <vendor>LSB</vendor>
          <product>0x0030</product>
          <serial>0x00000001</serial>
          <width>1920</width>
          <height>1080</height>
          <rate>60</rate>
          <x>0</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>yes</primary>
      </output>
      <output name="HDMI-2">
          <vendor>LSB</vendor>
          <product>0x0030</product>
          <serial>0x00000001</serial>
          <width>1920</width>
          <height>1080</height>
          <rate>60</rate>
          <x>0</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>yes</primary>
      </output>
  </configuration>
  <configuration>
      <clone>no</clone>
      <output name="HDMI1">
      </output>
      <output name="HDMI2">
          <vendor>LSB</vendor>
          <product>0x0030</product>
          <serial>0x00000001</serial>
          <width>1920</width>
          <height>1080</height>
          <rate>60</rate>
          <x>0</x>
          <y>0</y>
          <rotation>normal</rotation>
          <reflect_x>no</reflect_x>
          <reflect_y>no</reflect_y>
          <primary>yes</primary>
      </output>
      <output name="VIRTUAL1">
      </output>
  </configuration>
</monitors>

Xorg.0.log 的部分内容:

[    22.715] (II) systemd-logind: logind integration requires -keeptty and -keeptty was not provided, disabling logind integration
[    22.715] (II) xfree86: Adding drm device (/dev/dri/card0)
[    22.716] (EE) /dev/dri/card0: failed to set DRM interface version 1.4: Permission denied
[    22.717] (--) PCI:*(0:0:2:0) 8086:5a85:8086:2212 rev 11, Mem @ 0x90000000/16777216, 0x80000000/268435456, I/O @ 0x0000f000/64, BIOS @ 0x????????/131072
[    22.717] (II) LoadModule: "glx"
[    22.718] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[    22.735] (II) Module glx: vendor="X.Org Foundation"
[    22.735]    compiled for 1.19.6, module version = 1.0.0
[    22.735]    ABI class: X.Org Server Extension, version 10.0
[    22.735] (II) LoadModule: "intel"
[    22.735] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so
[    22.737] (II) Module intel: vendor="X.Org Foundation"
[    22.737]    compiled for 1.19.5, module version = 2.99.917
[    22.737]    Module class: X.Org Video Driver
[    22.737]    ABI class: X.Org Video Driver, version 23.0
[    22.737] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:
    i810, i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G,
    915G, E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM,
    Pineview G, 965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33,
    GM45, 4 Series, G45/G43, Q45/Q43, G41, B43
[    22.738] (II) intel: Driver for Intel(R) HD Graphics
[    22.738] (II) intel: Driver for Intel(R) Iris(TM) Graphics
[    22.738] (II) intel: Driver for Intel(R) Iris(TM) Pro Graphics
[    22.890] (II) intel(0): Using Kernel Mode Setting driver: i915, version 1.6.0 20171023
[    22.890] (II) intel(0): SNA compiled: xserver-xorg-video-intel-hwe-16.04 2:2.99.917+git20171229-1~16.04.1 (Timo Aaltonen <[email protected]>)
[    22.890] (II) intel(0): SNA compiled for use with valgrind
[    23.052] (--) intel(0): Integrated Graphics Chipset: Intel(R) HD Graphics 500
[    23.052] (--) intel(0): CPU: x86-64, sse2, sse3, ssse3, sse4.1, sse4.2; using a maximum of 2 threads
[    23.052] (II) intel(0): Creating default Display subsection in Screen section
    "Default Screen" for depth/fbbpp 24/32
[    23.052] (==) intel(0): Depth 24, (--) framebuffer bpp 32
[    23.052] (==) intel(0): RGB weight 888
[    23.052] (==) intel(0): Default visual is TrueColor
[    23.053] (II) intel(0): Output HDMI1 using monitor section Configured Monitor
[    23.053] (II) intel(0): Enabled output HDMI1
[    23.053] (II) intel(0): Output HDMI2 has no monitor section
[    23.053] (II) intel(0): Enabled output HDMI2
[    23.053] (--) intel(0): Using a maximum size of 256x256 for hardware cursors
[    23.054] (II) intel(0): Output VIRTUAL1 has no monitor section
[    23.054] (II) intel(0): Enabled output VIRTUAL1
[    23.054] (--) intel(0): Output HDMI2 using initial mode 1280x720 on pipe 0
[    23.054] (==) intel(0): TearFree enabled
[    23.054] (==) intel(0): Using gamma correction (1.0, 1.0, 1.0)
[    23.054] (==) intel(0): DPI set to (96, 96)

答案1

无需担心额外的 HDMI 显示器名称

只要一切正常,您就不必担心如何xrandr分配监视器名称。

以我的设置为例:

$ xrandr | grep connected

HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 1107mm x 623mm
eDP-1-1 connected primary 1920x1080+0+1080 (normal left inverted right x axis y axis) 382mm x 215mm
DP-1-1 connected 1920x1080+1920+532 (normal left inverted right x axis y axis) 708mm x 398mm
HDMI-1-1 disconnected (normal left inverted right x axis y axis)
DP-1-2 disconnected (normal left inverted right x axis y axis)
HDMI-1-2 disconnected (normal left inverted right x axis y axis)

一切正常,我并不担心 HDMI-1 有重复的名称并显示为“断开连接”。

更好的方法是使用:

$ xrandr | grep " connected "

HDMI-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 1107mm x 623mm
eDP-1-1 connected primary 1920x1080+3840+2160 (normal left inverted right x axis y axis) 382mm x 215mm
DP-1-1 connected 3840x2160+1920+0 (normal left inverted right x axis y axis) 1600mm x 900mm

这种技术可以使您免于筛选“断开连接的”监视器,更重要的是,它不会造成太大的混乱。

相关内容