X Sever —— Xorg
阅读原文时间:2023年07月13日阅读:3

 发表于 2020-03-20 分类于 系统服务 , Xorg 阅读次数:39 阅读次数:48
 本文字数: 7k 阅读时长 ≈ 6 分钟

Xorg:基于X11协议的服务端。管理硬件设备(驱动),键盘鼠标显示器等

生成配置文件

1

# Xorg -configure :2

:2显示窗口,在Xorg启动的情况下,无法获取当前的Xorg配置文件

xorg.conf

具体参数说明:man xorg.conf

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152

Section "ServerLayout"
Identifier "X.org Configured"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" RightOf "Screen0"
InputDevice "Mouse0" "CorePointer"
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath "/usr/lib/xorg/modules"
FontPath "/usr/share/fonts/X11/misc"
FontPath "/usr/share/fonts/X11/cyrillic"
FontPath "/usr/share/fonts/X11/100dpi/:unscaled"
FontPath "/usr/share/fonts/X11/75dpi/:unscaled"
FontPath "/usr/share/fonts/X11/Type1"
FontPath "/usr/share/fonts/X11/100dpi"
FontPath "/usr/share/fonts/X11/75dpi"
FontPath "built-ins"
EndSection

Section "Module"
Load "glx"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
EndSection

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

Section "Monitor"
Identifier "Monitor0"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection

Section "Monitor"
Identifier "Monitor1"
VendorName "Monitor Vendor"
ModelName "Monitor Model"
EndSection

Section "Device"
### Available Driver options are:-
### Values: : integer, : float, : "True"/"False",
### : "String", : " Hz/kHz/MHz",
### : "%"
### [arg]: arg optional
#Option "Accel" # []
#Option "SWcursor" # []
#Option "EnablePageFlip" # []
#Option "SubPixelOrder" # []
#Option "ZaphodHeads" #
#Option "AccelMethod" #
#Option "DRI3" # []
#Option "DRI" #
#Option "ShadowPrimary" # []
#Option "TearFree" # []
#Option "DeleteUnusedDP12Displays" # []
Identifier "Card0"
Driver "amdgpu"
BusID "PCI:1:0:0"
EndSection

Section "Device"
### Available Driver options are:-
### Values: : integer, : float, : "True"/"False",
### : "String", : " Hz/kHz/MHz",
### : "%"
### [arg]: arg optional
#Option "Accel" # []
#Option "SWcursor" # []
#Option "EnablePageFlip" # []
#Option "SubPixelOrder" # []
#Option "ZaphodHeads" #
#Option "AccelMethod" #
#Option "DRI3" # []
#Option "DRI" #
#Option "ShadowPrimary" # []
#Option "TearFree" # []
#Option "DeleteUnusedDP12Displays" # []
Identifier "Card1"
Driver "amdgpu"
BusID "PCI:1:0:1"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Card0"
Monitor "Monitor0"
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 "Screen"
Identifier "Screen1"
Device "Card1"
Monitor "Monitor1"
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

注意:在xorg.conf中配置显卡总线地址BusID时,必须以十进制表示,比如lspci总线地址(以十六进制显示)为91:00.0,将其转换为十进制145:00:0(16x9+1)配置在xorg.conf中。

  • Driver的选择必须根据使用的显卡和系统的支持情况配置,在系统不支持的情况下可以使用modesetting代替测试,不一定配置成功

    • centos系统支持的驱动在/lib64/xorg/modules/drivers/

      1
      2

      # ls /lib64/xorg/modules/drivers/
      ati_drv.so dummy_drv.so fbdev_drv.so modesetting_drv.so nouveau_drv.so qxl_drv.so radeon_drv.so v4l_drv.so

    • ubuntu系统支持的驱动在/usr/lib/xorg/modules/drivers/

      1
      2

      ls /usr/lib/xorg/modules/drivers/
      amdgpu_drv.so ati_drv.so fbdev_drv.so intel_drv.so modesetting_drv.so nouveau_drv.so qxl_drv.so radeon_drv.so vesa_drv.so vmware_drv.so

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61

# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings: version 440.82

Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
InputDevice "Mouse0" "CorePointer"
Option "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"
# generated from default
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/input/mice"
Option "Emulate3Buttons" "no"
Option "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
# generated from default
Identifier "Keyboard0"
Driver "kbd"
EndSection

Section "Monitor"
# HorizSync source: edid, VertRefresh source: edid
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Philips PHL 237E7"
HorizSync 30.0 - 83.0
VertRefresh 56.0 - 76.0
Option "DPMS"
EndSection

Section "Device"
Identifier "Device0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "Quadro P6000"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Device0"
Monitor "Monitor0"
DefaultDepth 24
Option "Stereo" "0"
Option "nvidiaXineramaInfoOrder" "DFP-8"
Option "metamodes" "DP-5: nvidia-auto-select +1920+0, DP-7: nvidia-auto-select +0+0"
Option "SLI" "Off"
Option "MultiGPU" "Off"
Option "BaseMosaic" "off"
SubSection "Display"
Depth 24
EndSection

1

startx -- -layout seat0 -seat seat0 -novtswitch -sharevts

参数详解: man Xorg

手机扫一扫

移动阅读更方便

阿里云服务器
腾讯云服务器
七牛云服务器

你可能感兴趣的文章