Clone of mesa.
Du kannst nicht mehr als 25 Themen auswählen Themen müssen mit entweder einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

fbdev-dri.html 7.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313
  1. <html>
  2. <TITLE>Mesa fbdev/DRI Environment</TITLE>
  3. <BODY text="#000000" bgcolor="#55bbff" link="#111188">
  4. <center><H1>Mesa fbdev/DRI Drivers</H1></center>
  5. <H1>1. Introduction</H1>
  6. <p>
  7. The fbdev/DRI sub-project within Mesa brings hardware accelerated OpenGL
  8. rendering to the Linux fbdev environment.
  9. The X Window System / XFree86 is not needed.
  10. </p>
  11. <p>
  12. Basically, the <a href="http://dri.sf.net/">DRI</a> drivers for hardware
  13. accelerated OpenGL for XFree86 have been ported to fbdev so that X is
  14. not needed.
  15. This means fbdev/DRI works in full-screen mode only.
  16. </p>
  17. <p>
  18. DRI driver writers may find this simplified environment easier to work in,
  19. compared to the full XFree86/DRI environment.
  20. </p>
  21. <p>
  22. Much of the work for this project has been done by Jon Smirl and
  23. Keith Whitwell.
  24. </p>
  25. <p>
  26. To use fbdev/DRI, you'll need a Linux 2.4 or 2.6 kernel.
  27. </p>
  28. <h3>Background Info</h3>
  29. <p>
  30. The Mesa-based DRI drivers used to be hosted in the DRI tree (which is
  31. basically a copy of the XFree86 tree).
  32. Since the Mesa-based DRI drivers are moreso "Mesa drivers" than "XFree86
  33. drivers" and the fact that with some work, the drivers could be used
  34. without X, the driver code was moved into the Mesa tree.
  35. </p>
  36. <p>
  37. So now the DRI drivers can be compiled for two different environments:
  38. fbdev and XFree86.
  39. To build the drivers for XFree86, one has to download/build the DRI
  40. source tree.
  41. Eventually, we'd like to be able to build the drivers for XFree86 outside
  42. of the XFree86/DRI trees.
  43. </p>
  44. <h1>2. Compilation</h1>
  45. <h2>2.1 Compiling the DRM modules</h2>
  46. <p>
  47. First, you'll need the DRM (Direct Rendering Manager) kernel module sources.
  48. They're found in a module of the DRI CVS tree.
  49. To obtain the code do the following:
  50. </p>
  51. <pre>
  52. cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri login
  53. </pre>
  54. <p>
  55. Press Enter/Return when prompted for a password. Then,
  56. </p>
  57. <pre>
  58. cvs -d:pserver:anonymous@pdx.freedesktop.org:/cvs/dri co drm
  59. </pre>
  60. <p>
  61. Compile the DRM kernel modules:
  62. </p>
  63. <pre>
  64. cd drm/linux
  65. make
  66. </pre>
  67. <p>
  68. Note: you may need to be root in order to make a few symlinks.
  69. </p>
  70. <p>
  71. When compilation is done, you should have at least the following
  72. kernel modules:
  73. </p>
  74. <pre>
  75. gamma.o
  76. i810.o
  77. i830.o
  78. mach64.o
  79. mga.o
  80. r128.o
  81. radeon.o
  82. savage.o
  83. sis.o
  84. tdfx.o
  85. via.o
  86. </pre>
  87. <p>
  88. You'll probably want to copy/move them into your kernel module directory
  89. (for example: <code>/lib/modules/2.4.18-14/kernel/drivers/char/drm/</code>).
  90. </p>
  91. <h2>2.2 Compiling the Mesa drivers</h2>
  92. <p>
  93. Begin by editing the <code>Mesa/configs/default</code> file to set
  94. the <code>DRM_SOURCE_PATH</code> variable.
  95. Set it to the location where the DRM module sources are located.
  96. For example, if your current directory in step 2.1 was <code>/home/fred/</code>
  97. set DRM_SOURCE_PATH to <code>/home/fred/drm</code>
  98. </p>
  99. <p>
  100. Next, assuming you're starting with a fresh Mesa CVS checkout,
  101. do the following:
  102. </p>
  103. <pre>
  104. make linux-solo
  105. </pre>
  106. <p>
  107. If you previously built the source tree, run <code>make realclean</code>
  108. first to remove the old object files.
  109. </p>
  110. <p>
  111. When this is finished, check the <code>Mesa/lib/</code> directory
  112. to verify that the following files were made:
  113. </p>
  114. <ul>
  115. <li><code>libGL.so.1.2</code> - the client-side OpenGL library
  116. (and a few symlinks to it).
  117. <li><code>libGLU.so.1.1</code> - the GLU library (and a few symlinks to it).
  118. <li><code>libglut.so.3.7</code> - the GLUT library (and a few symlinks to it).
  119. <li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards.
  120. <li><code>r128_dri.so</code> - DRI driver for ATI Rage 128 cards.
  121. <li><code>r200_dri.so</code> - DRI driver for ATI R200 Radeon cards.
  122. <li><code>radeon_dri.so</code> - DRI driver for original ATI Radeon cards.
  123. <li><code>i810_dri.so</code> - DRI driver for Intel i810/i815 chips.
  124. <li><code>i830_dri.so</code> - DRI driver for Intel i830/i845 chips.
  125. <li><code>mga_dri.so</code> - DRI driver for Matrox G200/G400 cards.
  126. <li><code>sis_dri.so</code> - DRI driver for SIS cards.
  127. <li><code>tdfx_dri.so</code> - DRI driver for 3dfx Voodoo 3/4/5 cards.
  128. <li><code>gamma_dri.so</code> - DRI driver for 3Dlabs gamma cards.
  129. <li><code>fb_dri.so</code> - software-only fbdev driver.
  130. <li><code>miniglx.conf</code> - configuration file for the MiniGLX interface
  131. </ul>
  132. <h1>3. Using fbdev/DRI</h1>
  133. <p>
  134. If XFree86 is currently running, exit/stop the X server so you're
  135. working from the console.
  136. </p>
  137. <h2>3.1 Load Kernel Modules</h2>
  138. <p>
  139. You'll need to load the kernel modules specific to your graphics hardware.
  140. Typically, this consists of the agpgart module, an fbdev driver module
  141. and the DRM kernel module (from step 2.1).
  142. </p>
  143. <p>
  144. If you have ATI Radeon/R200 hardware, run as root:
  145. </p>
  146. <pre>
  147. modprobe agpgart # the AGP GART module
  148. modprobe radeonfb # the Radeon fbdev driver
  149. modprobe radeon # the Radeon DRI kernel module
  150. </pre>
  151. <p>
  152. If you have ATI Rage 128 hardware, run as root:
  153. </p>
  154. <pre>
  155. modprobe agpgart # the AGP GART module
  156. modprobe aty128fb # the Rage 128 fbdev driver
  157. modprobe r128 # the Rage 128 DRI kernel module
  158. </pre>
  159. <p>
  160. If you have Matrox G200/G400 hardware, run as root:
  161. </p>
  162. <pre>
  163. modprobe agpgart # the AGP GART module
  164. modprobe mgafb # the Matrox fbdev driver
  165. modprobe mga # the Matrox DRI kernel module
  166. </pre>
  167. <p>
  168. Then run <code>lsmod</code> to be sure the modules are loaded.
  169. For a Radeon card, you should see something like this:
  170. </p>
  171. <pre>
  172. Module Size Used by Not tainted
  173. radeon 110308 0 (unused)
  174. radeonfb 21900 0 (unused)
  175. agpgart 43072 1
  176. </pre>
  177. <h2>3.2 Configuration File</h2>
  178. <p>
  179. The <code>Mesa/lib/miniglx.conf</code> file should be installed
  180. in <code>/etc/</code>.
  181. </p>
  182. <p>
  183. Edit <code>/etc/miniglx.conf</code> to be sure it's set up correctly
  184. for your hardware.
  185. Comments in the file explain the options.
  186. </p>
  187. <h2>3.3 Running fbdev/DRI Programs</h2>
  188. <p>
  189. Make sure your LD_LIBRARY_PATH environment variable is set to the
  190. <code>Mesa/lib/</code> directory.
  191. </p>
  192. <p>
  193. Change to the <code>Mesa/progs/miniglx/</code> directory and
  194. start the sample_server program in the background:
  195. </p>
  196. <pre>
  197. ./sample_server &
  198. </pre>
  199. <p>
  200. Then try running the <code>miniglxtest</code> program:
  201. </p>
  202. <pre>
  203. ./miniglxtest
  204. </pre>
  205. <p>
  206. You should see a rotating quadrilateral which changes color as it rotates.
  207. It will exit automatically after a bit.
  208. </p>
  209. <p>
  210. If you run other tests in the miniglx/ directory, you may want to run
  211. them from a remote shell so that you can stop them with ctrl-C.
  212. </p>
  213. <h1>4.0 Troubleshooting</h1>
  214. <p>
  215. If you try to run miniglxtest and get the following:
  216. </p>
  217. <pre>
  218. [miniglx] failed to probe chipset
  219. connect: Connection refused
  220. server connection lost
  221. </pre>
  222. <p>
  223. It means that the sample_server process is not running.
  224. </p>
  225. <h1>5.0 Programming Information</h1>
  226. <p>
  227. The full OpenGL API is available with fbdev/DRI.
  228. </p>
  229. <p>
  230. OpenGL/Mesa is interfaced to fbdev via the <a href="MiniGLX.html">MiniGLX</a>
  231. interface.
  232. MiniGLX is a subset of Xlib and GLX API functions which provides just
  233. enough functionality to setup OpenGL rendering and respond to simple
  234. input events.
  235. </p>
  236. <p>
  237. Since MiniGLX is a subset of the usual Xlib and GLX APIs, programs written
  238. to the MiniGLX API can also be run on full Xlib/GLX implementations.
  239. This allows some degree of flexibility for software development and testing.
  240. </p>
  241. <p>
  242. However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
  243. Some of the structures are different and some macros/functions work
  244. differently.
  245. See the <code>GL/miniglx.h</code> header file for details.
  246. </p>
  247. </body>
  248. </html>