Display Drivers

From LinuxMCE
Revision as of 22:37, 15 July 2007 by Zaerc (Talk | contribs) (redid the ATI config section)

Jump to: navigation, search

A short (and incomplete) HowTo on updating LMCE (1.1 Beta2) to the latest display drivers.


ATI Chipsets

I'm writing these from memory more or less so it probably needs to be tested and updated, don't be shy. For more information, see also the Unofficial ATI Linux Driver Wiki.


Installation

There are many ways to do this, two ways are described on the site above, you can read them in the Ubuntu Feisty Installation Guide.


Configuration

The main configuration file for the X-server is /etc/X11/xorg.conf, you should start by making a backup copy of this file (even if it doesn't work it might contain settings you could need). In this example we will start from scratch and edit the configuration file step by step to get the main display setup.

Some of these steps require that there will be no X-server active on the system, the easiest way to achieve this is to boot in rescue-mode, just hit [Esc] when Grub tells you to during the startup of your machine and select the right line from the menu. Another way is to go to a text-mode console (aka. terminal) with [CTRL]-[ALT]-[F1], log in, become root and issue the command:

telinit 1

This wil stop the running X-server and drop you into rescue mode as well. One of the advantages is that now you can start and stop the X-server by hand with an alternative configuration file and without having to reboot or even start an entire desktop environment.

While there is no (other) X-server running you can create a template configuration file by running:

X -configure

This will create a file called xorg.conf.new in the current directory, test it with the following command and hit [CTRL]-[ALT]-[Backspace] when done:

X -config ./xorg.conf.new

Within a few seconds a gray bitpattern should show up with an 'X' shaped mouse cursor. If the screen is distorted or reports the refresh rate to be out of range you will have to either specify the proper refreshrate limitations for your screen or insert "modelines" for the resolution(s) you want to use (see below). When you're satisfied you can overwrite /etc/X11/xorg.conf with this file to make it the default, once you have done that you can use "startx" to test and have the use of your desktop as well.

Here is an example of such a generated file:

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

Section "Files"
       RgbPath      "/etc/X11/rgb"
       ModulePath   "/usr/lib/xorg/modules"
       FontPath     "/usr/share/fonts/X11/misc"
       FontPath     "/usr/X11R6/lib/X11/fonts/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/X11R6/lib/X11/fonts/Type1"
       FontPath     "/usr/share/fonts/X11/100dpi"
       FontPath     "/usr/share/fonts/X11/75dpi"
       FontPath     "/var/lib/defoma/x-ttcidfont-conf.d/dirs/TrueType"
EndSection

Section "Module"
       Load  "extmod"
       Load  "record"
       Load  "xtrap"
       Load  "dri"
       Load  "glx"
       Load  "dbe"
       Load  "GLcore"
       Load  "type1"
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 "Device"
       ### Available Driver options are:-
       ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
       ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
       ### [arg]: arg optional
       #Option     "ShadowFB"                  # [<bool>]
       #Option     "DefaultRefresh"            # [<bool>]
       #Option     "ModeSetClearScreen"        # [<bool>]
       Identifier  "Card0"
       Driver      "vesa"
       VendorName  "ATI Technologies Inc"
       BoardName   "ATI Radeon Xpress 1200 Series"
       BusID       "PCI:1:5:0"
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

Note that other then the "VendorName", "BoardName" and "BusID" values there is nothing specific to my setup in this config file, none of these are relevant by the way, and can safely be omitted (although "BusID" might be usefull when you have more then one graphics adapter in your system). We'll be using this example configuration in the other examples below.


Refresh rate

The easiest way to sort this problem is to let the X-server figure this out by not specifying the limits of your screen. However this often fails, leaving you with an unusable display. Simply look up your screen's refresh rates in the documentation and add them like this:

Section "Monitor"
       Identifier   "Monitor0"
       VendorName   "Monitor Vendor"
       ModelName    "Monitor Model"
       HorizSync     27-102 # kHz
       VertRefresh   50-160 # Hz
EndSection

Alternatively you could specify a "ModeLine" for each resolution you want to use. (Please feel free to add instructions here.)


Colordepth and resolution

Specify the colordepth and resolution(s) you would like to use, like this:

Section "Screen"
       Identifier   "Screen0"
       Device       "Card0"
       Monitor      "Monitor0"
       DefaultDepth 24
       SubSection "Display"
               Viewport   0 0
               Depth      24
               Virtual    1600 1200
               Modes      "1600x1200" "1280x1024" "1024x768" "800x600" "640x480" "512x384" "400x300" "320x240"
       EndSubSection
EndSection

As most people will only be using 24 bits anyway, I have removed the other redundant subsections. "Virtual" is the size of your desktop and "Modes" are physical resulutions, you can flip through these by holding [CTRL]-[ALT] and pressing the plus or minus on the numeric keypad. These are just examples, most people will only want to specify the resolution they actually use.


DRI device permissions

Aparently this section is needed to have the X-server set the proper permissions on the DRI device during startup. Simply add it to the end of the /etx/X11.xorg file if it isn't there already.

Section "DRI"
       Mode         0666
EndSection


Changing the driver

Open the /etx/X11/xorg.conf using your favorite text editor, and change "vesa" to "fglrx" (or even "ati", depending on which drivers you installed earlier), as shown below, the old line is left as a comment in this example for clarity, but it's better to remove it as some scripts seem to find it confusing.

Section "Device"
       ### Available Driver options are:-
       ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
       ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
       ### [arg]: arg optional
       #Option     "ShadowFB"                  # [<bool>]
       #Option     "DefaultRefresh"            # [<bool>]
       #Option     "ModeSetClearScreen"        # [<bool>]
       Identifier  "Card0"
#      Driver      "vesa"
       Driver      "fglrx"
       VendorName  "ATI Technologies Inc"
       BoardName   "ATI Radeon Xpress 1200 Series"
       BusID       "PCI:1:5:0"
EndSection

If your X-server was running you will have to restart it completely for the changes to take effect, the easiest and most thorough way to do this is to reboot.


Additional options

To be continued, I don't think this is enough to get UI2 (medium/masking) going yet. Feel free to jump in anytime...


Things still to sort out amongst others (i.e. what is it, do we need it and what are the settings if any):

Section "Module"
       Load  "i2c"
       Load  "bitmap"
       Load  "ddc"
       Load  "freetype"
       Load  "int10"
       Load  "vbe"
       Load  "speedo"
       Load  "type1"
       Load  "dbe"
       Load  "glx"
       Load  "v4l"
EndSection
Section "ServerFlags"
       Option "AIXGL" "off"
EndSection
Section "Extensions"
       Option      "Composite" "Disable"
#      Option      "RENDER" "true"
EndSection
       Option      "PseudoColorVisuals" "off"
       Option      "OpenGLOverlay" "off"
       Option      "VideoOverlay" "off"
       Option      "DesktopSetup" "clone"

TV-out options, 2nd display, etc.


NVidia Chipsets

Again, I'm mostly writing these from memory so it probably needs to be tested and updated, don't be shy.

Installation

1. Go to a console (text) terminal by holding [CTRL]-[ALT] and pressing the [F1] key simultaneously, log in with the user account you have created during the Kubuntu install and become root, if you haven't done so already.

<you>@dcerouter:~$ sudo -s

2. Download the latest linux drivers from NVidia (depending on your hardware, one of versions: 100.14.11, 1.0-9639 or 1.0-7185 currently), if you haven't done so already.

root@dcerouter:~# wget http://us.download.nvidia.com/XFree86/Linux-x86/100.14.11/NVIDIA-Linux-x86-<version>-pkg1.run

3. Go to runlevel 1 to stop the currently running X-server.

root@dcerouter:~# telinit 1

4. Execute the installer and follow instructions. Ignore the warning about runlevel 1 and don't bother looking for precompiled drivers.

root@dcerouter:~# sh NVIDIA-Linux-x86-<version>-pkg1.run

5. Now it needs to be configured. There are a lot of ways to do that.

Configuration

To be continued, see ATI chipsets for now, it's very similar and both instructions might be joined.

Troubleshooting

X-windows won't start anymore at all

Reboot into rescue-mode if needed (hit [Esc] when Grub tells you to), and restore a working copy of your /etc/X11/xorg.conf, or edit it by hand to fix the problem. Test it with the command "X" and press [CTRL]-[ALT]-[Backspace] simultaneous to quit (alternative: use "startx" and get the full desktop, if any), then reboot when it works and you're done.