Radeon Dual Screen
Foreword
ATI graphics card configuration in Linux was always a real pain for me. I was so annoyed by the fact that with proprietary driver I couldn't get both games and 3D desktop acceleration work the same time that on my main computer I decided to get rid of my ATI GPU and bought myself a shiny NVidia GPU which did the job. Unfortunately getting rid of my notebook GPU wasn't a real option so I had to find another solution to my problem. For most of the times I used my notebook with proprietary fglrx driver which with XGL gave me 3D desktop features. I had to accept the fact that I won't be able to play any games on it. I also ignored a lot of fglrx related warnings reported by kernel. This way this driver never real work stable for me, and in the end as I have an old Radeon 9600 card newer version of ATI catalyst driver for Linux have removed support for my GPU. I had to make decision what is more important to me haveing proprietary driver with very old kernel or update the kernel and stop using this crappy driver. I prefer to have newer kernel. That was a very good decision because I found out that opensource Radeon driver offered me features I never wasn't able to use with propriety driver. What is also important it supports RandR 1.2 specification so I can use modern dual or even triple screen configuration effectively. This is another prove that opensource development is the best way to solve common diver problems. I will try to share my configuration hoping it will help someone else.
I want to point that I have no idea what level of quality todays ATI proprietary Linux drivers offers. It's possible that AMD after acquisition of ATI fixed a lot of things. But as I had very bad experience with Linux support from ATI, it will take a lot of time to convince me to buy any of their products.
As I wrote above I had quite old ATI Mobility Radeon 9600 GPU in my notebook, but as I'm using Gentoo Linux with full hardware optimalization I'm able to effectively use even very old hardware. My configuration is supporting 3D desktop configuration, dual screen configuration and also accelerated graphics in some old games using free and opensource Radeon driver. Just remember if you are following my configuration you are doing this at your won risk. I will start my description with kernel support.
Kernel Configuration
To have accelerated desktop or games experience you will need to make sure that you have DRM support for Readon compiled into your kernel. I did not recommend compiling DRM Radeon as module, I personally experienced hard locks with DRI Readon loaded as module. You can check your kernel configuration for Radeon by running following commands in shell (I assume you have your current kernel sources in /usr/src/linux):
cd /usr/src/linux cat .config | grep DRM_RADEON
If you can see:
CONFIG_DRM_RADEON=y
Then you can move to open source driver installation. If you however see:
CONFIG_DRM_RADEON=n
or
# CONFIG_DRM_RADEON is not set
Then you need to mark this option in your kernel. You can do it by running:
cd /usr/src/linux make menuconfig
Then you have to go to Device Drivers --> Graphics Support --> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support), mark it if it's not already marked and then go in and mark ATI Radeon. Save changes and go out of menuconfig. Now you have to recompile and install new kernel. If you don't know how to do it consult your distribution documentation. I do it this way in my Gentoo Linux:
cd /usr/src/linux make && make modules_install install
Now you should have Radeon DRM support directly in kernel. You can reboot your computer using new kernel.
Open Source Driver Installation
Open source driver installation may differ from distribution. It's possible that your distribution X server installation has the driver and you don't have to do anything. If in doubt consult your distribution documentation. Below steps will work for Gentoo Linux and Gentoo Linux based distributions. First we need to make sure we have proper graphics card configuration in our make.conf file. We can check it by running following command in the shell:
cat /etc/make.conf | grep VIDEO_CARDS VIDEO_CARDS="radeon vesa v4l"
As you can see I have radeon card support. If you don't, edit /etc/make.conf and append radeon string to VIDEO_CARDS. Now we need to make sure that all system packages that depend on this settings will be reemerged. You can check what packages are using this setting by using gentoolkit equery utility like this:
equery hasuse video_cards_radeon [ Searching for USE flag video_cards_radeon in all categories among: ] * installed packages [I--] [ ~] x11-base/xorg-drivers-1.8 (0) [I--] [ ~] x11-libs/libdrm-2.4.20-r1 (0) [I--] [ ~] sys-power/pm-utils-1.3.0-r3 (0) [I--] [ ~] media-libs/mesa-7.8.1 (0) [I--] [ ~] dev-libs/DirectFB-1.4.3 (0)
As you can see there is xorg-drivers package on my list. This package will pull and install Radeon opensource driver. Make sure you will reemerge all this packages, before going any further with configuration. If you want to be 100% sure you have Readon opensource driver in your system you can additionally run:
emerge -pv x11-drivers/xf86-video-ati [ebuild R ] x11-drivers/xf86-video-ati-6.12.6
Last thing you should do is to make sure you will use Xorg server opengl acceleration. This is extremly important if you are moving from proprietary driver to opensource one. You can do it by running following command in terminal:
eselect opengl set xorg-x11 Switching to xorg-x11 OpenGL interface... done
Xorg Server Configuration
Here you will find my full Xorg.conf that is ensuring Dual screen configuration using RandR 1.2 specification and 3D acceleration features for opensource Radeon driver.
Section "ServerLayout" Identifier "X.org Configured" Screen "Radeon Main Screen" InputDevice "Mouse0" "CorePointer" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Synaptics0" Option "AIGLX" "on" Option "AllowEmptyInput" "off" EndSection Section "Files" ModulePath "/usr/lib/xorg/modules" FontPath "/usr/share/fonts/misc/" FontPath "/usr/share/fonts/TTF/" FontPath "/usr/share/fonts/OTF" FontPath "/usr/share/fonts/Type1/" FontPath "/usr/share/fonts/100dpi/" FontPath "/usr/share/fonts/75dpi/" FontPath "/usr/share/fonts/Speedo" EndSection Section "Module" Load "ddc" Load "glx" Load "extmod" SubSection "extmod" Option "omit xfree86-dga" EndSubSection Load "record" Load "dbe" Load "dri" Load "bitmap" Load "freetype" EndSection Section "InputDevice" Identifier "Keyboard0" Driver "evdev" Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-kbd" Option "AutoRepeat" "500 5" Option "Xleds" "1 2 3" Option "XkbDisable" Option "XkbModel" "asus_laptop" Option "XkbLayout" "pl" Option "XkbVariant" ",winkeys" Option "XkbOptions" "eurosign:5,terminate:ctrl_alt_bksp" EndSection Section "InputDevice" Identifier "Mouse0" Driver "evdev" Option "Protocol" "auto" Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse" Option "ZAxisMapping" "4 5 6 7" EndSection Section "InputDevice" Identifier "Synaptics0" Driver "synaptics" Option "Protocol" "auto" Option "SendCoreEvents" "true" Option "Protocol" "auto" Option "SHMConfig" "on" EndSection #Modes configuration for TV Sony Bravia 32 KDL32S2030 Section "Modes" Identifier "Modes_SONY" Mode "WXGA_1360x768" # vfreq 60.015Hz, hfreq 47.712kHz DotClock 85.500000 HTimings 1360 1424 1536 1792 VTimings 768 771 777 795 Flags "+HSync" "+VSync" EndMode Mode "WXGA_1280x768" # vfreq 59.870Hz, hfreq 47.776kHz DotClock 79.500000 HTimings 1280 1344 1472 1664 VTimings 768 771 778 798 Flags "+HSync" "-VSync" EndMode Mode "XGA_1024x768" # vfreq 60Hz, hfreq 48.4kHz DotClock 65.000000 HTimings 1024 1032 1176 1344 VTimings 768 771 777 806 Flags "+HSync" "-VSync" EndMode EndSection # Configuration for Default LVDMS panel Section "Monitor" Identifier "DefaultMonitor" Option "DPMS" "true" Option "PreferredMode" "1280x800" EndSection # Configuration for Generic Monitor as 2nd screen Section "Monitor" Identifier "Generic" VendorName "Unknown" ModelName "Unknown" Option "DPMS" "true" Option "Right Of" "DefaultMonitor" Option "PreferredMode" "1024x768" EndSection # Configuration for TV-Monitor Section "Monitor" Identifier "TV-Monitor" VendorName "Unknown" ModelName "Unknown" Option "DPMS" "true" Option "Left Of" "DefaultMonitor" Option "PreferredMode" "800x600" EndSection #Configuration for Sony Bravia 32in Secondary LCD TV/Monitor Section "Monitor" Identifier "Sony_Bravia_32in" Option "DPMS" "true" VendorName "Sony" ModelName "Bravia 32 inches" UseModes "Modes_SONY" #HorizSync 31.5-47.8 #VertRefresh 60 Option "Right Of" "DefaultMonitor" Option "PreferredMode" "WXGA_1360x768" EndSection # Radeon Open Source Driver 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 "NoAccel" "False" #Option "SWcursor" # [<bool>] #Option "Dac6Bit" # [<bool>] #Option "Dac8Bit" # [<bool>] Option "BusType" "AGP" #Option "CPPIOMode" # [<bool>] #Option "CPusecTimeout" # <i> Option "AGPMode" "4" #Option "AGPFastWrite" "True" This option makes the system hardlock #Option "AGPSize" "64" Option "GARTSize" "64" #Option "RingSize" # <i> #Option "BufferSize" # <i> #Option "EnableDepthMoves" # [<bool>] Option "EnablePageFlip" "True" #Option "NoBackBuffer" # [<bool>] Option "DMAForXv" "True" #Option "FBTexPercent" # <i> #Option "DepthBits" # <i> #Option "PCIAPERSize" # <i> Option "AccelDFS" "True" #Option "IgnoreEDID" # [<bool>] #Option "DisplayPriority" # [<str>] #Option "PanelSize" # [<str>] #Option "ForceMinDotClock" # <freq> Option "ColorTiling" "True" #Option "VideoKey" # <i> #Option "RageTheatreCrystal" # <i> #Option "RageTheatreTunerPort" # <i> #Option "RageTheatreCompositePort" # <i> #Option "RageTheatreSVideoPort" # <i> #Option "TunerType" # <i> #Option "RageTheatreMicrocPath" # <str> #Option "RageTheatreMicrocType" # <str> #Option "ScalerWidth" # <i> Option "RenderAccel" "True" #Option "SubPixelOrder" # [<str>] #Option "ShowCache" # [<bool>] #Option "DynamicClocks" "True" #Option "VGAAccess" # [<bool>] #Option "ReverseDDC" # [<bool>] #Option "LVDSProbePLL" # [<bool>] Option "AccelMethod" "XAA" Option "DRI" "True" #Option "ConnectorTable" # <str> #Option "DefaultConnectorTable" # [<bool>] #Option "DefaultTMDSPLL" # [<bool>] Option "TVDACLoadDetect" "True" #Option "ForceTVOut" # [<bool>] Option "TVStandard" "pal" #Option "IgnoreLidStatus" # [<bool>] #Option "DefaultTVDACAdj" # [<bool>] #Option "Int10" # [<bool>] #Option "EXAVSync" # [<bool>] #Option "ATOMTVOut" # [<bool>] #Option "R4xxATOM" # [<bool>] Identifier "Radeon Open Driver" Driver "radeon" VendorName "ATI Technologies Inc" BoardName "RV350 [Mobility Radeon 9600 M10]" BusID "PCI:1:0:0" Option "monitor-LVDS" "DefaultMonitor" Option "monitor-VGA-0" "Generic" # Option "monitor-VGA-0" "Sony_Bravia_32in" Option "monitor-S-video" "TV-Monitor" EndSection #Configuration for Generic Vesa Device Driver no 3D accel Section "Device" Identifier "Generic Vesa" Driver "vesa" BusID "PCI:1:0:0" # Driver specific options Option "ShadowFB" "on" Option "ModeSetClearScreen" "on" Option "monitor-LVDS" "DefaultMonitor" EndSection Section "Screen" Identifier "Radeon Main Screen" Device "Radeon Open Driver" DefaultDepth 24 SubSection "Display" Depth 24 Virtual 2960 1050 EndSubSection EndSection Section "Screen" Identifier "Vesa Main Screen" Device "Generic Vesa " DefaultDepth 24 SubSection "Display" Viewport 0 0 Depth 1 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Viewport 0 0 Depth 4 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Viewport 0 0 Depth 8 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Viewport 0 0 Depth 15 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Viewport 0 0 Depth 16 Modes "1024x768" "800x600" EndSubSection SubSection "Display" Depth 24 Modes "1024x768" "800x600" ViewPort 0 0 EndSubSection EndSection Section "dri" Mode 0666 EndSection Section "Extensions" Option "Composite" "Enable" EndSection
Now I will try to explain this configuration file. I will focus on most important settings for both dual screen and 3D acceleration settings.
First thing you may see is ServerLayout section. This section is using configuration defined below in my xorg.conf file. Important thing here is Option "AIGLX" "on", this option will let me use 3D accelerated desktop.
Second section is my configuration file is Files section. The lines here are pointing to Fonts catalogs and X server modules catalog.
In Module section you may see X server modules that are loaded during X server startup. The modules glx and dri are important for 3D acceleration.
Next thing is InputDevice sections. You can see here that I'm using evdev driver for my mouse and keyboard and that I'm also using asus_laptop keyboard model, which let me use some of my notebook multimedia keys in my system. Another important thing is Option "SHMConfig" "on" in Synaptics touchpad configuration section. This option lets me enable and disable Touchpad support in runtime.
Next sections are very important as they are defining my monitor settings. First thing you can see here are modes configurations for my Sony Bravia TV. I need them because sometimes I use my TV as my second screen. In my monitor definitions important things are PrefferedMode options which determine default screen resolutions for every screen. Mostly I use my Notebook attached to projector and most of the projectors I use have native resolution 1024x768, thats why I choose this resolution as PreferredMode for Generinc monitor definition. As you can see positioning of screen is defined in monitor section. By default my Generic monitor will be positioned on the right of my Default monitor. Same I did for my Sony Bravia TV monitor definition. Thats how you define screen positioning for RandR 1.2 specification. Additionally you may find here a monitor definition for S-Video TV out connector of my notebook graphics card. If I will use this output I will have a TV screen on the left with native resolution 800x600.
Now the most important thing here the Device section definition which will use opensource Radeon driver. First important thing here is: Option "NoAccel" "False", this way I will have 3D acceleration from graphics driver. My old graphics card is using 4x AGP bus thats why I put: Option"BusType""AGP" and Option "AGPMode" "4" options into my configuration. My graphics card has 64MB of dedicated video memory I set this by adding: Option "GARTSize" "64". Another important options for acceleration are: Option "RenderAccel" "True" and Option "DRI" "True". You can experiment with the setting Option "AccelMethod". The "XAA" is considered as more stable then "EXA" thats why I decided to use this one. The Driver "radeon" and BusID "PCI:1:0:0" are important for choosing the opensource Radeon driver. The last options are monitor definitions according to RandR 1.2 and Radeon driver specifications. LVDS is build in laptop screen, VGA-0 is VGA secondary output and S-video is TV S-video output. As you can see I'm able to change my definitions for VGA-0 from generic to Sony Bravia TV monitor definitions by uncommenting and commenting its definition lines. You can experiment with other options I do not use, but beware some of them may be highly experimental and can behave ugly. As an example I can say that Option "AGPFastWrite" "True" was cosing a hard lock of my notebook just after logging into X server.
As you can see below of Radeon Device section I have also generic Vesa Device driver definition. it's always good to have some backup in case of problems with configuration.
The last important sections are Screen sections on the lower part of my configuration file. As you can see I do not define modes in my screen section for Radeon Driver instead I'm setting virtual screen size to 2960x1050. You have to define virtual screen size to be large enough to accommodate all defined above monitors. Using sizes above 2048x2048 is not recommended as this may end in not being able to use 3D acceleration support. As you can see Screen settings for generic Vesa driver are standard.
If you intend to use 3D desktop you can not disable the Option "Composite" extension.
I would additionally recommend installation of driconf GUI DRI configuration tool. This tool will let you utilize 3D acceleration in more advanced way. In Gentoo Linux you can install this tool by running following command in terminal:
emerge -av driconf
Prove that it's working
Sources
- ThinkWiki RandR 1.2 HowTo
- man radeon
- man xorg.conf
- man Xorg
- man xrandr
If you have found something wrong with the information provided above or maybe you just want to speak your mind about it, feel free to leave a comment.
All comments will show up on page after being approved. Sorry for such policy but I want to make sure that my site will be free of abusive or vulgar content. I don't mind being criticized just do it using right words.
Processing a comment.