Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

fbdev-dri.html 5.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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 environment supports hardware-accelerated 3D rendering without
  9. the X window system. This is typically used for embedded applications.
  10. </p>
  11. <p>
  12. Contributors to this project include Jon Smirl, Keith Whitwell and Dave Airlie.
  13. </p>
  14. <p>
  15. Applications in the fbdev/DRI environment use
  16. the <a href="MiniGXL.html"> MiniGLX</a> interface to choose pixel
  17. formats, create rendering contexts, etc. It's a subset of the GLX and
  18. Xlib interfaces allowing some degree of application portability between
  19. the X and X-less environments.
  20. </p>
  21. <h1>2. Compilation</h1>
  22. <p>
  23. You'll need the DRM and pciaccess libraries. Check with:
  24. </p>
  25. <pre>
  26. pkg-config --modversion libdrm
  27. pkg-config --modversion pciaccess
  28. </pre>
  29. <p>
  30. You can get them from the git repository with:
  31. </p>
  32. <pre>
  33. git clone git://anongit.freedesktop.org/git/mesa/drm
  34. git clone git://anongit.freedesktop.org/git/xorg/lib/libpciaccess
  35. </pre>
  36. <p>
  37. See the README files in those projects for build/install instructions.
  38. </p>
  39. <p>
  40. You'll need fbdev header files. Check with:
  41. </p>
  42. <pre>
  43. ls -l /usr/include/linux/fb.h
  44. </pre>
  45. <p>
  46. Compile Mesa with the 'linux-solo' configuration:
  47. </p>
  48. <pre>
  49. make linux-solo
  50. </pre>
  51. <p>
  52. When complete you should have the following:
  53. </p>
  54. <ul>
  55. <li>lib/libGL.so - the GL library which applications link with
  56. <li>lib/*_dri_so - DRI drivers
  57. <li>lib/miniglx.conf - sample MiniGLX config file
  58. <li>progs/miniglx/* - several MiniGLX sample programs
  59. </ul>
  60. <h1>3. Using fbdev/DRI</h1>
  61. <p>
  62. If an X server currently running, exit/stop it so you're working from
  63. the console.
  64. </p>
  65. <h2>3.1 Load Kernel Modules</h2>
  66. <p>
  67. You'll need to load the kernel modules specific to your graphics hardware.
  68. Typically, this consists of the agpgart module, an fbdev driver module
  69. and the DRM kernel module.
  70. </p>
  71. <p>
  72. As root, the kernel modules can be loaded as follows:
  73. </p>
  74. <p>
  75. If you have Intel i915/i945 hardware:
  76. </p>
  77. <pre>
  78. modprobe agpgart # the AGP GART module
  79. modprobe intelfb # the Intel fbdev driver
  80. modprobe i915 # the i915/945 DRI kernel module
  81. </pre>
  82. <p>
  83. If you have ATI Radeon/R200 hardware:
  84. </p>
  85. <pre>
  86. modprobe agpgart # the AGP GART module
  87. modprobe radeonfb # the Radeon fbdev driver
  88. modprobe radeon # the Radeon DRI kernel module
  89. </pre>
  90. <p>
  91. If you have ATI Rage 128 hardware:
  92. </p>
  93. <pre>
  94. modprobe agpgart # the AGP GART module
  95. modprobe aty128fb # the Rage 128 fbdev driver
  96. modprobe r128 # the Rage 128 DRI kernel module
  97. </pre>
  98. <p>
  99. If you have Matrox G200/G400 hardware:
  100. </p>
  101. <pre>
  102. modprobe agpgart # the AGP GART module
  103. modprobe mgafb # the Matrox fbdev driver
  104. modprobe mga # the Matrox DRI kernel module
  105. </pre>
  106. <p>
  107. To verify that the agpgart, fbdev and drm modules are loaded:
  108. </p>
  109. <pre>
  110. ls -l /dev/agpgart /dev/fb* /dev/dri
  111. </pre>
  112. <p>
  113. Alternately, use lsmod to inspect the currently installed modules.
  114. If you have problems, look at the output of dmesg.
  115. </p>
  116. <h2>3.2 Configuration File</h2>
  117. <p>
  118. Copy the sample miniglx.conf to /etc/miniglx.conf and review/edit its contents.
  119. Alternately, the MINIGLX_CONF environment variable can be used to
  120. indicate the location of miniglx.conf
  121. </p>
  122. To determine the pciBusID value, run lspci and examine the output.
  123. For example:
  124. </p>
  125. <pre>
  126. /sbin/lspci:
  127. 00:02.0 VGA compatible controller: Intel Corporation 82915G/GV/910GL Express Chipset Family Graphics Controller (rev 04)
  128. </pre>
  129. <p>
  130. 00:02.0 indicates that pciBusID should be PCI:0:2:0
  131. </p>
  132. <h2>3.3 Running fbdev/DRI Programs</h2>
  133. <p>
  134. Make sure your LD_LIBRARY_PATH environment variable is set to the
  135. location of the libGL.so library. You may need to append other paths
  136. to LD_LIBRARY_PATH if libpciaccess.so is in a non-standard location,
  137. for example.
  138. </p>
  139. <p>
  140. Change to the <code>Mesa/progs/miniglx/</code> directory and
  141. start the sample_server program in the background:
  142. </p>
  143. <pre>
  144. ./sample_server &amp;
  145. </pre>
  146. <p>
  147. Then try running the <code>miniglxtest</code> program:
  148. </p>
  149. <pre>
  150. ./miniglxtest
  151. </pre>
  152. <p>
  153. You should see a rotating quadrilateral which changes color as it rotates.
  154. It will exit automatically after a bit.
  155. </p>
  156. <p>
  157. If you run other tests in the miniglx/ directory, you may want to run
  158. them from a remote shell so that you can stop them with ctrl-C.
  159. </p>
  160. <h1>4.0 Troubleshooting</h1>
  161. <ol>
  162. <li>
  163. If you try to run miniglxtest and get the following:
  164. <br>
  165. <pre>
  166. [miniglx] failed to probe chipset
  167. connect: Connection refused
  168. server connection lost
  169. </pre>
  170. It means that the sample_server process is not running.
  171. <br>
  172. <br>
  173. </li>
  174. </ol>
  175. <h1>5.0 Programming Information</h1>
  176. <p>
  177. OpenGL/Mesa is interfaced to fbdev via the <a href="MiniGLX.html">MiniGLX</a>
  178. interface.
  179. MiniGLX is a subset of Xlib and GLX API functions which provides just
  180. enough functionality to setup OpenGL rendering and respond to simple
  181. input events.
  182. </p>
  183. <p>
  184. Since MiniGLX is a subset of the usual Xlib and GLX APIs, programs written
  185. to the MiniGLX API can also be run on full Xlib/GLX implementations.
  186. This allows some degree of flexibility for software development and testing.
  187. </p>
  188. <p>
  189. However, the MiniGLX API is not binary-compatible with full Xlib/GLX.
  190. Some of the structures are different and some macros/functions work
  191. differently.
  192. See the <code>GL/miniglx.h</code> header file for details.
  193. </p>
  194. </body>
  195. </html>