X配置文件xorg.conf分析

转载于:http://blog.csdn.NET/comcat/archive/2007/04/02/1549658.aspx

作者:壮志凌云的csdn博客


X的配置,实际上就是生成 /etc/X11/xorg.conf 这个文件。


通常的配置主要对以下的Section作操作:

a. 显示器的信息写在该节

    Section “Monitor”

        Identifier     “monitor0”
        VendorName     “VSC”
        ModelName     “VSC1609 ”
        HorizSync     30 – 70
        VertRefresh     50 - 160
        ModeLine     “...”     --------->指定显示器的显示模式,很重要。
        ...
        ModeLine     “...”

    Endsection
        
  ModeLine 可以用ddcxinfo-knoppix直接生成。(通过检测你的显卡和显示器)
  或者通过gtf 直接计算标准的VESA mode lines。如:
        
        gtf 1024 768 85

  则生成:

  # 1024x768 @ 85.00 Hz (GTF) hsync: 68.60 kHz; pclk: 94.39 MHz
  Modeline "1024x768_85.00" 94.39 1024 1088 1200 1376 768 769 772 807 -HSync +Vsync

  要成为高手,能手工微调的话参考:
  http://www.tldp.org/HOWTO/XFree86-Video-Timings-HOWTO/
  中文版: http://man.chinaunix.Net/Linux/how/XFree86-Video-Timings-HOWTO.html
  作者Eric S. Raymond,勿须多言了。


b. 显卡信息写在该节

    Section “Device”

        Identifier “card0”
        VendorName “Intel”
        BoardName “Intel Corporation 82845G/GL/GE Chipset Integrated Graphics Device”
        Driver     “i810”
        BusID     “PCI:0:2:0”

    Endseciton

    PS: 一个PCI外设由BusID(8bit):DeviceID(5bit):FunctionID(3bit)来描述。在xorg.conf 中需用十进制表示。
    一般PCI接口的显卡的总线编号为0,AGP接口的显卡的总线编号为1。
    单显卡的情况下可以没有BusID这一行。

    X所用之所有驱动都安装在/usr/X11R6/lib/modules/drivers/ ,官方驱动亦是。
    (注: 最新版本的Xorg,其驱动位于 /usr/lib/xorg/modules/drivers/ )
    比如安装了官方的nvidia驱动后,会在上述目录中放置nvidia_drv.o文件,则在上节中指定: 

        Driver “nvidia” (X自带的驱动为nv,相应的文件为nv_drv.so)


c. 一个显卡和一个显示器则组成一个screen,用Section “Screen” 描述。


    Section “Screen”

        Identifier     “screen0”
        Device         “card0”
        Monitor     “monitor0”
        DefaultDepth     24

        SubSection     “Display”
              Depth     24
              Modes     “1024x768” “800x600” “640x480”
        EndSubSection
        ...

    EndSection

    若还有一块显卡,其上也接一显示器则再加一Section “Screen”描述。

    Section “Screen”

        Identifier     “screen1”
        Device         “card1”
        Monitor     “monitor1”
        DefaultDepth     24

        SubSection     “Display”
              Depth     24
              Modes     “1024x768” “800x600” “640x480”
        EndSubSection
        ...

    EndSection


d. 若有两套独立的显卡显示器,则需在Section “ServerLayout”中对多个screen进行组织。

    Section “ServerLayout”

        Identifier “multihead layout”
        Screen     0 “screen0” 0 768
        Screen     1 “screen1” 0 0
        ...
        Option     “Xinerama” “on”   ------------------->扩展桌面,off则为个体桌面

    EndSection

    PS: 其他常用的Option :

        Option "DontZap" 屏蔽 <Ctrl>+<Alt>+<Backspace>
        Option "DontVTSwitch" 屏蔽<Ctrl>+<Alt>+<Fn> 的控制台的切换
    
    更多选项参阅xorg.conf 的man手册

XF86Config说明 

文件的每节都是由下述的部分组成:



Section "SectionName"

SectionEntry



EndSection



SectionName包括:



Files      文件路径名

ServerFlags    服务器标志

Module      动态模块加载

InputDevice    输入设备描述

Device      图形设备描述

VideoAdaptor    Xv视频卡描述

Monitor      监视器描述

Modes       视频模式描述

Screen      屏幕配置

ServerLayout    全面的层叠

DRI      DRI特定的配置

Vendor      供应商特定的配置





出于向下兼容的目的,下列项虽已废除但是配置文件仍能识别。在新的配置文件中,应使用新的InputDevice项。

Keyboard 键盘配置

Pointer 指针/鼠标配置

老的XInput节已经被废除。



ServerLayout在最高层。它们绑定的输入输出设备会在这一节里使用。输入设备由InputDevice描述,

输出设备通常有多个独立的组件组成。多个组件组成Screen节。每个Screen节将图形板和监视器绑定在一起。

显示卡由Device节描述,监视器由Monitor节描述。

RGBPath "path"

rgb颜色数据库的路径,缺省值为:/usr/X11R6/lib/X11/rgb。





Option "AllowMouseOpenFail" "boolean"

即使鼠标设备不能被打开/初始化也允许X服务器启动









1)Layout主节点包括Mouse/Keyboard和Screen



Section "ServerLayout"



Identifier "Layout0"

Screen "Screen0"

#Screen "Screen1" Below "Screen0"

InputDevice "Mouse0" "CorePointer"

InputDevice "Keyboard0" "CoreKeyboard"



EndSection





2)扩展支持



Section "ServerFlags"



option "Xinerama" "on"和dri有冲突



EndSection



3)定义mouse



主设备号可以在/proc/devices找到。每一个物理设备由设备驱动程序控

制且被分配一个次设备号



Section "InputDevice"

Identifier "Mouse0"

Driver "mouse"

Option "Protocol"  "ImPS/2"    (键位说明)

Option "ZAxisMapping"  "4 5"

Option "Device"   "/dev/input/mice" (如果是ps/2的接口)

EndSection

Emulate3Buttons是否模拟3键鼠标



4)定义字体



ection "Files"



RgbPath  "/usr/X11R6/lib/X11/rgb"

FontPath  "/usr/X11R6/lib/X11/fonts/local/"

FontPath  "/usr/X11R6/lib/X11/fonts/misc/"

FontPath  "/usr/X11R6/lib/X11/fonts/75dpi/:unscaled"

FontPath  "/usr/X11R6/lib/X11/fonts/100dpi/:unscaled"

FontPath  "/usr/X11R6/lib/X11/fonts/Type1/"

FontPath  "/usr/X11R6/lib/X11/fonts/Speedo/"

FontPath  "/usr/X11R6/lib/X11/fonts/75dpi/"

FontPath  "/usr/X11R6/lib/X11/fonts/100dpi/"



#FontPath   "unix/:7100"

EndSection



5)定义显卡

Section "Device"

Identifier "Videocard0"

Option "DesktopSetup"    "0x00000000"

Driver  "fglrx"(说明驱动/usr/X11R6/lib/modules/drivers)

VendorName "ATI"

BoardName  "ATI Radeon 7000"

BusID  "PCI:1:0:0" (lspci和scanpci -v得到)

Screen0

EndSection



6)定义ddcprobe(显示器)

Section "Monitor"



Identifier  "Monitor0"

VendorName  "Sony"

ModelName  "Sony CPD-G520"

HorizSync  30.0 - 121.0 改刷新率 (横显示器 )

VertRefresh 48.0 - 160.0 改刷新率 (纵显示器-分辨率 )

Option  "dpms"

EndSection



7)附加的模块



Section "Module"

Load "dbe" 

Load "extmod"

Load "fbdevhw"

Load "glx"

Load "record"

Load "freetype"

Load "type1"

#Load "dri"



EndSection



说明对DRI的使用者



#Section "DRI"

#Group  10

#Mode  0666

#EndSection



定义关联



Section "Screen"

Identifier "Screen1" 

Device   "Videocard0" 定义显卡

Monitor  "Monitor1"  显示器

DefaultDepth   24  色深

SubSection "Display"  

Viewport  0 0    虚拟屏

Depth   24

Modes  "1024x768"  屏幕分辨率

EndSubSection

EndSection



VideoRam mem

此选项指定图形卡的RAM数量,以KB为单位。X服务程序会自动探测显示卡,所以此字段一定不要指定。'

我用的是cent   OS的linux ,主板上的显示芯片是intel的852GM,我在xp下设置双显没有问题,可是在linux下修改完/etc/X11/xorg.conf的内容后tv上没有信号输出,crt可以正常显示。
经过本人研究终于解决了问题,现在供大家参考

在图形界面下以root身份登陆,修改/etc/X11/xorg.conf文件,下面是修改后的内容。

  



   Section "ServerLayout"



Identifier     "Multihead layout"



Screen    0   "Screen0" LeftOf "Screen1"



Screen    1   "Screen1" 0 0



InputDevice "Mouse0" "CorePointer"



InputDevice "Keyboard0" "CoreKeyboard"



Option    "Xinerama" "on"

      

Option       "MonitorLayout"   "anystr"



Option           "Clone" "off"



   EndSection









   Section "Files"







RgbPath        "/usr/X11R6/lib/X11/rgb"



FontPath    "unix/:7100"



   EndSection











   Section "Module"



Load   "dbe"



Load   "extmod"



Load   "fbdevhw"



Load   "glx"



Load   "record"



Load   "freetype"



Load   "type1"



Load   "dri"



   EndSection











   Section    "InputDevice"



Identifier   "Keyboard0"



Driver    "kbd"



Option "XkbModel" "pc105"



Option "XkbLayout" "us"



   EndSection











   Section           "InputDevice"



Identifier    "Mouse0"



Driver       "mouse"



Option        "Protocol" "IMPS/2"



Option        "Device" "/dev/input/mice"



Option        "ZAxisMapping" "4 5"



Option        "Emulate3Buttons" "yes"



   EndSection











   Section           "Monitor"



Identifier    "Monitor0"



VendorName    "Monitor Vendor"



ModelName    "SyncMaster"



DisplaySize    320 240



HorizSync        30.0 - 71.0



VertRefresh    50.0 - 160.0



Option        "dpms"

      

Option       "MonitorLayout" "CRT,TV"



   EndSection









   Section        "Monitor"



Identifier "Monitor1"



VendorName "Monitor Vendor"



ModelName "LCD Panel 800x600"



HorizSync 31.5 - 37.9



VertRefresh   40.0 - 70.0

   

Option    "MetaModes" "800x600"

      

Option    "TVOutFormat" "COMPOSITE"

      

OPtion    "TVStandard" "NTSC-M"

      

Option    "ConnectedMonitor" "TV"



Option    "dpms"

      

Option    "MonitorLayout" "CRT,TV"



   EndSection











   Section    "Device"



Identifier   "Videocard0"



Driver    "i810"



VendorName   "Videocard vendor"



BoardName "Intel 852"



   EndSection











   Section    "Device"



Identifier   "Videocard1"



Driver    "i810"



VendorName   "Videocard Vendor"



BoardName "Intel 852"



BusID    "PCI:0:2:0"



Screen    1



   EndSection











   Section "Screen"



Identifier "Screen0"



Device     "Videocard0"



Monitor "Monitor0"



DefaultDepth     24





SubSection "Display"



   Viewport 0 0



   Depth     16



   Modes "800x600" "640x480"



EndSubSection





SubSection "Display"



   Viewport 0 0



   Depth     24



   Modes "800x600" "640x480"



EndSubSection



   EndSection









   Section "Screen"



Identifier "Screen1"



Device     "Videocard1"



Monitor "Monitor1"



DefaultDepth     24





SubSection "Display"



   Viewport 0 0



   Depth     24



   Modes "800x600"



EndSubSection



   EndSection











   Section "DRI"



Group        0



Mode       0666



   EndSection
 
双屏配置
2007-11-17 20:11

一直不知道i915的显卡还能使用MergedFB,原来在试验双显示器的时候,只用过Xinerama,但Xinerama使用后会禁止DRI,导致不能使用硬件加速以及AIGLX和XGL等三维效果。

主要的配置都在/etc/X11/xorg.conf的文件里。
关键的部分,一个是在Device节里:

Option "MergedFB" "true"

另外一个部分是在Screen节里:

SubSection "Display"
Depth 24
Virtual 1560 1024
EndSubSection

SubSection "Display"
Depth 24
Modes "1400x1050 1280x1024 1024x768"
EndSubSection

要添加一个Virtual的桌面大小定义。通常这个Virtual的桌面就是两个显示器的分辨率之和。
我的xorg.conf配置:

Section "Files"
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"
# path to defoma fonts
FontPath "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
Load "i2c"
Load "bitmap"
Load "ddc"
Load "dri"
Load "extmod"
Load "freetype"
Load "glx"
Load "int10"
Load "vbe"
EndSection

Section "InputDevice"
Identifier "Generic Keyboard"
Driver "kbd"
Option "CoreKeyboard"
Option "XkbRules" "xorg"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "InputDevice"
Identifier "Configured Mouse"
Driver "mouse"
Option "CorePointer"
Option "Device" "/dev/input/mice"
Option "Protocol" "ImPS/2"
Option "ZAxisMapping" "4 5"
Option "Emulate3Buttons" "true"
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "stylus"
Option "Device" "/dev/input/wacom"
Option "Type" "stylus"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "eraser"
Option "Device" "/dev/input/wacom"
Option "Type" "eraser"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "InputDevice"
Driver "wacom"
Identifier "cursor"
Option "Device" "/dev/input/wacom"
Option "Type" "cursor"
Option "ForceDevice" "ISDV4" # Tablet PC ONLY
EndSection

Section "Device"
Identifier "Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller"
Driver "i810"
BusID "PCI:0:2:0"
VideoRam 131072
# Screen 0
Option "No2048Limit" "true"
Option "DRI" "true"
Option "MergedFB" "true"
Option "DDCMode" "true"
Option "MonitorLayout" "CRT,LFP"
Option "SecondPosition" "LeftOf"
Option "MetaModes" "1024x768-1280x1024 1024x768"
Option "MergedNonRectangular" "ture"
Option "XAANoOffscreenPixmaps" "true"
Option "MergedXinerama" "true"
Option "crt2hsync" "30-82"
Option "crt2vrefresh" "50-85"
EndSection

Section "Monitor"
Identifier "Generic Monitor"
Option "DPMS"
HorizSync 28-51
VertRefresh 43-60
EndSection

Section "Screen"
Identifier "Default Screen"
Device "Intel Corporation Mobile 915GM/GMS/910GML Express Graphics Controller"
Monitor "Generic Monitor"
DefaultDepth 24
SubSection "Display"
Depth 24
Virtual 2048 1024
EndSubSection
SubSection "Display"
Depth 24
Modes "1280x1024" "1024x768"
EndSubSection
EndSection

Section "ServerLayout"
Identifier "MergedFB"
Screen 0 "Default Screen" 0 0
InputDevice "Generic Keyboard"
InputDevice "Configured Mouse"
InputDevice "stylus" "SendCoreEvents"
InputDevice "cursor" "SendCoreEvents"
InputDevice "eraser" "SendCoreEvents"
EndSection

Section "DRI"
Mode 0666
EndSection

郁闷的是,No2048Limit参数不起作用,不知道什么原因,导致我最大只能使用2048的宽度,在两个屏幕中间会有重合的部分,不爽。
还有,我一开始看库里还有一个xserver-xorg-video-intel的包,这个的版本更新一些,就稀里糊涂地装上,导致后面很长时间都没搞定,还是最后恢复成xserver-xorg-video-i810才搞定,还没搞清楚这两个包有什么关系。

参考:
1 http://dri.freedesktop.org/wiki/MergedFB
2 http://ubuntuforums.org/showthread.PHP?t=221174

X配置文件xorg.conf分析的更多相关文章

  1. Apache配置文件httpd.conf内容翻译

      本文已经废弃,现在apache2不依靠httpd.conf来配置. Ubuntu下默认的配置文件是/etc/apache2/sites-available/default 可以修改上面文件来修改a ...

  2. Nginx安装及配置文件nginx.conf详解

    1.安装Nginx 在安装Nginx之前,需确保系统已经安装了gcc. openssl-devel. pcre-devel和zlib-devel软件库. 下面是Nginx安装过程: wget http ...

  3. Redis(四):解析配置文件redis.conf

    解析配置文件redis.conf目录导航: 它在哪 Units单位 INCLUDES包含 GENERAL通用 SNAPSHOTTING快照 REPLICATION复制 SECURITY安全 LIMIT ...

  4. 红帽企业版RHEL7.1在研域工控板上,开机没有登陆窗口 -- 编写xorg.conf 简单三行解决Ubuntu分辩率不可调的问题

    红帽企业版RHEL7.1在研域工控板上,开机没有登陆窗口 没有登陆窗口 的原因分析: 没有登陆窗口的原因是因为有多个屏幕在工作,其中一个就是build-in 屏幕(内置的虚拟屏幕)和外接的显示器,并且 ...

  5. Neo4j配置文件neo4j.conf

    机器配置为256G内存,48核(物理核24)cpu,4T SAS盘(建议磁盘使用SSD) 图数据库Neo4j配置文件neo4j.conf 中常用参数: dbms.active_database=gra ...

  6. Nginx安装与配置文件nginx.conf详解

    引用“http://ixdba.blog.51cto.com/2895551/790611” 1.安装Nginx在安装Nginx之前,需确保系统已经安装了gcc. openssl-devel. pcr ...

  7. Nginx配置文件nginx.conf中文详解(转)

    ######Nginx配置文件nginx.conf中文详解##### #定义Nginx运行的用户和用户组 user www www; #nginx进程数,建议设置为等于CPU总核心数. worker_ ...

  8. 配置文件keepalived.conf详解

    keepalived.conf       一个功能比较完整的keepalived 的配置文件,其配置文件keepalived.conf 可以包含三个文本块:全局定义块.VRRP 实例定义块及虚拟服务 ...

  9. redis配置文件redis.conf参数说明

    redis配置文件redis.conf参数说明 (2013-01-09 21:20:40)转载▼ 标签: redis配置 redis.conf 配置说明 杂谈 分类: nosql # By defau ...

  10. sphinx配置文件sphinx.conf参数详细说明

    sphinx配置文件sphinx.conf参数详细说明 sphinx.conf各个参数详细说明 # # Sphinx configuration file sample # # WARNING! Wh ...

随机推荐

  1. window nginx php ci框架环境搭建

    下载nginx 后修改配置文件: location / { #try_files $uri $uri/ /index.php?$query_string; root C:\Software\serve ...

  2. .net 生成Excel并保存

    void SaveQuestionToExcel(List<Question> datas, string path) { using (Workbook workbook = new H ...

  3. jmeter工具2个打开方法+配置黑窗口启动jmeter工具。

    实现从cmd黑窗口,输入jmeter,即可弹出jmeter工具界面.方法一:直接去安装在的目录,找jmeter_5.4.bat文件,双击即可打开工具. 方法二: 在环境变量中,配置JMETER_HOM ...

  4. Python第十章实验报告

    一.实验对象:<零基础学Python>6道实例和2道实战 二.实验环境:IDLE Shell 3.9.7 三.实验目的:学习如何在Python中进行文件和目录的相关操作 四.实验过程: 实 ...

  5. SQL语句用法总结

    use quan56_goods; 使用数据库 show tables; 展示数据表 模糊查询 select * from tb_brand where name like '%林%'; 顺序 书写顺 ...

  6. Spring-纯Java创建一个SSM【webapp】

    纯Java搭建webapp QuickStart 使用纯 Java 来搭建一个 SSM 环境,即在项目中,不存在任何 XML 配置,包括 web.xml 1创建一个Maven工程 引入依赖 <! ...

  7. PHP 计算机码、位运算、运算符优先级

    计算机码 计算机在实际存储数据的时候,是采用编码规则的(二进制编码) 计算机码存储的过程: 原码.反码和补码,数值最左边一位用来充当符号位:符号为正数为0,负数为1 原码:数据本身从十进制转换为二进制 ...

  8. 如何使用webgl(three.js)实现3D消防、3D建筑消防大楼、消防数字孪生、消防可视化解决方案——第十八课(一)

    序: 又是很久没出随笔文章了,一篇文章有时候整理一天,实在是抽不出来时间. 最近在回顾几年前的项目时,发现这个智慧三维消防可视化项目很有回顾价值,索性就拿出来讲讲. 首先,我们要知道消防里的知识,不是 ...

  9. RunnerGo相较于Jmeter优劣势分析

    RunnerGo是一款基于go语言研发的开源测试平台.在这里我想从性能测试方面.结构方面以及功能方面对比两款产品. 性能方面: Runner基于go语言研发,相对于jmeter来说更轻量级.所以性能测 ...

  10. 中国科学院2019年大学生数学夏令营考试试题 选做 (Mathematica练习)

    目录 试题 1 6 9 solution to (1) solution to (2) 相关读物 试题 选择性地做一些,没有对答案.能机器算的我就不拿纸笔算了,当然实际考试是笔试... 不定期更新 1 ...