Xrandr 增加了奇怪的虚拟屏幕尺寸和平移

Xrandr 增加了奇怪的虚拟屏幕尺寸和平移

我们的工作空间灵活,所有的工作场所都相同,但一个屏幕可能在左侧而不是右侧有 DVI 等,所以我需要更改输出,但屏幕尺寸和位置始终相同。

我的问题是,我中间有一个 2560x1600 的大屏幕,这个大屏幕的两侧各有一个 1920x1200 的屏幕。

每天上班的时候我通常只是写

xrandr --output "VGA-1-1" --mode 1920x1200 --output DP-2 --mode 2560x1600 --left-of VGA-1-1  --output DP-3 --mode 1920x1200 --left-of DP-2

但出于某种原因,如果我切换到另一个工作区,大屏幕可能就是 DP-3,所以我只是用它xrandr来找到正确的输出。

现在的问题是,nvidia 经常决定覆盖我的设置,因为通常每个窗口都有一个屏幕,所以它不认为这只是一个大屏幕,而是 3 个屏幕。但 nvidia 用所有 3 个屏幕制作了一个大型虚拟屏幕,因此左侧和中间工作正常,但当我将鼠标从中间移到右侧时,整个屏幕都会滚动,就像中间有一个大型虚拟屏幕一样……

有什么想法可以解决此问题吗?输出为:

$ xrandr
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 connected primary 1920x1200+0+0 (normal left inverted right x axis y axis) 519mm x 324mm panning 3840x1200+0+0
   1920x1200     59.95*+  59.88  
   1920x1080     59.94  
   1680x1050     59.95  
   1440x900      59.89  
   1400x1050     59.98  
   1280x1024     60.02  
   1280x960      60.00  
   1280x800      59.81  
   1280x720      60.00    59.94  
   1024x768      60.00  
   800x600       60.32    56.25  
   720x480       59.94  
   640x480       59.94  
LVDS-1-1 connected
   640x480       59.94  
   320x240       60.05  
VGA-1-1 connected 1920x1200+1920+0 519mm x 324mm
   1920x1200     59.95*+
   1920x1080     60.00  
   1680x1050     59.95  
   1400x1050     59.98  
   1280x1024     60.02  
   1440x900      59.89  
   1280x960      60.00  
   1280x800      59.81  
   1280x720      60.00  
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       60.00  

640x480 (0x45) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
  1920x1200 (0x47) 154.000MHz +HSync -VSync
        h: width  1920 start 1968 end 2000 total 2080 skew    0 clock  74.04KHz
        v: height 1200 start 1203 end 1209 total 1235           clock  59.95Hz
  1680x1050 (0x49) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1400x1050 (0x4a) 121.750MHz -HSync +VSync
        h: width  1400 start 1488 end 1632 total 1864 skew    0 clock  65.32KHz
        v: height 1050 start 1053 end 1057 total 1089           clock  59.98Hz
  1280x1024 (0x4b) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1440x900 (0x4c) 106.500MHz -HSync +VSync
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock  55.93KHz
        v: height  900 start  903 end  909 total  934           clock  59.89Hz
  1280x960 (0x4d) 108.000MHz +HSync +VSync
        h: width  1280 start 1376 end 1488 total 1800 skew    0 clock  60.00KHz
        v: height  960 start  961 end  964 total 1000           clock  60.00Hz
  1280x800 (0x4e) 83.500MHz -HSync +VSync
        h: width  1280 start 1352 end 1480 total 1680 skew    0 clock  49.70KHz
        v: height  800 start  803 end  809 total  831           clock  59.81Hz
  1280x720 (0x4f) 74.250MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  45.00KHz
        v: height  720 start  725 end  730 total  750           clock  60.00Hz
  1024x768 (0x50) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x51) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x52) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz

如您所见,有些平移非常疯狂,并非每次都会发生,而且我没有办法修复此问题。重新启动也无济于事。

$ xrandr|head -1
Screen 0: minimum 8 x 8, current 3840 x 1200, maximum 16384 x 16384

如果我打开大显示器就会发生这种情况:

$ xrandr
Screen 0: minimum 8 x 8, current 6400 x 1600, maximum 16384 x 16384
LVDS-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-2 connected primary 2560x1600+1920+0 (normal left inverted right x axis y axis) 641mm x 400mm
   2560x1600     59.97*+
   1920x1200     59.88  
   1680x1050     59.95  
   1600x1200     60.00  
   1440x900      59.89  
   1400x1050     59.98  
   1360x765      59.85  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   640x480       75.00    72.81    59.94  
DP-3 connected 1920x1200+2667+0 (normal left inverted right x axis y axis) 519mm x 324mm panning 6400x1200+0+0 tracking 6400x1600+0+0 border 0/0/0/0
   1920x1200     59.95*+  59.88  
   1920x1080     59.94  
   1680x1050     59.95  
   1440x900      59.89  
   1400x1050     59.98  
   1280x1024     60.02  
   1280x960      60.00  
   1280x800      59.81  
   1280x720      60.00    59.94  
   1024x768      60.00  
   800x600       60.32    56.25  
   720x480       59.94  
   640x480       59.94  
LVDS-1-1 connected
   640x480       59.94  
   320x240       60.05 
VGA-1-1 connected 1920x1200+4480+0 519mm x 324mm
   1920x1200     59.95*+
   1920x1080     60.00  
   1680x1050     59.95  
   1400x1050     59.98  
   1280x1024     60.02  
   1440x900      59.89  
   1280x960      60.00  
   1280x800      59.81  
   1280x720      60.00  
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       60.00  
  640x480 (0x45) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
  1920x1200 (0x47) 154.000MHz +HSync -VSync
        h: width  1920 start 1968 end 2000 total 2080 skew    0 clock  74.04KHz
        v: height 1200 start 1203 end 1209 total 1235           clock  59.95Hz
  1680x1050 (0x49) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1400x1050 (0x4a) 121.750MHz -HSync +VSync
        h: width  1400 start 1488 end 1632 total 1864 skew    0 clock  65.32KHz
        v: height 1050 start 1053 end 1057 total 1089           clock  59.98Hz
  1280x1024 (0x4b) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1440x900 (0x4c) 106.500MHz -HSync +VSync
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock  55.93KHz
        v: height  900 start  903 end  909 total  934           clock  59.89Hz
  1280x960 (0x4d) 108.000MHz +HSync +VSync
        h: width  1280 start 1376 end 1488 total 1800 skew    0 clock  60.00KHz
        v: height  960 start  961 end  964 total 1000           clock  60.00Hz
  1280x800 (0x4e) 83.500MHz -HSync +VSync
        h: width  1280 start 1352 end 1480 total 1680 skew    0 clock  49.70KHz
        v: height  800 start  803 end  809 total  831           clock  59.81Hz
  1280x720 (0x4f) 74.250MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  45.00KHz
        v: height  720 start  725 end  730 total  750           clock  60.00Hz
  1024x768 (0x50) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x51) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x52) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz

如果我切换到正常的工作区,其中所有 3 个屏幕都在工作,它看起来像这样:

$ xrandr
Screen 0: minimum 8 x 8, current 6400 x 1600, maximum 16384 x 16384
LVDS-0 disconnected (normal left inverted right x axis y axis)
DP-0 disconnected (normal left inverted right x axis y axis)
DP-1 connected 1920x1200+4480+0 (normal left inverted right x axis y axis) 519mm x 324mm
   1920x1200     59.95*+
   1680x1050     59.95  
   1440x900      59.89  
   1400x1050     59.98  
   1280x1024     60.02  
   1280x960      60.00  
   1280x800      59.81  
   1280x720      60.00  
   1024x768      60.00  
   800x600       60.32    56.25  
   720x480       59.94  
   640x480       59.94  
HDMI-0 disconnected (normal left inverted right x axis y axis)
DP-2 connected primary 2560x1600+1920+0 (normal left inverted right x axis y axis) 641mm x 400mm
   2560x1600     59.97*+
   1920x1200     59.88  
   1680x1050     59.95  
   1600x1200     60.00  
   1440x900      59.89  
   1400x1050     59.98  
   1360x765      59.85  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   640x480       75.00    72.81    59.94  
DP-3 disconnected (normal left inverted right x axis y axis)
LVDS-1-1 connected
   640x480       59.94  
   320x240       60.05  
VGA-1-1 connected 1920x1200+0+0 519mm x 324mm
   1920x1200     59.95*+
   1920x1080     60.00  
   1680x1050     59.95  
   1400x1050     59.98  
   1280x1024     60.02  
   1440x900      59.89  
   1280x960      60.00  
   1280x800      59.81  
   1280x720      60.00  
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       60.00  
  640x480 (0x45) 25.175MHz -HSync -VSync
        h: width   640 start  656 end  752 total  800 skew    0 clock  31.47KHz
        v: height  480 start  490 end  492 total  525           clock  59.94Hz
  1920x1200 (0x47) 154.000MHz +HSync -VSync
        h: width  1920 start 1968 end 2000 total 2080 skew    0 clock  74.04KHz
        v: height 1200 start 1203 end 1209 total 1235           clock  59.95Hz
  1680x1050 (0x49) 146.250MHz -HSync +VSync
        h: width  1680 start 1784 end 1960 total 2240 skew    0 clock  65.29KHz
        v: height 1050 start 1053 end 1059 total 1089           clock  59.95Hz
  1400x1050 (0x4a) 121.750MHz -HSync +VSync
        h: width  1400 start 1488 end 1632 total 1864 skew    0 clock  65.32KHz
        v: height 1050 start 1053 end 1057 total 1089           clock  59.98Hz
  1280x1024 (0x4b) 108.000MHz +HSync +VSync
        h: width  1280 start 1328 end 1440 total 1688 skew    0 clock  63.98KHz
        v: height 1024 start 1025 end 1028 total 1066           clock  60.02Hz
  1440x900 (0x4c) 106.500MHz -HSync +VSync
        h: width  1440 start 1520 end 1672 total 1904 skew    0 clock  55.93KHz
        v: height  900 start  903 end  909 total  934           clock  59.89Hz
  1280x960 (0x4d) 108.000MHz +HSync +VSync
        h: width  1280 start 1376 end 1488 total 1800 skew    0 clock  60.00KHz
        v: height  960 start  961 end  964 total 1000           clock  60.00Hz
  1280x800 (0x4e) 83.500MHz -HSync +VSync
        h: width  1280 start 1352 end 1480 total 1680 skew    0 clock  49.70KHz
        v: height  800 start  803 end  809 total  831           clock  59.81Hz
  1280x720 (0x4f) 74.250MHz +HSync +VSync
        h: width  1280 start 1390 end 1430 total 1650 skew    0 clock  45.00KHz
        v: height  720 start  725 end  730 total  750           clock  60.00Hz
  1024x768 (0x50) 65.000MHz -HSync -VSync
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x51) 40.000MHz +HSync +VSync
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x52) 36.000MHz +HSync +VSync
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz

答案1

在某些情况下,我还添加了一些奇怪的平移。我最终使用了nvidia-settings而不是xrandr。语法更加混乱,但可以正常工作。

这是一个示例命令:

nvidia-settings --assign "CurrentMetaMode=DP-5: nvidia-auto-select @1680x1050 +0+0 {ViewPortIn=1680x1050, ViewPortOut=1680x1050+0+0, ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, DP-2: nvidia-auto-select @1920x1080 +1680+0 {ViewPortIn=1920x1080, ViewPortOut=1920x1080+0+0, ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}, DP-1: nvidia-auto-select @1920x1080 +3600+0 {ViewPortIn=1920x1080, ViewPortOut=1920x1080+0+0, ForceCompositionPipeline=On, ForceFullCompositionPipeline=On}"

您可以使用 获取“当前元模式” nvidia-settings --query CurrentMetaMode。此输出中的显示名称与 中的不同xrandr,您可以使用 获取别名nvidia-settings --query dpys

答案2

我刚刚重新使用我的旧戴尔笔记本电脑,它有 nvidia 适配器,最近将其切换到 nvidia 专有驱动程序。

xrandr --transform当我使用任何基于命令时,我开始看到类似的行为--fbnvidia驱动程序强制执行一些平移设置,即使我没有使用明确设置它 --panning

  • 有时设置--fb--panning或两者可以解决问题,例如:

    xrandr --fb 6400x1600 --output "VGA-1-1" --mode 1920x1200 --panning 0x0 --output DP-2 --mode 2560x1600 --panning 0x0 --left-of VGA-1-1  --output DP-3 --mode 1920x1200 --panning 0x0 --left-of DP-2
    
  • --panning 2561x1600加上 1px 然后恢复正常,--panning 2560x1600使 nvidia 驱动程序修复 FB 大小。

在某些情况下,我只是厌倦了 xrandr/nvidia 的错误组合,只能注销/登录。我有 GT218M [NVS 3100M]、nvidia-340、Xubuntu 16.04。

答案3

这似乎是 nvidia 的一个错误...我无法将 DP-0 放在中间,只能放在最右边。然后我通过在第一个显示器和 DP-0 之间留出 10px 的间隙来解决问题...这有效。

相关内容