cze 8, 2010

Radeon Dual Screen


Here you will find Xorg configuration for Radeon free opensource Driver using RandR 1.2 specification for double screen configuration. This configuration supports 3D acceleration.
Kategoria: Xorg
Napisał: kardasa

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.

View the full xorg.conf configuration file
  1. Section "ServerLayout"
  2. Identifier "X.org Configured"
  3. Screen "Radeon Main Screen"
  4. InputDevice "Mouse0" "CorePointer"
  5. InputDevice "Keyboard0" "CoreKeyboard"
  6. InputDevice "Synaptics0"
  7. Option "AIGLX" "on"
  8. Option "AllowEmptyInput" "off"
  9. EndSection
  10.  
  11. Section "Files"
  12. ModulePath "/usr/lib/xorg/modules"
  13. FontPath "/usr/share/fonts/misc/"
  14. FontPath "/usr/share/fonts/TTF/"
  15. FontPath "/usr/share/fonts/OTF"
  16. FontPath "/usr/share/fonts/Type1/"
  17. FontPath "/usr/share/fonts/100dpi/"
  18. FontPath "/usr/share/fonts/75dpi/"
  19. FontPath "/usr/share/fonts/Speedo"
  20. EndSection
  21.  
  22. Section "Module"
  23. Load "ddc"
  24. Load "glx"
  25. Load "extmod"
  26. SubSection "extmod"
  27. Option "omit xfree86-dga"
  28. EndSubSection
  29. Load "record"
  30. Load "dbe"
  31. Load "dri"
  32. Load "bitmap"
  33. Load "freetype"
  34. EndSection
  35.  
  36. Section "InputDevice"
  37. Identifier "Keyboard0"
  38. Driver "evdev"
  39. Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-kbd"
  40. Option "AutoRepeat" "500 5"
  41. Option "Xleds" "1 2 3"
  42. Option "XkbDisable"
  43. Option "XkbModel" "asus_laptop"
  44. Option "XkbLayout" "pl"
  45. Option "XkbVariant" ",winkeys"
  46. Option "XkbOptions" "eurosign:5,terminate:ctrl_alt_bksp"
  47. EndSection
  48.  
  49. Section "InputDevice"
  50. Identifier "Mouse0"
  51. Driver "evdev"
  52. Option "Protocol" "auto"
  53. Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse"
  54. Option "ZAxisMapping" "4 5 6 7"
  55. EndSection
  56.  
  57. Section "InputDevice"
  58. Identifier "Synaptics0"
  59. Driver "synaptics"
  60. Option "Protocol" "auto"
  61. Option "SendCoreEvents" "true"
  62. Option "Protocol" "auto"
  63. Option "SHMConfig" "on"
  64. EndSection
  65.  
  66. #Modes configuration for TV Sony Bravia 32 KDL32S2030
  67.  
  68. Section "Modes"
  69. Identifier "Modes_SONY"
  70. Mode "WXGA_1360x768" # vfreq 60.015Hz, hfreq 47.712kHz
  71. DotClock 85.500000
  72. HTimings 1360 1424 1536 1792
  73. VTimings 768 771 777 795
  74. Flags "+HSync" "+VSync"
  75. EndMode
  76. Mode "WXGA_1280x768" # vfreq 59.870Hz, hfreq 47.776kHz
  77. DotClock 79.500000
  78. HTimings 1280 1344 1472 1664
  79. VTimings 768 771 778 798
  80. Flags "+HSync" "-VSync"
  81. EndMode
  82. Mode "XGA_1024x768" # vfreq 60Hz, hfreq 48.4kHz
  83. DotClock 65.000000
  84. HTimings 1024 1032 1176 1344
  85. VTimings 768 771 777 806
  86. Flags "+HSync" "-VSync"
  87. EndMode
  88. EndSection
  89.  
  90. # Configuration for Default LVDMS panel
  91.  
  92. Section "Monitor"
  93. Identifier "DefaultMonitor"
  94. Option "DPMS" "true"
  95. Option "PreferredMode" "1280x800"
  96. EndSection
  97.  
  98. # Configuration for Generic Monitor as 2nd screen
  99.  
  100. Section "Monitor"
  101. Identifier "Generic"
  102. VendorName "Unknown"
  103. ModelName "Unknown"
  104. Option "DPMS" "true"
  105. Option "Right Of" "DefaultMonitor"
  106. Option "PreferredMode" "1024x768"
  107. EndSection
  108.  
  109. # Configuration for TV-Monitor
  110.  
  111. Section "Monitor"
  112. Identifier "TV-Monitor"
  113. VendorName "Unknown"
  114. ModelName "Unknown"
  115. Option "DPMS" "true"
  116. Option "Left Of" "DefaultMonitor"
  117. Option "PreferredMode" "800x600"
  118. EndSection
  119.  
  120.  
  121. #Configuration for Sony Bravia 32in Secondary LCD TV/Monitor
  122.  
  123. Section "Monitor"
  124. Identifier "Sony_Bravia_32in"
  125. Option "DPMS" "true"
  126. VendorName "Sony"
  127. ModelName "Bravia 32 inches"
  128. UseModes "Modes_SONY"
  129. #HorizSync 31.5-47.8
  130. #VertRefresh 60
  131. Option "Right Of" "DefaultMonitor"
  132. Option "PreferredMode" "WXGA_1360x768"
  133. EndSection
  134.  
  135. # Radeon Open Source Driver
  136.  
  137. Section "Device"
  138. ### Available Driver options are:-
  139. ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
  140. ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
  141. ### [arg]: arg optional
  142. Option "NoAccel" "False"
  143. #Option "SWcursor" # [<bool>]
  144. #Option "Dac6Bit" # [<bool>]
  145. #Option "Dac8Bit" # [<bool>]
  146. Option "BusType" "AGP"
  147. #Option "CPPIOMode" # [<bool>]
  148. #Option "CPusecTimeout" # <i>
  149. Option "AGPMode" "4"
  150. #Option "AGPFastWrite" "True" This option makes the system hardlock
  151. #Option "AGPSize" "64"
  152. Option "GARTSize" "64"
  153. #Option "RingSize" # <i>
  154. #Option "BufferSize" # <i>
  155. #Option "EnableDepthMoves" # [<bool>]
  156. Option "EnablePageFlip" "True"
  157. #Option "NoBackBuffer" # [<bool>]
  158. Option "DMAForXv" "True"
  159. #Option "FBTexPercent" # <i>
  160. #Option "DepthBits" # <i>
  161. #Option "PCIAPERSize" # <i>
  162. Option "AccelDFS" "True"
  163. #Option "IgnoreEDID" # [<bool>]
  164. #Option "DisplayPriority" # [<str>]
  165. #Option "PanelSize" # [<str>]
  166. #Option "ForceMinDotClock" # <freq>
  167. Option "ColorTiling" "True"
  168. #Option "VideoKey" # <i>
  169. #Option "RageTheatreCrystal" # <i>
  170. #Option "RageTheatreTunerPort" # <i>
  171. #Option "RageTheatreCompositePort" # <i>
  172. #Option "RageTheatreSVideoPort" # <i>
  173. #Option "TunerType" # <i>
  174. #Option "RageTheatreMicrocPath" # <str>
  175. #Option "RageTheatreMicrocType" # <str>
  176. #Option "ScalerWidth" # <i>
  177. Option "RenderAccel" "True"
  178. #Option "SubPixelOrder" # [<str>]
  179. #Option "ShowCache" # [<bool>]
  180. #Option "DynamicClocks" "True"
  181. #Option "VGAAccess" # [<bool>]
  182. #Option "ReverseDDC" # [<bool>]
  183. #Option "LVDSProbePLL" # [<bool>]
  184. Option "AccelMethod" "XAA"
  185. Option "DRI" "True"
  186. #Option "ConnectorTable" # <str>
  187. #Option "DefaultConnectorTable" # [<bool>]
  188. #Option "DefaultTMDSPLL" # [<bool>]
  189. Option "TVDACLoadDetect" "True"
  190. #Option "ForceTVOut" # [<bool>]
  191. Option "TVStandard" "pal"
  192. #Option "IgnoreLidStatus" # [<bool>]
  193. #Option "DefaultTVDACAdj" # [<bool>]
  194. #Option "Int10" # [<bool>]
  195. #Option "EXAVSync" # [<bool>]
  196. #Option "ATOMTVOut" # [<bool>]
  197. #Option "R4xxATOM" # [<bool>]
  198. Identifier "Radeon Open Driver"
  199. Driver "radeon"
  200. VendorName "ATI Technologies Inc"
  201. BoardName "RV350 [Mobility Radeon 9600 M10]"
  202. BusID "PCI:1:0:0"
  203. Option "monitor-LVDS" "DefaultMonitor"
  204. Option "monitor-VGA-0" "Generic"
  205. # Option "monitor-VGA-0" "Sony_Bravia_32in"
  206. Option "monitor-S-video" "TV-Monitor"
  207. EndSection
  208.  
  209. #Configuration for Generic Vesa Device Driver no 3D accel
  210.  
  211. Section "Device"
  212. Identifier "Generic Vesa"
  213. Driver "vesa"
  214. BusID "PCI:1:0:0"
  215.  
  216. # Driver specific options
  217.  
  218. Option "ShadowFB" "on"
  219. Option "ModeSetClearScreen" "on"
  220. Option "monitor-LVDS" "DefaultMonitor"
  221. EndSection
  222.  
  223. Section "Screen"
  224. Identifier "Radeon Main Screen"
  225. Device "Radeon Open Driver"
  226. DefaultDepth 24
  227. SubSection "Display"
  228. Depth 24
  229. Virtual 2960 1050
  230. EndSubSection
  231. EndSection
  232.  
  233. Section "Screen"
  234. Identifier "Vesa Main Screen"
  235. Device "Generic Vesa "
  236. DefaultDepth 24
  237. SubSection "Display"
  238. Viewport 0 0
  239. Depth 1
  240. Modes "1024x768" "800x600"
  241. EndSubSection
  242. SubSection "Display"
  243. Viewport 0 0
  244. Depth 4
  245. Modes "1024x768" "800x600"
  246. EndSubSection
  247. SubSection "Display"
  248. Viewport 0 0
  249. Depth 8
  250. Modes "1024x768" "800x600"
  251. EndSubSection
  252. SubSection "Display"
  253. Viewport 0 0
  254. Depth 15
  255. Modes "1024x768" "800x600"
  256. EndSubSection
  257. SubSection "Display"
  258. Viewport 0 0
  259. Depth 16
  260. Modes "1024x768" "800x600"
  261. EndSubSection
  262. SubSection "Display"
  263. Depth 24
  264. Modes "1024x768" "800x600"
  265. ViewPort 0 0
  266. EndSubSection
  267. EndSection
  268.  
  269. Section "dri"
  270. Mode 0666
  271. EndSection
  272.  
  273. Section "Extensions"
  274. Option "Composite" "Enable"
  275. 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

titlepl: Podwójne Ekrany Radeon
summarypl: Tutaj znajdziesz konfigurację Xorga dla wolnego opartego na otwartych źródłach sterownika Radeon używającej specyfikacji RandR 1.2 do konfiguracji podwójnych ekranów. Ta konfiguracja zapewnia akcelerację 3D.
contentpl: 

Wstęp

Konfiguracja karty graficznej ATI w Linuxie zawsze doprowadzała mnie do szału. Byłem tak zirytowany faktem, że przy wykorzystaniu sterownika własnościowego nie mogłem uzyskać jednocześnie akceleracji w grach i na pulpicie 3D, że pozbyłem się karty graficznej ATI z głównego komputera i kupiłem sobie lśniącą kartę NVidia, która oczywiście działała w tym zakresie bez zarzutu. Niestety pozbycie się karty graficznej ATI z mojego notebooka nie mogło być brane pod uwagę, musiałem znaleźć inne rozwiązanie problemu. Przez dłuższy czas używał notebooka z własnościowym sterownikiem fglrx, który wraz z serwerem XGL zapewniał mi funkcjonowanie desktopu 3D. Musiałem pogodzić się z faktem, że nie będę mógł na nim pograć. Przez dłuższy czas ignorowałem także wiele związanym z funkcjonowaniem sterownika fglrx komunikatów kernela. Tak naprawdę ten sterownik nigdy nie działał zbyt stabilnie, a w końcu jako, że mam starą kartę Radeon 9600, okazało się, że nowsze wersje sterownika ATI catalyst dla Linuxa mają usunięte wsparcie dla mojej karty graficznej. Musiałem więc podjąć decyzję co jest dla mnie ważniejsze, czy posiadanie własnościowego sterownika ATI ze starym kernelem, czy też możliwość aktualizowanie kernela i rezygnacja z tego nie trzymającego się kupy sterownika. Zdecydowania wolę mięć możliwość aktualizowania kernela. I to była bardzo dobra decyzja bo okazało się, że otwarty sterownik Radeon oferuje funkcje, z których nie mogłem skorzystać z własnościowym sterownikiem. Dodatkowo istotne jest, że ten sterownik wspiera specyfikację RandR 1.2, daje mi to więc możliwość efektywnego wykorzystania konfiguracji podwójnych lub nawet potrójnych ekranów. Stanowi to dodatkowy dowód, że rozwijanie oprogramowania opartego na otwartych źródłach jest najlepszą metodą na rozwiązywanie typowych problemów ze sterownikami. Postaram się podzielić moją konfiguracją mając nadzieję, że pomoże ona komuś jeszcze.

Muszę dodać, że nie mam pojęcia jaką jakość prezentują dzisiejsze sterowniki własnościowe ATI dla Linuxa. Możliwe, że AMD po przejęciu ATI naprawiło bardzo wiele rzeczy. Ale jako, że miałem bardzo złe doświadczenia ze wsparciem dla Linuxa ze strony ATI, minie sporo czasu zanim ktokolwiek przekona mnie abym kupił, jakikolwiek produkt sygnowany znakiem ATI.

Jak napisałem powyżej mam starą kartę ATI Mobility Radeon 9600 w swoim notebooku, jako że używam Gentoo Linuxa z pełną optymalizacją sprzętową mogę efektywnie wykorzystać nawet bardzo stary sprzęt. Moja konfiguracja wspiera pulpit 3D, konfigurację dwóch ekranów a także akcelerację grafiki dla starszych gier przy użyciu wolnego i opartego na otwartych źródłach sterownika Radeon. Pamiętaj jeśli stosujesz moje rozwiązanie robisz to na własną odpowiedzialność. Rozpocznę opis od konfiguracji kernela.

Konfiguracja kernela

Aby używać akceleracji zarówno dla pulpitu 3D jak i gier będziesz musiał się upewnić, że posiadasz wsparcie dla DRM Radeon wkompilowane do kernela. Nie polecam kompilacji DRM Radeon jako modułu, osobiście doświadczyłem twardych zawieszeń systemu, kiedy próbowałem ładować DRM Radeon jako moduł. Możesz sprawić konfigurację swojego kernela pod tym kątem wydając następujące komendy w terminalu (zakładam, że posiadasz źródła kernela w /usr/src/linux):

cd /usr/src/linux
cat .config | grep DRM_RADEON

Jeśli widzisz:

CONFIG_DRM_RADEON=y

to możesz przejśc do instalacji sterownika opensource Radeon. Jeśli natomiast widzisz:

CONFIG_DRM_RADEON=n

lub

# CONFIG_DRM_RADEON is not set

to muszisz zaznaczyć tę opcję w swom kernelu. Możesz tego dokonać wykonując:

cd /usr/src/linux
make menuconfig

Następnie przejdź do Device Drivers --> Graphics Support --> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support), zaznacz ostatnią wymienioną opcję, jeśli nie jest już zaznaczona a nstępnie wejdź do niej i zaznacz ATI Radeon. Zapisz zmiany i wyjdź z menuconfig. Teraz musisz przekompilować i zainstalować nowy kernel. Jeśli nie wiesz jak to zrobić zajrzyj do dokumentacji twojej dystrybucji. Ja zwykle robię to w ten sposób w Gentoo Linuxie:

cd /usr/src/linux
make && make modules_install install

Teraz powinieneś mieć wsparcie dla DRM Radeon bezpośrednio w kernelu. Możesz zrestartować komputer używając nowego kernela.

Instalacja otwartego sterownika Radeon

Instalacja opartego na otwartych źródłach sterownika może się różnić w zależności od dystrybucji systemu. Możliwe, że instalacja serwera X dla twojej dystrybucji posiada ten sterownik i nie musisz robić nic więcej. Jeśli masz wątpliwości zajrzyj do dokumentacji twojej dystrybucji. Poniżej opisane kroki będą działać w Gentoo Linuxie i oprarych na nim dystrybucjach. Najpierw musimy się upewnić, że mamy właściwą konfigurację kart graficznych w naszym pliku make.conf. Możemy to sprawdzić wykonując następujące polecenie w terminalu:

cat /etc/make.conf | grep VIDEO_CARDS
VIDEO_CARDS="radeon vesa v4l"

Jak widzisz posiadam obsługę karty radeon. Jeśli otrzymałeś inny wynik, wyedytuj plik /etc/make.conf i dodaj ciąg radeon do zmiennej VIDEO_CARDS. Kolejna rzecz to upewnienie się, że wszystkie pakiety, które wykorzystują to ustawienie zostaną przekompilowane. Możesz sprawdzić, które pakiety korzystają z tego ustawienia wykorzystując narzędzie equery z pakietu gentoolkit w ten sposób:

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)

Jak widzisz na liście pakieŧów znajduje się pakiet xorg-drivers. Ten pakiet zainstaluje otwarty sterownik Radeon jako zależność. Upewnij się, że przekompilowałeś wszystkie te pakiety, zanim przystąpisz do dalszych kroków konfiguracji. Jeśli chcesz w 100% upewnić się, że posiadasz otwarty sterownik Radeon w swoim systemie, możesz dodatkowo wykonać następujące polecenie:

emerge -pv x11-drivers/xf86-video-ati
[ebuild   R   ] x11-drivers/xf86-video-ati-6.12.6

Ostatnią rzeczą jaką musisz wykonać na tym etapie jest sprawdzenie, że twój system używa akceleracji opengl serwera Xorg. To jest szczególnie ważne, jeśli zmieniasz sterownik własnościowy na steronik otwarty. Możesz dokonać tego wykonując następujące polecenie w terminalu:

eselect opengl set xorg-x11
Switching to xorg-x11 OpenGL interface... done

Konfiguracja serwera Xorg

Tutaj znajdziesz kompletny plik Xorg.conf, który zapewnia konfigurację dwóch ekranów używając specyfikacji RandR 1.2 i akcelerację 3D dla otwartego sterownika Radeon.

Wyświetl pełny plik konfiguracyjny xorg.conf
  1. Section "ServerLayout"
  2. Identifier "X.org Configured"
  3. Screen "Radeon Main Screen"
  4. InputDevice "Mouse0" "CorePointer"
  5. InputDevice "Keyboard0" "CoreKeyboard"
  6. InputDevice "Synaptics0"
  7. Option "AIGLX" "on"
  8. Option "AllowEmptyInput" "off"
  9. EndSection
  10.  
  11. Section "Files"
  12. ModulePath "/usr/lib/xorg/modules"
  13. FontPath "/usr/share/fonts/misc/"
  14. FontPath "/usr/share/fonts/TTF/"
  15. FontPath "/usr/share/fonts/OTF"
  16. FontPath "/usr/share/fonts/Type1/"
  17. FontPath "/usr/share/fonts/100dpi/"
  18. FontPath "/usr/share/fonts/75dpi/"
  19. FontPath "/usr/share/fonts/Speedo"
  20. EndSection
  21.  
  22. Section "Module"
  23. Load "ddc"
  24. Load "glx"
  25. Load "extmod"
  26. SubSection "extmod"
  27. Option "omit xfree86-dga"
  28. EndSubSection
  29. Load "record"
  30. Load "dbe"
  31. Load "dri"
  32. Load "bitmap"
  33. Load "freetype"
  34. EndSection
  35.  
  36. Section "InputDevice"
  37. Identifier "Keyboard0"
  38. Driver "evdev"
  39. Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-kbd"
  40. Option "AutoRepeat" "500 5"
  41. Option "Xleds" "1 2 3"
  42. Option "XkbDisable"
  43. Option "XkbModel" "asus_laptop"
  44. Option "XkbLayout" "pl"
  45. Option "XkbVariant" ",winkeys"
  46. Option "XkbOptions" "eurosign:5,terminate:ctrl_alt_bksp"
  47. EndSection
  48.  
  49. Section "InputDevice"
  50. Identifier "Mouse0"
  51. Driver "evdev"
  52. Option "Protocol" "auto"
  53. Option "Device" "/dev/input/by-id/usb-Logitech_USB_Receiver-event-mouse"
  54. Option "ZAxisMapping" "4 5 6 7"
  55. EndSection
  56.  
  57. Section "InputDevice"
  58. Identifier "Synaptics0"
  59. Driver "synaptics"
  60. Option "Protocol" "auto"
  61. Option "SendCoreEvents" "true"
  62. Option "Protocol" "auto"
  63. Option "SHMConfig" "on"
  64. EndSection
  65.  
  66. #Modes configuration for TV Sony Bravia 32 KDL32S2030
  67.  
  68. Section "Modes"
  69. Identifier "Modes_SONY"
  70. Mode "WXGA_1360x768" # vfreq 60.015Hz, hfreq 47.712kHz
  71. DotClock 85.500000
  72. HTimings 1360 1424 1536 1792
  73. VTimings 768 771 777 795
  74. Flags "+HSync" "+VSync"
  75. EndMode
  76. Mode "WXGA_1280x768" # vfreq 59.870Hz, hfreq 47.776kHz
  77. DotClock 79.500000
  78. HTimings 1280 1344 1472 1664
  79. VTimings 768 771 778 798
  80. Flags "+HSync" "-VSync"
  81. EndMode
  82. Mode "XGA_1024x768" # vfreq 60Hz, hfreq 48.4kHz
  83. DotClock 65.000000
  84. HTimings 1024 1032 1176 1344
  85. VTimings 768 771 777 806
  86. Flags "+HSync" "-VSync"
  87. EndMode
  88. EndSection
  89.  
  90. # Configuration for Default LVDMS panel
  91.  
  92. Section "Monitor"
  93. Identifier "DefaultMonitor"
  94. Option "DPMS" "true"
  95. Option "PreferredMode" "1280x800"
  96. EndSection
  97.  
  98. # Configuration for Generic Monitor as 2nd screen
  99.  
  100. Section "Monitor"
  101. Identifier "Generic"
  102. VendorName "Unknown"
  103. ModelName "Unknown"
  104. Option "DPMS" "true"
  105. Option "Right Of" "DefaultMonitor"
  106. Option "PreferredMode" "1024x768"
  107. EndSection
  108.  
  109. # Configuration for TV-Monitor
  110.  
  111. Section "Monitor"
  112. Identifier "TV-Monitor"
  113. VendorName "Unknown"
  114. ModelName "Unknown"
  115. Option "DPMS" "true"
  116. Option "Left Of" "DefaultMonitor"
  117. Option "PreferredMode" "800x600"
  118. EndSection
  119.  
  120.  
  121. #Configuration for Sony Bravia 32in Secondary LCD TV/Monitor
  122.  
  123. Section "Monitor"
  124. Identifier "Sony_Bravia_32in"
  125. Option "DPMS" "true"
  126. VendorName "Sony"
  127. ModelName "Bravia 32 inches"
  128. UseModes "Modes_SONY"
  129. #HorizSync 31.5-47.8
  130. #VertRefresh 60
  131. Option "Right Of" "DefaultMonitor"
  132. Option "PreferredMode" "WXGA_1360x768"
  133. EndSection
  134.  
  135. # Radeon Open Source Driver
  136.  
  137. Section "Device"
  138. ### Available Driver options are:-
  139. ### Values: <i>: integer, <f>: float, <bool>: "True"/"False",
  140. ### <string>: "String", <freq>: "<f> Hz/kHz/MHz"
  141. ### [arg]: arg optional
  142. Option "NoAccel" "False"
  143. #Option "SWcursor" # [<bool>]
  144. #Option "Dac6Bit" # [<bool>]
  145. #Option "Dac8Bit" # [<bool>]
  146. Option "BusType" "AGP"
  147. #Option "CPPIOMode" # [<bool>]
  148. #Option "CPusecTimeout" # <i>
  149. Option "AGPMode" "4"
  150. #Option "AGPFastWrite" "True" This option makes the system hardlock
  151. #Option "AGPSize" "64"
  152. Option "GARTSize" "64"
  153. #Option "RingSize" # <i>
  154. #Option "BufferSize" # <i>
  155. #Option "EnableDepthMoves" # [<bool>]
  156. Option "EnablePageFlip" "True"
  157. #Option "NoBackBuffer" # [<bool>]
  158. Option "DMAForXv" "True"
  159. #Option "FBTexPercent" # <i>
  160. #Option "DepthBits" # <i>
  161. #Option "PCIAPERSize" # <i>
  162. Option "AccelDFS" "True"
  163. #Option "IgnoreEDID" # [<bool>]
  164. #Option "DisplayPriority" # [<str>]
  165. #Option "PanelSize" # [<str>]
  166. #Option "ForceMinDotClock" # <freq>
  167. Option "ColorTiling" "True"
  168. #Option "VideoKey" # <i>
  169. #Option "RageTheatreCrystal" # <i>
  170. #Option "RageTheatreTunerPort" # <i>
  171. #Option "RageTheatreCompositePort" # <i>
  172. #Option "RageTheatreSVideoPort" # <i>
  173. #Option "TunerType" # <i>
  174. #Option "RageTheatreMicrocPath" # <str>
  175. #Option "RageTheatreMicrocType" # <str>
  176. #Option "ScalerWidth" # <i>
  177. Option "RenderAccel" "True"
  178. #Option "SubPixelOrder" # [<str>]
  179. #Option "ShowCache" # [<bool>]
  180. #Option "DynamicClocks" "True"
  181. #Option "VGAAccess" # [<bool>]
  182. #Option "ReverseDDC" # [<bool>]
  183. #Option "LVDSProbePLL" # [<bool>]
  184. Option "AccelMethod" "XAA"
  185. Option "DRI" "True"
  186. #Option "ConnectorTable" # <str>
  187. #Option "DefaultConnectorTable" # [<bool>]
  188. #Option "DefaultTMDSPLL" # [<bool>]
  189. Option "TVDACLoadDetect" "True"
  190. #Option "ForceTVOut" # [<bool>]
  191. Option "TVStandard" "pal"
  192. #Option "IgnoreLidStatus" # [<bool>]
  193. #Option "DefaultTVDACAdj" # [<bool>]
  194. #Option "Int10" # [<bool>]
  195. #Option "EXAVSync" # [<bool>]
  196. #Option "ATOMTVOut" # [<bool>]
  197. #Option "R4xxATOM" # [<bool>]
  198. Identifier "Radeon Open Driver"
  199. Driver "radeon"
  200. VendorName "ATI Technologies Inc"
  201. BoardName "RV350 [Mobility Radeon 9600 M10]"
  202. BusID "PCI:1:0:0"
  203. Option "monitor-LVDS" "DefaultMonitor"
  204. Option "monitor-VGA-0" "Generic"
  205. # Option "monitor-VGA-0" "Sony_Bravia_32in"
  206. Option "monitor-S-video" "TV-Monitor"
  207. EndSection
  208.  
  209. #Configuration for Generic Vesa Device Driver no 3D accel
  210.  
  211. Section "Device"
  212. Identifier "Generic Vesa"
  213. Driver "vesa"
  214. BusID "PCI:1:0:0"
  215.  
  216. # Driver specific options
  217.  
  218. Option "ShadowFB" "on"
  219. Option "ModeSetClearScreen" "on"
  220. Option "monitor-LVDS" "DefaultMonitor"
  221. EndSection
  222.  
  223. Section "Screen"
  224. Identifier "Radeon Main Screen"
  225. Device "Radeon Open Driver"
  226. DefaultDepth 24
  227. SubSection "Display"
  228. Depth 24
  229. Virtual 2960 1050
  230. EndSubSection
  231. EndSection
  232.  
  233. Section "Screen"
  234. Identifier "Vesa Main Screen"
  235. Device "Generic Vesa "
  236. DefaultDepth 24
  237. SubSection "Display"
  238. Viewport 0 0
  239. Depth 1
  240. Modes "1024x768" "800x600"
  241. EndSubSection
  242. SubSection "Display"
  243. Viewport 0 0
  244. Depth 4
  245. Modes "1024x768" "800x600"
  246. EndSubSection
  247. SubSection "Display"
  248. Viewport 0 0
  249. Depth 8
  250. Modes "1024x768" "800x600"
  251. EndSubSection
  252. SubSection "Display"
  253. Viewport 0 0
  254. Depth 15
  255. Modes "1024x768" "800x600"
  256. EndSubSection
  257. SubSection "Display"
  258. Viewport 0 0
  259. Depth 16
  260. Modes "1024x768" "800x600"
  261. EndSubSection
  262. SubSection "Display"
  263. Depth 24
  264. Modes "1024x768" "800x600"
  265. ViewPort 0 0
  266. EndSubSection
  267. EndSection
  268.  
  269. Section "dri"
  270. Mode 0666
  271. EndSection
  272.  
  273. Section "Extensions"
  274. Option "Composite" "Enable"
  275. EndSection

Teraz postaram się wyjaśnić tę konfigurację. Skupię się na ustawieniach najważniejszych dla konfiguracji dwóch ekranu i akceleracji 3D.

Pierwszą rzeczą jaką zobaczysz jest sekcja ServerLayout. Ta sekcja wykorzystuje konfiguracje zdefiniowane poniżej w moim pliku konfiguracyjnym xorg.conf. Ważną rzeczą jest Option "AIGLX" "on", ta opcja pozwala mi korzystać z pulpitu 3D.

Drugą sekcją w moim pliku konfiguracyjnym jest sekcja Files. W tej sekcji wskazuje ścieżki do katalogów z czcionkami i katalog z modułami serwera X.

W sekcji Module możesz zobaczyć moduły serwera X, które są ładowane podczas jego startu. Moduły glx i dri są ważne dla akceleracji 3D.

Kolejną sekcją jest sekcja InputDevice. Tutaj możesz zobaczyć, że używam sterownika evdev dla mojej myszy i klawiatury a także, że wskazałem asus_laptop jako model mojej klawiatury. Pozwala mi to wykorzystać w systemie niektóre z przycisków multimedialnych mojego notebooka. Kolejną ważną rzeczą jest opcja: Option "SHMConfig" "on" w konfiguracji touchpada Synaptics. Ta opcja pozwala mi włączać i wyłączać obsługę touchpada w trakcie pracy systemu.

Kolejne sekcje są bardzo istotne, jako że definiują one ustawienia monitorów. Pierwszą rzeczą jaką możesz tutaj zobaczyć jest konfiguracja modów dla mojego telewizora Sony Bravia. Wpisałem je ponieważ czasami wykorzystuję mój telewizor jako drugi ekran. W moich definicjach monitorów kluczową rzeczą są opcje PrefferedMode, które określają domyślną rozdzielczość każdego z ekranów. Najczęściej wykorzystuję notebooka podłączonego do projektora a większość projektorów do, których go podłączam, używa natywnej rozdzielczości 1024x768, właśnie dla tego wybrałem tę rozdzielczość jako PreferredMode dla definicji monitora Generinc. Jak możesz zobaczyć pozycjonowanie ekranów względem siebie jest określone w sekcji definicji monitora. Domyślnie mój monitor Generic będzie umiejscowiony po prawej mojego monitora domyślnego. Tak samo postąpiłem z konfiguracją monitora dla telewizora Sony Bravia. W ten sposób definiuje się pozycjonowanie ekranów dla specyfikacji RandR 1.2. Dodatkowo możesz zobaczyć tutaj definicję monitora dla wyjścia S-Video karty graficznej mojego notebooka. Jeśli wykorzystam to wyjście będę miał ekran TV po lewej stronie z natywną rozdzielczością 800x600.

Teraz najważniejsza rzecz w moim pliku konfiguracyjnym czyli definicja sekcji Device, która wykorzysta otwarty sterownik Radeon. Pierwszą ważną rzeczą tutaj jest opcja: Option "NoAccel" "False", dzięki temu będę miał akcelerację 3D ze sterownika graficznego. Moja stara karta posiada złącze AGP 4x właśnie dla tego dodałem opcję: Option"BusType""AGP" i opcję: Option "AGPMode" "4" do mojej konfiguracji. Moja karta graficzna posiada 64MB dedykowanej pamięci video, ustawiłem to dodając opcję: Option "GARTSize" "64". Kolejnymi ważnymi opcjami dla akceleracją są opcje: Option "RenderAccel" "True" i Option "DRI" "True". Możesz poeksperymentować z ustawieniem Option "AccelMethod". Wartość "XAA" jest uznawana za bardziej stabilną niż "EXA" właśnie dla tego wykorzystuję tą pierwszą. Opcje Driver "radeon" i BusID "PCI:1:0:0" są kluczowe dla sterownika otwartego Radeon. Ostatnie opcje to definicję monitorów zgodna ze specyfikacją RandR 1.2 i specyfikacją sterownika Radeon. LVDS to wbudowany ekran laptopa, VGA-0 to dodatkowe złącze VGA a S-video to wyjście telewizyjne S-video. Jak widzisz mogę zmieniać definicję dla VGA-0 z definicji monitora Generic na monitor Sony Bravia TV poprzez odkomentowywanie i zakomentowywanie odpowiednich linii w pliku konfiguracyjnym. Możesz poeksperymentować z innymi opcjami, których ja nie wykorzystuję, ale uważaj gdyż niektóre z ich są eksperymentalne i mogą zachowywać się w niesympatyczny sposób. Jako przykład mogę powiedzieć, że opcja Option "AGPFastWrite" "True" powodowała zawieszanie się mojego komputera zaraz po zalogowaniu do systemu graficznego.

Jak widzisz poniżej sekcji Device dla sterownika Radeon mam definicję sekcji Device dla sterownika Vesa. Dobrze jest mieć konfigurację zapasową na wypadek problemów.

Ostatnimi ważnymi sekcjami są sekcje Screen w dolnej części mojego pliku konfiguracyjnego. Jak widzisz nie definiuję modów w sekcji Screen dla sterownika otwartego Radoen zamiast nich ustawiam rozmiar ekranu wirtualnego na 2960x1050. Należy zdefiniować rozmiar ekranu wirtualnego tak aby był wystarczająco duży aby pomieścić wszystkie powyższe definicję monitorów. Zdefiniowanie rozmiaru większego niż 2048x2048 nie jest zalecane, jako że może się zakończyć niemożliwością wykorzystania akceleracji 3D. Jak widzisz ustawienia sekcji Screen dla sterownika Vesa są standardowe.

Jeśli zamierzasz używać pulpit 3D nie możesz wyłączyć opcji: Option "Composite".

Dodatkowo polecam instalację narzędzia z graficznym interfejsem użytkownika driconf. To narzędzie pozwoli ci skonfigurować akcelerację 3D w bardziej zaawansowany sposób. W Gentoo Linuxie możesz zainstalować to narzędzie wydając następujące polecenie w terminalu:

emerge -av driconf

Dowód, że to działa

Źródła