Ubuntu14.04在lightdm服务启动前是无法使用xrandr获取屏幕相关信息的,但是lightd在启动X的时候输出信息如下面149~152行部分:
当然lightdm设置了用户自动登陆
代码:
128 [ 13.419] (II) intel(0): SNA compiled: xserver-xorg-video-intel 2:2.99.910-0ubuntu1.6 (Timo Aaltonen <tjaalton@debian.org>)
129 [ 13.432] (WW) Falling back to old probe method for modesetting
130 [ 13.432] (WW) Falling back to old probe method for fbdev
131 [ 13.432] (II) Loading sub module "fbdevhw"
132 [ 13.432] (II) LoadModule: "fbdevhw"
133 [ 13.432] (II) Loading /usr/lib/xorg/modules/libfbdevhw.so
134 [ 13.436] (II) Module fbdevhw: vendor="X.Org Foundation"
135 [ 13.436] compiled for 1.15.1, module version = 0.0.2
136 [ 13.436] ABI class: X.Org Video Driver, version 15.0
137 [ 13.436] (WW) Falling back to old probe method for vesa
138 [ 13.436] (--) intel(0): Integrated Graphics Chipset: Intel(R) HD Graphics
139 [ 13.436] (--) intel(0): CPU: x86-64, sse2, sse3, ssse3, sse4.1, sse4.2
140 [ 13.437] (II) intel(0): Creating default Display subsection in Screen section
141 "Default Screen Section" for depth/fbbpp 24/32
142 [ 13.437] (==) intel(0): Depth 24, (--) framebuffer bpp 32
143 [ 13.437] (==) intel(0): RGB weight 888
144 [ 13.437] (==) intel(0): Default visual is TrueColor
145 [ 13.440] (**) intel(0): Framebuffer tiled
146 [ 13.440] (**) intel(0): Pixmaps tiled
147 [ 13.440] (**) intel(0): "Tear free" disabled
148 [ 13.440] (**) intel(0): Forcing per-crtc-pixmaps? no
149 [ 13.440] (II) intel(0): Output VGA1 has no monitor section
150 [ 13.440] (II) intel(0): Output HDMI1 has no monitor section
151 [ 13.440] (II) intel(0): Output DP1 has no monitor section
152 [ 13.440] (II) intel(0): Output VIRTUAL1 has no monitor section
153 [ 13.440] (==) intel(0): DPI set to (96, 96)
154 [ 13.440] (II) Loading sub module "dri2"
155 [ 13.440] (II) LoadModule: "dri2"
156 [ 13.440] (II) Module "dri2" already built-in
157 [ 13.440] (II) UnloadModule: "modesetting"
158 [ 13.440] (II) Unloading modesetting
159 [ 13.440] (II) UnloadModule: "fbdev"
160 [ 13.440] (II) Unloading fbdev
161 [ 13.440] (II) UnloadSubModule: "fbdevhw"
162 [ 13.440] (II) Unloading fbdevhw
163 [ 13.440] (II) UnloadModule: "vesa"
164 [ 13.440] (II) Unloading vesa
165 [ 13.440] (==) Depth 24 pixmap format is 32 bpp
166 [ 13.453] (II) intel(0): SNA initialized with Baytrail (gen7) backend
167 [ 13.453] (==) intel(0): Backing store enabled
168 [ 13.453] (==) intel(0): Silken mouse enabled
169 [ 13.453] (II) intel(0): HW Cursor enabled
170 [ 13.453] (II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled message.
171 [ 13.453] (==) intel(0): DPMS enabled
172 [ 13.453] (II) intel(0): [DRI2] Setup complete
173 [ 13.453] (II) intel(0): [DRI2] DRI driver: i965
174 [ 13.453] (II) intel(0): [DRI2] VDPAU driver: i965
175 [ 13.453] (II) intel(0): direct rendering: DRI2 Enabled
176 [ 13.453] (==) intel(0): hotplug detection: "enabled"
177 [ 13.453] (--) RandR disabled
178 [ 13.462] (II) SELinux: Disabled on system
179 [ 13.587] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
这里只有一个HDMI接口,通过无源HDMI转VGA转换器接了一个1366x768的15吋显示器。
X启动后在后台运行,但是在vt7上并没有任何输出信息,屏幕为无信号的状态,
按ctrl+alt+F1可以切到tty1,登陆执行sudo service lightdm restart 后自定义桌面能够在vt7上显示出来,这时候Xorg.0.log的输出
代码:
[ 348.521] (**) intel(0): "Tear free" disabled
[ 348.521] (**) intel(0): Forcing per-crtc-pixmaps? no
[ 348.521] (II) intel(0): Output VGA1 has no monitor section
[ 348.521] (II) intel(0): Output HDMI1 has no monitor section
[ 348.521] (II) intel(0): Output DP1 has no monitor section
[ 348.521] (II) intel(0): Output VIRTUAL1 has no monitor section
[ 348.521] (--) intel(0): Output HDMI1 using initial mode 1280x720 on pipe 0
[ 348.521] (==) intel(0): DPI set to (96, 96)
手动执行重启lightdm后Xorg.0.log输出了设置HDMI1为1280x720!
我记得以前最小化安装X及桌面后直接startx能在vt7上启动图形的,还是说vt7上的输出必须要用gnome/kde等桌面来设置?
后来我在openbox的自启动脚本里加上了下面几句也解决了:
代码:
xrandr --newmode "1024x768" 63.50 1024 1072 1176 1328 768 771 775 798 -hsync +vsync #设置一个新的显示mode
xrandr --addmode HDMI1 1024x768 # 添加新的显示mode到 HDMI1
xrandr --output HDMI1 --mode 1024x768 #设置HDMI1显示
其中1024x768的显示mode可以通过 cvt 1024 768 命令获得信息
so,现在我的问题是
X启动的时候在那个阶段确定输出显示器的信息(VGA?HDMI?DVI?以及显示器的分辨率等),还是说那个地方可以设置?