# vim:set nowrap noet ts=8 sw=2 ft=xf86conf:

# Copyright (C) 2006 PeterG. This program is free software: you
# can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software
# Foundation, either version 2 of the License, or (at your
# option) any later version. This program is distributed in the
# hope that it will be useful, but WITHOUT ANY WARRANTY; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.

# 060921

# This configuration is a very generic 'Xorg' one for a dual monitor
# single card setup using the proprietary NVIDIA drivers with Xinerama,
# not TwinView. The free software Xorg "nv" driver does not seem to
# support dual head on many cards.  This configuration can be easily
# modified for one monitor only, or for two monitors on two monitors
# on two cards.

Section "Files"
  FontPath	"/usr/share/X11/fonts/misc:unscaled"
  FontPath	"/usr/share/X11/fonts/100dpi:unscaled"
  FontPath	"/usr/share/X11/fonts/75dpi:unscaled"

  FontPath	"/usr/share/X11/fonts/misc"
  FontPath	"/usr/share/X11/fonts/100dpi"
  FontPath	"/usr/share/X11/fonts/75dpi"

  FontPath	"/usr/share/X11/fonts/Type1"

  # Add here paths to the TrueType font directories
  #FontPath	"/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section	"ServerFlags"
  Option	"AllowMouseOpenFail" 	"on"

  # Other extended keys, using <Shift><Alt> as prefix, can be enabled
  # using XKB AccessX 'mousekeys', and these are mouse simulation keys.
  #   <URL:http://Pascal.TSU.RU/en/xkb/internals.html#mouse>
  Option	"HandleSpecialKeys"	"WhenNeeded"
  Option	"AllowClosedownGrabs"	"on"
  Option	"AllowDeactivateGrabs"	"on"

  # The "BlankTime" is for the X11 screen saver, and the other three
  # are for the DPMS logic. All times in minutes.
  Option	"BlankTime"		"2"
  Option	"StandbyTime"		"5"
  Option	"SuspendTime"		"10"
  Option	"OffTime"		"20"
EndSection

Section "Module"
  SubSection "extmod"
    Option	"omit XFree86-DGA"
  EndSubSection
  Load		"dbe"
  Load		"extmod"
  Load		"freetype"
  Load		"bitmap"
  Load		"glx"
# Load		"dri"
  Load		"int10"
  Load		"v4l"
  Load		"vbe"
EndSection

Section "DRI"
  Mode		0666
EndSection

Section "InputDevice"
  Identifier	"Generic Keyboard"
  Driver	"kbd"

  Option	"CoreKeyboard"

  Option	"XkbRules"		"xorg"
  Option	"XkbModel"		"pc105"
  Option	"XkbLayout"		"gb"
EndSection

Section "InputDevice"
  Identifier	"Generic Mouse"
  Driver	"mouse"

  Option	"CorePointer"

  Option	"Resolution"		"400"
  Option	"BaudRate"		"9600"
  Option	"SampleRate"		"250"

  Option	"Device"		"/dev/input/mice"
  Option	"Protocol"		"ExplorerPS/2"
  Option	"ZAxisMapping"		"4 5"
  Option	"Emulate3Buttons"	"true"
EndSection

Section		"Modes"
  Identifier	"VESA"

  # 640x350@31.5MHz => 85Hz, 37.9kHz
  # 640x400@31.5MHz => 85Hz, 37.9kHz
  ModeLine "640x350" 31.5 640 672 736 832 350 382 385 445 +HSync -VSync
  ModeLine "640x400" 31.5 640 672 736 832 400 401 404 445 -HSync +VSync

  # 640x480@25.2MHz => 60Hz, 31.5kHz (not quite VESA , but common)
  # 640x480@31.5MHz => 72Hz, 37.9kHz
  # 640x480@31.5MHz => 75Hz, 37.5kHz
  # 640x480@36.0MHz => 85Hz, 43.3kHz
  ModeLine "640x480" 25.2 640 656 752 800 480 490 492 525 -HSync -VSync
  ModeLine "640x480" 31.5 640 664 704 832 480 489 491 520 -HSync -VSync
  ModeLine "640x480" 31.5 640 656 720 840 480 481 484 500 -HSync -VSync
  ModeLine "640x480" 36.0 640 696 752 832 480 481 484 509 -HSync -VSync

  # 720x400@35.5MHz => 85Hz, 37.9kHz
  # 800x600@36.0MHz => 56Hz, 35.2kHz
  # 800x600@40.0MHz => 60Hz, 37.9kHz
  # 800x600@49.5MHz => 75Hz, 46.9kHz
  # 800x600@50.0MHz => 72Hz, 48.1kHz
  # 800x600@56.3MHz => 85Hz, 53.7kHz
  ModeLine "720x400" 35.5 720 756 828 936 400 401 404 446 -HSync +VSync
  ModeLine "800x600" 36.0 800 824 896 1024 600 601 603 625 +HSync +VSync
  ModeLine "800x600" 40.0 800 840 968 1056 600 601 605 628 +HSync +VSync
  ModeLine "800x600" 49.5 800 816 896 1056 600 601 604 625 +HSync +VSync
  ModeLine "800x600" 50.0 800 856 976 1040 600 637 643 666 +HSync +VSync
  ModeLine "800x600" 56.3 800 832 896 1048 600 601 604 631 +HSync +VSync

  # 1024x768i@44.9MHz => 43Hz (industry standard) hsync: 35.5kHz
  # 1024x768@65.0MHz => 60Hz, 48.4kHz
  # 1024x768@75.0MHz => 70Hz, 56.5kHz
  # 1024x768@78.8MHz => 75Hz, 60.0kHz
  # 1024x768@94.5MHz => 85Hz, 68.7kHz
  ModeLine "1024x768" 44.9 1024 1032 1208 1264 768 768 776 817 +HSync +VSync Interlace
  ModeLine "1024x768" 65.0 1024 1048 1184 1344 768 771 777 806 -HSync -VSync
  ModeLine "1024x768" 75.0 1024 1048 1184 1328 768 771 777 806 -HSync -VSync
  ModeLine "1024x768" 78.8 1024 1040 1136 1312 768 769 772 800 +HSync +VSync
  ModeLine "1024x768" 94.5 1024 1072 1168 1376 768 769 772 808 +HSync +VSync

  # 1152x864@108MHz => 75Hz, 67.5kHz
  ModeLine "1152x864" 108.0 1152 1216 1344 1600 864 865 868 900 +HSync +VSync

  # 1280x960@108.0MHz => 60Hz, 60.0kHz
  # 1280x960@148.5MHz => 85Hz, 85.9kHz
  # 1280x1024@108.0MHz => 60Hz, 64.0kHz
  # 1280x1024@135.0MHz => 75Hz, 80.0kHz
  # 1280x1024@157.5MHz => 85Hz, 91.1kHz
  ModeLine "1280x960" 108.0 1280 1376 1488 1800 960 961 964 1000 +HSync +VSync
  ModeLine "1280x960" 148.5 1280 1344 1504 1728 960 961 964 1011 +HSync +VSync
  ModeLine "1280x1024" 108.0 1280 1328 1440 1688 1024 1025 1028 1066 +HSync +VSync
  ModeLine "1280x1024" 135.0 1280 1296 1440 1688 1024 1025 1028 1066 +HSync +VSync
  ModeLine "1280x1024" 157.5 1280 1344 1504 1728 1024 1025 1028 1072 +HSync +VSync
EndSection

Section "Monitor"
  Identifier	"Monitor LCD M0"
  VendorName	"Monitor"
  ModelName	"LCD"
  UseModes	"VESA"

  # Exactly 13.4"x10.6", which gives 96DPI (100DPI)
  DisplaySize	338 270

  Gamma		1.2

# Bandwidth	140
  HorizSync	30-71
  VertRefresh	56-62	# Really 75Hz, but LCDs should be run lower

  Option	"DPMS"			"on"
EndSection

Section "Monitor"
  Identifier	"Monitor LCD M1"
  VendorName	"Monitor"
  ModelName	"LCD"
  UseModes	"VESA"

  # Exactly 13.4"x10.6", which gives 96DPI (100DPI)
  DisplaySize	338 270

  Gamma		1.2

# Bandwidth	140
  HorizSync	30-71
  VertRefresh	56-62	# Really 75Hz, but LCDs should be run lower

  Option	"DPMS"			"on"
EndSection

Section "Device"
  Identifier	"Device NVIDIA D0"
  Driver	"nvidia"

  BusID		"PCI:1:0:0"
  Screen	0
  #Option	"CrtcNumber"		"0"
  #Option	"ConnectedMonitor"	"DFP-0"
  #Option	"UseInt10Module"	"false"

  Option	"HWCursor"		"off"

  Option	"UseEDIDFreqs"		"false"

  Option	"NvAGP"                 "2"
  Option	"TwinView"		"off"

  Option	"Coolbits"              "1"
  Option	"AllowGLXWithComposite"	"false"
  Option	"NoRenderExtension"	"false"
  Option	"RenderAccel"		"true"
  Option	"CursorShadow"         	"true"
EndSection

Section "Device"
  Identifier	"Device NVIDIA D1"
  Driver	"nvidia"

  BusID		"PCI:1:0:0"
  Screen	1
  #Option	"CrtcNumber"		"1"
  #Option	"ConnectedMonitor"	"DFP-1"
  #Option	"UseInt10Module"	"false"

  Option	"HWCursor"		"off"

  Option	"UseEDIDFreqs"		"false"

  Option	"NvAGP"                 "2"
  Option	"TwinView"		"off"

  Option	"Coolbits"              "1"
  Option	"AllowGLXWithComposite"	"false"
  Option	"NoRenderExtension"	"false"
  Option	"RenderAccel"		"true"
  Option	"CursorShadow"         	"true"
EndSection

Section "Screen"
  Identifier	"Screen 0"
  Monitor	"Monitor LCD M0"
  Device	"Device NVIDIA D0"

  DefaultDepth	24

  SubSection "Display"
    Depth	16
    Modes	"1280x1024" "1024x768" "800x600" "640x480"
  EndSubSection

  SubSection "Display"
    Depth	24
    Modes	"1280x1024" "1024x768" "800x600" "640x480"
  EndSubSection
EndSection

Section "Screen"
  Identifier	"Screen 1"
  Monitor	"Monitor LCD M1"
  Device	"Device NVIDIA D1"

  DefaultDepth	24

  SubSection "Display"
    Depth	16
    Modes	"1280x1024" "1024x768" "800x600" "640x480"
  EndSubSection

  SubSection "Display"
    Depth	24
    Modes	"1280x1024" "1024x768" "800x600" "640x480"
  EndSubSection
EndSection

Section "ServerLayout"
  Identifier	"Default Layout"

  Screen	0 "Screen 0"
  Screen	1 "Screen 1"		RightOf "Screen 0"

  Option	"Xinerama"		"on"

  InputDevice	"Generic Mouse"
  InputDevice	"Generic Keyboard"
EndSection
