Clone of mesa.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

fbdev-dri.html 7.5KB

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