Architecture Logicielle & Développement - Mot-clé - SoC2018-03-12T08:10:03+01:00Emmanuel Delogeturn:md5:5fa2e7026fbba69b676b29d560d2ef29DotclearLes nouvelles du fronturn:md5:d12ffed4604ed6c50be36d2bda0439ff2013-06-14T12:00:00+02:002013-06-14T12:00:00+02:00Emmanuel DelogetOpen SourceA10AllwinnerExynosGPUMedia CenterO-DROIDOUYAPandaboardRapsberry PiSoC<p><img src="http://blog.emmanueldeloget.com/public/pandaboard/.wTw_OZv8NT8a0M2Xdkc0hCOdhI3deMJ2BuZWcOn-9l8_t.png" alt="Logo OUYA" style="float:left; margin: 0 1em 1em 0;" title="Logo OUYA, sept. 2012" /></p>
<p>Le rythme de publication sur ce blog s'est singulièrement ralenti pendant les quelques dernières semaines. En cause, de nombreux événements professionnels et personnels qui bloquent une grosse partie de mon temps. Mais sait, cher lecteur, que je ne t'oublie pas&nbsp;: de nouveaux billets sont prévus dans les semaines qui viennent, sur des sujets aussi divers que le C++, Linux ou des plateformes matérielles intéressantes.</p>
<p>Mais ce qui me pousse aujourd'hui à écrire, c'est un mail que j'ai reçu hier. Ce mail est annonciateur d'une bonne et heureuse nouvelle, et voici son titre&nbsp;: <em>#myouyaiscoming</em>.</p> <h3>#myouyaiscoming</h3>
<p>Je ne vais pas citer le mail dans son entièreté (d'autant plus qu'il contient des informations personnelles qui n'ont rien à faire sur un blog), mais je puis en citer son introduction&nbsp;:</p>
<pre>Yep...it’s true. <br />
Your OUYA has arrived at our distribution center and we expect it to land
on your doorstep within the next two weeks (give or take a day or two
depending on your location).<br />
Be on the lookout for a confirmation email that will follow once your
shipment has been picked up for delivery and which will include your
personalized tracking number.</pre>
<p>La nouvelle est bonne&nbsp;: si tout se passe bien, je devrais recevoir mon exemplaire de la console OUYA aux alentours de la date promise (le 24 juin 2013, date de sortie officielle). Elle ira - quasiment immédiatement - prendre la place de la carte ODROID-U2 dans mon salon (celle-ci sert actuellement de pseudo media-center chez moi alors que je devrais la torturer dans tous les sens).</p>
<p>Ces derniers temps, j'ai lu beaucoup de choses assez négative sur la console OUYA. Selon de nombreux sites de benchmark, ses performances sont décevantes<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/06/14/Les-nouvelles-du-front#pnote-292-1" id="rev-pnote-292-1">1</a>]</sup> - en deçà de ce qu'il est possible d'obtenir avec un processeur Tegra 3. Pour rappel, le processeur quad-core est cadencé à 1.7 Ghz et est équipé d'un GPU GeForce ULP. Avec un tel processeur, OUYA devrait faire mieux que la <a href="http://community.futuremark.com/hardware/mobile/" hreflang="en">106 pièce du classement mobile de FutureMark</a> (à ce jour&nbsp;; le classement évolue rapidement).</p>
<p>Ce qui est étonnant dans ce classement, c'est la présence d'un mobile basé sur un processeur Tegra 2 en position 99 - hors le Tegra 3 (et spécialement celui qui équipe la console OUYA) est clairement plus puissant que le Tegra 2. Il y a là une incohérence de taille, qui provient probablement du fait que la version OUYA testé est une version de développement, utilisant un firmware non finalisé. Ceci dit, je ne m'avancerai pas à faire un pronostic quand à ses performances actuelles. Au mieux, la console OUYA va rivaliser avec la tablette ASUS - soit un gain de 10% environ en performances (mais la tablette ASUS bénéficie de 2 Go de RAM, contre 1 Go pour la console OUYA&nbsp;; il est possible que l'impact de la RAM soit important ici).</p>
<p>Quoi qu'il en soit, je devrais être à même de faire moi-même quelques tests dans les semaines qui viennent - en particulier un benchmark reliant RPi, Pandaboard ES, ODROID-U2 et OUYA.</p>
<h3>#mya10siscomingtoo</h3>
<p>OK, ce hashtag est un peu étrange. Parallèlement à la console OUYA en cours de livraison, j'ai commandé une petite carte de développement basée sur le processeur AllWinner A10S. Le A10 est un processeur simple coeur Cortex-A8 aux performances limitées, mais son coût est ridiculement faible. Il équipe quantité de mobiles bas de gamme. Ceci étant dit, ses caractéristiques sont tout de même intéressantes&nbsp;:</p>
<ul>
<li>GPU Mali 400 (simple coeur).</li>
<li>VPU CedarX capable de décoder nativement du VP8, H.264 et d'encoder du H.264 high profile.</li>
<li>sortie HDMI, LVDS jusqu'à la résolution HD (1080p).</li>
</ul>
<p>Le prix de la carte&nbsp;? <a href="https://www.olimex.com/Products/OLinuXino/A10S/A10S-OLinuXino-MICRO/" hreflang="en">45€ chez Olimex</a> (et bien moins cher en quantité). Olimex produit non pas des cartes pour hobbyistes, mais des cartes industrielles - ce qui explique le coût un peu plus élevé que nécessaire&nbsp;: on y trouve des connecteurs GPIO peut utile pour mon cas d'utilisation (plus de détails la dessus dans les semaines à venir), des protections ESD sur la sortie HDMI... En réduisant certaines de ces fonctionnalités et en commandant les cartes en volume, on doit pouvoir descendre son prix vers les 30€, voire plus bas encore.</p>
<p><img src="http://blog.emmanueldeloget.com/public/pandaboard/A10S-01.jpg" alt="Olimex A10S" style="display:block; margin:0 auto;" title="Olimex A10S, juin 2013" /></p>
<p>Pourquoi une telle carte&nbsp;? Ses caractéristiques techniques sont assez similaire à celles de la RPi, son coût aussi, et sa disponibilité est assurée. De plus, la carte est complètement Open Source et librement copiable (tous les documents nécessaires sont présents sur <a href="https://github.com/OLIMEX/OLINUXINO" hreflang="en">GitHub</a>). La présence d'un connecteur UEXT est un plus dans un environnement industriel, de même que le connecteur série (qui nécessite un cable FTDI 3.3V, <a href="https://www.olimex.com/Products/Components/Cables/USB-Serial-Cable/USB-Serial-Cable-F/" hreflang="en">disponible chez Olimex pour la modique somme de 5,95€</a>&nbsp;; il est aussi possible d'en trouver en volume sur ebay, ou les prix peuvent être excessivement bas: 100 pièces pour 199€, soit moins de 2€ le câble&nbsp;; évitez les Farnell et autres RS qui vendent ces même cables entre 15 et 25 € pièce).</p>
<p>Niveau mécanique, on retrouve aussi quelques caractéristiques intéressantes. Tout d'abord, la taille&nbsp;: environ 8 cm x 10 cm, ce qui en fait une carte de taille très raisonnable. La carte propose aussi des trous de fixation ce qui permet de la fixer à peu près n'importe où. Le PCB est lui aussi très complet, avec un emplacement prévu pour la NAND (testé avec <a href="https://www.olimex.com/Products/Components/IC/H27UBG8T2BTR/" hreflang="en">cette flash Hynix</a>), un autre pour le second UART, et encore un autre pour la JTAG. Les emplacement sont correctement identifiés sur le PCB, ce qui permet de reconnaître facilement tout le monde.</p>
<p><img src="http://blog.emmanueldeloget.com/public/pandaboard/A10S-02.jpg" alt="A10S-02.jpg" style="display:block; margin:0 auto;" title="A10S-02.jpg, juin 2013" /></p>
<h3>Beaucoup de cartes, finalement</h3>
<p>Si on compte bien, j'ai entre les mains&nbsp;:</p>
<ul>
<li>Une Pandaboard ES (OMAP4460, 180$)</li>
<li>Une RPi (BCM2835, 33€)</li>
<li>Une ODROID-U2 (Exynos 4412 Prime, 89$)</li>
<li>Une OUYA (Tegra 3 modèle T33, 99$)</li>
<li>Une Olimex A10S (45€)</li>
</ul>
<p>Les deux dernières devraient arriver dans les prochaines semaines.</p>
<p>Il me manque une carte basée sur un SoC Marvell (par exemple <a href="http://solid-run.com/cubox" hreflang="en">celle-ci</a>, tant l'offre est réduite en la matière), ainsi qu'une carte basée sur une SoC Qualcomm (probablement <a href="http://www.inforcecomputing.com/product/moreinfo/ifc6410.html" hreflang="en">celle-là</a>, malgré son prix peu attractif).</p>
<p>Quoi qu'il en soit, ça commence à faire un échantillonnage suffisant qui devrait me permettre de mener certains projets à bien - et notamment ce projet de media-center sous Linux qui traîne depuis déjà trop de temps. Mais ce n'est pas le seul&nbsp;!</p>
<p>Car la carte qui m'intéresse le plus à l'heure actuelle, c'est la carte A10S. Si ses performances sont suffisantes (notamment les performances graphiques), j'ai prévu d'utiliser cette carte pour un projet qui devrait être intéressant pour la communauté des joueurs de jeux de rôle sur table dont je reparlerai certainement dans un futur pas trop lointain.</p>
<div class="footnotes"><h4 class="footnotes-title">Note</h4>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/06/14/Les-nouvelles-du-front#rev-pnote-292-1" id="pnote-292-1">1</a>] Lire <a href="http://www.phoronix.com/scan.php?page=news_item&amp;px=MTM1MjU" hreflang="en">cet article</a> sur Phoronix</p></div>
http://blog.emmanueldeloget.com/index.php?post/2013/06/14/Les-nouvelles-du-front#comment-formhttp://blog.emmanueldeloget.com/index.php?feed/atom/comments/292The SoC GPU driver interviewurn:md5:ef5996f57310b4e0afbc90818e9fd0192013-04-25T21:45:00+02:002014-03-19T11:59:19+01:00Emmanuel DelogetOpen SourceARMdriverGPUlinuxOpen SourceOpenGLRapsberry PiSoCTegra 3<p><img src="http://blog.emmanueldeloget.com/public/technologie/.glxgears_t.png" alt="glxgears.png" style="float:left; margin: 0 1em 1em 0;" title="glxgears.png, avr. 2013" /></p>
<p>A few weeks ago, I published a <a href="http://blog.emmanueldeloget.com/index.php?post/2013/01/12/Open-source-drivers-for-SoC-GPUs" hreflang="en">status article about a few SoC GPU drivers</a>. SoC GPUs are a very hot topic that deserves a prominent exposition (even more than desktop GPU drivers in my humble opinion).</p>
<p>The current crop of SoC already provide unbelievable power to game developers and GPU lovers - and the versions that are coming are even more powerful<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-1" id="rev-pnote-279-1">1</a>]</sup>. In a few years they will be able to compete with traditional desktop GPUs on the laptop market. As they become more and more powerful there is good chance that they will be able to compete with them in the desktop world as well. In the same time, the traditional AMD or NVIDIA desktop GPUs will have a hard time to remove them from the mobile market as these SoC GPUs are both powerful <em>and</em> energy efficient.</p>
<p>There is a good chance that SoC GPUs will take over the world in the coming years<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-2" id="rev-pnote-279-2">2</a>]</sup>. That's part of the reason why I believe that the new series of open source GPU driver is of the utmost importance. And that's why I contacted several driver/tool maintainers/contributors:</p>
<ul>
<li>Connor Abbot (CA) - Open GPU Tools (Connor works on lima support here)</li>
<li>Eric Faye-Lund (EF) - grate (for Tegra GPUs)</li>
<li>Herman H. Hermitage (HH) - Videocore (for Broadcom GPUs)</li>
<li>Luc Verhaegen (LV) - lima (for MALI GPUs)utter</li>
<li>Matthias Gottschlag (MG) - Videocore (for Broadcom GPUs)</li>
<li>Rob Clark (RC) - freedreno (for Adreno GPUs)</li>
<li>Thierry Reding (TR) - grate (for Tegra GPUs)</li>
<li>Scott Mansell (SM) - Videocore (for Broadcom GPUs)</li>
<li>Wladimir J. van der Laan (WL) - etna_viv (for Vivante GPUs)</li>
</ul>
<p>The good news is that they were kind enough to answer my rude and pitiful requests over the course of several weeks (the interview process started on March the 14th and ended on April the 20th). I'd like to thank them all for allowing me to steal their valuable time.</p>
<div class="footnotes"><h4 class="footnotes-title">Notes</h4>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-1" id="pnote-279-1">1</a>] GreatEmerald: sorry for your valuable eyes</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-2" id="pnote-279-2">2</a>] I mean: yeah, probably. Hopefully. Maybe?</p></div>
<blockquote><p><strong>Before we really begin, let me innovate a bit and do something no other interviewer has ever done. Let me ask this incredibly novel and dense question : who are you?</strong></p></blockquote>
<p><strong>RC</strong>: I'm Rob Clark. I've been working on arm/SoC stuff for quite a long time, and at the time I started on freedreno I was working for Texas Instruments. (Now working at Red Hat.)</p>
<p><strong>SM</strong>: I get the feeling this might be the hardest question in the interview.</p>
<p>Lets just say I'm a 24 year old Computer Science student from New Zealand. Previously I've been involved with projects like hacking cheap Chinese mp3 players and enabling homebrew software on the PlayStation 3.</p>
<p><strong>WL</strong>: I'm just a guy from the Netherlands interested in GPUs, GPGPU, and reverse engineering. I did a CS PhD on processing volume data on GPUs.</p>
<p>I've been working on this kind of stuff for quite a while, for example back in ~2008 I figured out the NVidia G80 shader isa and wrote decuda, a (dis)assembler. My first experience with ARM reverse engineering was in 2004 with Nokia phone firmware.</p>
<p><strong>MG</strong>: I am a 21-year-old student from Germany who enjoys hacking on low-level code. Currently I am writing my bachelor thesis on virtualization and NVidia GPUs, together with current exams that doesn't leave any time for reverse engineering at the moment unfortunately.</p>
<p><strong>TR</strong>: My name is Thierry Reding. I work as a software engineer at Avionic Design. I mostly do kernel and plumbing work<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-1" id="rev-pnote-279-1">1</a>]</sup> and have lately been involved with the effort to provide better upstream support for NVIDIA Tegra SoCs.</p>
<p><strong>EF</strong>: I am Erik Faye-Lund, a graphics developer from Norway<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-2" id="rev-pnote-279-2">2</a>]</sup>. I used to work at ARM (on the Mali OpenGL ES team), so I'm not without experience from the field. I worked on the Mali software-team pretty much from its infancy, up until the Mali-400 started shipping. I'm currently having fun with poking into the Tegra 3D registers, with great help from Thierry Reding.</p>
<p><strong>HH</strong>: I'm Herman Hermitage. I've enjoyed working and tinkering with software and hardware since the 80s across a range of areas, particularly graphics, reverse engineering and security. I've had less chance in recent years to focus on these things, so I picked up a RaspberryPi in 2011 to tinker.</p>
<p><strong>LV</strong>: I am a 33 years old belgian who moved to Nuernberg, germany, for SuSE Linux in 2007, and i liked the place so much that i stayed. I have been working on open source graphics drivers for close to a decade. I have pioneered some fundamental ideas for modesetting, I have played a rather crucial role in freeing ATI, have done a few other things left and
right, and now I seem to have started this open ARM GPU thing. I usually find myself swimming against the stream and trailblazing something or another, and stepping on a lot of toes in the process, even if that is simply by stealing someone elses thunder.</p>
<p><strong>CA</strong>: As you may have gathered from Luc, I am a 16 year old high school student with a rather... unusual hobby :). I started down this path at around 8, when my father gave me a book on the C language, and I've been learning
things on my own ever since. I'm currently trying (and sometimes succeeding, sometimes not) at balancing this project, my schoolwork, summer internships, and the college admissions process (as I am a junior in high school, it usually starts kicking into gear around this time).</p>
<blockquote><p><strong>What is the current state of your respective projects?</strong></p></blockquote>
<p><strong>RC</strong>: Basic adreno support for <a href="http://en.wikipedia.org/wiki/Imageon#Renaming_to_Adreno" hreflang="en">a220</a> is just recently merged to <a href="http://cgit.freedesktop.org/mesa/mesa/" hreflang="en">mesa git</a> master. Some feature and performance work still to go. I believe that with not too much work this should work on other a2xx devices. I've just recently started on r/e for <a href="http://en.wikipedia.org/wiki/Imageon#Renaming_to_Adreno" hreflang="en">a3xx</a>, which is somewhat different compared to a2xx (new shader ISA<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-3" id="rev-pnote-279-3">3</a>]</sup>, bunch of register changes and reshuffling). At this point for a3xx I have a working shader disassembler but I've not had time yet to go to far on the cmdstream parsing and figuring out the new registers, etc.</p>
<p><strong><ins>Update</ins></strong>: I actually have a shader assembler, and <a href="http://people.freedesktop.org/~robclark/a3xx/lolscat.png" hreflang="en">all the libfdre tests working now on a320/nexus4</a>.</p>
<p>I'm just starting now on the gallium driver support.. or rather, starting on the pre-step of refactoring of the current gallium driver to split out the parts that I have discovered as common between a2xx and a3xx (ie. some of the higher level stuff, such as how tiling works) from the parts that are not (ie. compiler, and all the register level stuff)</p>
<p>a3xx seems quite fast so far, and the compiler will certainly be interesting to write :-)</p>
<p><strong>SM</strong>: I'm not exactly up to date with our status<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-4" id="rev-pnote-279-4">4</a>]</sup>, so this may be slightly out of date.</p>
<p>We have mostly reverse engineered the custom instruction set of the VPU (One of many cores on the chip; it's a standard scalar CPU optimised for multimedia (particularly video encoding/decoding at Standard Definition resolutions). It is responsible for booting the system, loading the linux kernel into memory before the arm core even executes a single instruction. Once linux (or another OS) boots it acts as a multimedia co-processor running the OpenGL driver and offering various video/audio/image decoding/encoding services to the main OS).</p>
<p>We can run custom code on the VPU, either by replacing the bootloader on the SD card, or from linux using backdoor which the Raspberry Pi Foundation nicely added for us. Right now code has to be written in assembler, but there are a few efforts to port a compiler to the VPU arch<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-5" id="rev-pnote-279-5">5</a>]</sup>.</p>
<p>As for the actual GPU part of the Videocore, the instruction set of the QPUs (universal shader cores) is known, but most of the hardware registers are unknown so we have no idea how to run them. From boot we can't even get a framebuffer or enable the arm core.</p>
<p>Currently we are working on documenting all those registers.</p>
<p><strong>WL</strong>: I figured out the state bits and command stream format needed for rendering, as well as the shader ISA<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-6" id="rev-pnote-279-6">6</a>]</sup>. I have a working and fairly complete Gallium-ish driver for GC600/800 (and <a href="https://github.com/sjhill71" hreflang="en">sjhill</a> is working on GC880 support), the biggest thing still missing is the TGSI-&gt;Shader compiler, which I'm currently working on. Next on my list is integrating the stuff into MESA, to get OpenGL support, and work on GC2000 and OpenCL support.</p>
<p><strong>MG</strong>: I don't think I have to add much to what Scott said. I have been working on figuring out more about hardware initialization, but I would say that it is considerably more difficult with the Pi compared to other GPUs. That's because it isn't just a GPU, so we cannot just "run the binary driver and capture its output", because there is no underlying operating system we could use. My solution to that has been to write an emulator for the firmware, but the emulation means that there are more than just a few timing related issues where the firmware will not work as expected.</p>
<p>But hey, we have SDRAM up and running - some months ago all we had was 256kB of L2 cache!</p>
<p><strong>TR</strong>: The starting point for most of the current work is a manual playback of a simple OpenGL ES 3-color smooth shaded triangle. Erik Faye-Lund has done a fantastic job at figuring out a lot of the details.</p>
<p>When I started working on <a href="https://github.com/grate-driver" hreflang="en">grate</a> initially I kept looking at Erik's work a lot for inspiration. One piece that was still missing, though, was a way to see actual results from feeding a command stream to the 3D engine. Perhaps my biggest contribution yet was to figure out how to detile the framebuffer and write it to a PNG so that one could look at the results.</p>
<p>Right now we're still in a very early stage and the work cycle basically consists of modifying the command stream, running the program and look at the generated PNG file. One of the things I'm currently working on is to get support into the mainline kernel for displaying render buffers on top of the tegra-drm driver<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-7" id="rev-pnote-279-7">7</a>]</sup> (possibly using hardware overlays). Erik is certainly busy as well, but I'll let him speak for himself.</p>
<p>I should say that NVIDIA has so far been very helpful in providing a lot of code (like the host1x kernel driver) and the occasional hint along the way. They are very silent when it comes to the internals of the 3D engine but perhaps that will change as time goes by.</p>
<p><strong>EF</strong>: I'm currently working on trying to confirm the suspicions I've build up from looking at several megabytes of command streams.</p>
<p>So far we've managed to replay a rendering job, modify the viewport and scissor box as we want, perform clears of tiled and linear framebuffers, modify the draw-call parameters.</p>
<p>I've also managed to figure out how primitive restart (ish) works, so draw-calls beyond the limitations of the hardware-register bits (more than 4096 vertex indices) can be split into multiple draws.</p>
<p>In addition to this, we have somewhat working disassemblers for the vertex and fragment shader units.</p>
<p><strong>HH</strong>: Early days but good steady progress has been made. We have a good understanding of user mode on the <a href="http://www.broadcom.com/products/BCM2835" hreflang="en">BCM2835</a> VideoCore cpu - this has very much been a group activity. <a href="https://github.com/thubble" hreflang="en">Tiernan Hubble</a> mastered the integer vector instruction set encodings and Eizo-san has used these in anger for exploring accelerating X11. <a href="https://github.com/mm120" hreflang="en">Mark Marshall</a> has added initial VideoCore IV support to bintuils, and I believe he and <a href="https://github.com/felipealmeida" hreflang="en">Felipe Magno de Almeida</a> are exploring GCC support whilst Scott is exploring with LLVM support. In terms of exploiting floating point compute power, we have the encodings established for the unified shader (QPU) and a method for intercepting them as OpenGL ES shaders are compiled - however this work hasn't been made public yet (not in a fit state). Mattias is doing amazing work on emulating and capturing hardware register traces to get a better understanding of the functional blocks in the SoC. The firmware blob is running ThreadX and essentially it's an entire OS and set of services in its own right, with ARM + Linux a tiny parasite on the side. The blob is a statically linked thing on the RPi, so its a little hard to replace say just the Khronos library (OpenGL ES, OpenVG etc) with a open version without getting in very deep - ie a complete rewrite of all services. My own personal focus is more on coming up with a way to exploit the compute power that exists in the silicon, and undertaking analysis on the blob.</p>
<p><strong>LV</strong>: Mali-200/400 is a rather crazy architecture. All of the optimization is baked into the design, and when everything is implemented correctly, it simply is this blazingly fast. The craziest part of it is probably the vertex shader. <a href="https://gitorious.org/~cwabbott" hreflang="en">Connor Abbott</a>, the high school student<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-8" id="rev-pnote-279-8">8</a>]</sup> who has spent his past years spare time on reverse engineering the mali shaders, has finally gotten to a stage where his compiler can produce correct results. Due to the architecture of the mali vertex shader, this was quite an amazing amount of work. And yes, i said compiler there... He had no other option but to implement a partial compiler for this architecture, as an assembler on its own just could not produce any useful results and needs the timing of instructions baked in as well<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-9" id="rev-pnote-279-9">9</a>]</sup>.</p>
<p>With the output of Connors shader compiler, we now have a <a href="http://libv.livejournal.com/24402.html" hreflang="en">port of Quake 3 Arena running on top of the prototype driver</a>. We are measurably beating the mali binary driver with our proto driver, and our pre-compiled shaders, when running the Quake 3 Arena timedemo. And this simply by doing things right, and not by depending on some application or SoC specific hacks for those few extra fps. This is quite unique and cannot be underestimated, we have the possibility with the mali-200/400 to be as fast as the binary driver, in the general case.</p>
<p>Now that we have proven this capability with our research code, i am satisfied that we know enough to be able to properly implement mesa support. And this is our next big task, for both me and Connor.</p>
<p>And once we have a decent mesa driver going, we will move on to the new mali generation, and with all the experience we gathered from mali-400, we will make minced meat of the t6xx :)</p>
<p><strong>CA</strong>: There are two parts for what I'm trying to do: the Geometry Processor (GP) which runs vertex shaders and the Pixel Processor (PP) which runs fragment shaders - they both have completely different ISA's so unfortunately we can't share much code/effort between them. Eventually, I'd like to have a compiler hooked into Gallium/TGSI<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-10" id="rev-pnote-279-10">10</a>]</sup> for both of them that works at least as well as the binary compiler, which is a somewhat far-fetched goal (at least without some more help :) ), but the most important bit is to get <em>something</em> working, even if it isn't very optimized yet. I've gotten carried away sometimes, but I hope I can start looking into Gallium very soon - although it might require some changes to the interface which will take some time.</p>
<p>The first stage was reverse-engineering the ISA for both processors, so that we could understand them well enough to produce our own shaders. This took Ben Brewer (a <a href="http://www.codethink.co.uk/" hreflang="en">Codethink</a> employee who worked on shaders with me, although he sadly isn't working on it currently)<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-11" id="rev-pnote-279-11">11</a>]</sup> and I ~4-5 months to do, by which time we had almost everything nailed down (although new details seem to keep coming up now and then...). Next, we started writing our own compiler backends. Ben started work on ones for both the GP and PP, although sadly he had to leave when it was at a very early stage. We decided to write the compiler backends first, doing the parts we knew needed to be done and then looking at translating TGSI to our IR<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-12" id="rev-pnote-279-12">12</a>]</sup> once we had it working. Since then, I've since revamped/rewrote a lot of code that he wrote for the PP, adding a new backend based on a written-from-scratch IR (which I call pp_lir) to replace the half-baked backend in his lima_ir (which I've since renamed to pp_hir while significantly changing/expanding it). As for the GP, after some consideration I ended up scrapping the work he had done for it, writing my own... rather interesting IR to deal with the highly unique architecture.</p>
<p>I was working on this when Luc mentioned his Q3A demo to me, and pointed out that it would be best if we could make the entire thing open-source by using these experimental assemblers/IR's to generate the required shaders that were, as of then, being generated using the binary compiler that comes with the Mali drivers. I replied that the PP would be easy, since we can just manually convert the ESSL shaders into assembly and then use our assembler to produce the final binary (I could have used pp_hir and pp_lir, but the generated code would have been less optimal since some optimizations haven't been implemented yet). This method wouldn't work with the GP, however, because it's impossible to write any shaders that aren't incredibly simple in assembly. This is due to the fact that the architecture is scalar (i.e. each component of every vector operation must be scheduled independently, meaning that even the simplest shaders have a lot of operations to schedule) and there are many complicated constraints that must be met on each operation to "make it fit" in order to avoid register loads/stores and use up limited resources in an efficient manner. Therefore, we had to write our own scheduler with some kind of register allocation just in order to make this simple demo work, and this motivated me to get the code I was working on running as soon as possible. Unfortunately, I couldn't get it working before FOSDEM this year<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-13" id="rev-pnote-279-13">13</a>]</sup>, but Luc and I coordinated to finally put it all together this past weekend, so now we can both look forward to the future - Gallium3D!</p>
<blockquote><p><strong>What does motivate you to work on these projects?</strong></p></blockquote>
<p><strong>RC</strong> : Why let the desktop crowd have all the fun with open source drivers! But seriously, I see that tablets and phones and these sort of devices are replacing somewhat laptops and desktops. So I think that it is important that the free and community developed graphics stack, toolkits, etc, can play on these devices. The biggest or at least most immediate stumbling block so far is availability of graphics drivers. We see a growing trend of hacks to use android binary blobs, which really I think is a symptom of lack of open source graphics driver options.</p>
<p><strong>SM</strong>: I like taking things apart to see how they work, not just hardware but software too.</p>
<p>As various details about the <a href="http://www.raspberrypi.org/" hreflang="en">Raspberry Pi</a> started coming out I became interested in the various details like the boot process, with the binary blob running on the GPU being in control. Various people on the forums claimed it would be impossible to reverse engineer, modify or replace the binary blob as the Instruction set was unknown. Instead I stumbled into Herman Hermitage on IRC and we set upon proving them wrong.</p>
<p>Basically I do it for fun. But the fact the open source Raspberry Pi has this massive closed source binary blob does annoy me.</p>
<p><strong>WL</strong>: General interest in GPUs and reverse engineering, and figuring out how hardware/software works. I really cannot stand mysterious binary blobs for some reason :-) It is completely unrelated to my job.</p>
<p>Also the GPU is the only part of the Freescale i.mx6 SoC that has closed-source drivers, and for Marvell Dove the one-but-only (the VPU is also closed-source). It would be nice to have it working with full open source, so that it is possible upgrade kernels/ABIs, troubleshoot bugs and performance issues ourselves instead of having to wait ages for the vendor to contact Vivante and for them to release a new driver.</p>
<p><strong>MG</strong>: Why do I do it? Well, mainly because reverse engineering is fun (even though I tend to take breaks from it if it gets too frustrating). There are other reasons why a free firmware for the Raspberry Pi would be nice to have, e.g. to be able to use it as a second realtime core - but for me, is is mostly because I enjoy playing with the hardware.</p>
<p><strong>TR</strong>: Primarily I've been enjoying the learning experience. Computer graphics have always fascinated me and I like finding out how hardware works. On the other hand I've also experienced the usual problems when dealing
with binary blobs, so I'd like to eventually see an open-source driver for the Tegra. So far it seems like the best way to do this is by reverse-engineering. I hope that will change, though, and that more vendors will eventually start contributing documentation and perhaps even code to the open-source drivers.</p>
<p><strong>EF</strong>: Definitely the feeling of accomplishment; it's fun when you start to realize how a relatively complex system works. I also enjoy reading a bit up on details on the Linux graphics stack<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-14" id="rev-pnote-279-14">14</a>]</sup>.</p>
<p><strong>HH</strong>: I think its the child in me - I just have to know how it all works, and of course we all enjoy exploring the limit of just what is possible.</p>
<p>It's also exciting to think of a future where we could put a team together and create an Open CPU and GPU. Looking at all the great work going on with these SoCs, one can't help feel but that day is getting closer.</p>
<p>I'm also a huge fan of <a href="http://en.wikipedia.org/wiki/Alan_Kay" hreflang="en">Alan Kay</a>'s work. So from a philosophical point of view, I think its important activity to examine these SoCs and attempt to communicate the fundamental simplicities to the up and coming generations of engineers and scientists. Its all about opening the door of difficulty and showing the true simplicity behind that door.</p>
<p><strong>LV</strong>: As said before, trailblazing is something that apparently gives me great satisfaction. And, of course, there is the thrill of finding out things through hard labour and deduction, especially if people do not really want you to know such things.</p>
<p>There were several concrete and personal reasons for me to do this though.</p>
<p>First off, after the <a href="http://www.x.org/wiki/radeonhd" hreflang="en">RadeonHD</a> project, it was clear that i did not want to waste further time on the x86 linux desktop. It's a political swamp, where correct insights, hard labour, and actual results are all irrelevant if you do not belong to the right political group. And the lengths this group would go to to affirm their own supposed awesomeness shocked even me. The consolidation that happened in the x86 desktop graphics market, with the few remaining players now sticking hard to their respective position towards open source software, gives little option to do real work and achieve results outside of what is dictated by corporate politics. It was time to move to something new, and the completely level and open playing field of ARM GPUs was exactly that.</p>
<p>Secondly, when looking at the way the world was turning, everything was becoming ARM, and (almost) everything ARM was running some form of linux. There was only one key reason why people were not running a proper full linux on their ARM devices. One key factor that made this nigh impossible: binary userspace drivers. Someone had to get stuck in, prove that this is not beyond reach, and change this stalemate forgood. This was a perfect wall for running a very hard head into.</p>
<p>Finally, while I have covered most sides of graphics driver development in the meantime, I had not done any real 3D driver development before. When I was the only person who cared about boring modesetting, I often had to hear how difficult 3D graphics hardware is. Some part of me always knew that that was an excuse to not deal with the boring but highly important bits, but now I got to prove that this is not the case. If the hardware is sane, a 3D driver is sane as well, but even when the hardware is sane, the sheer number of combinations possible make display driver development impossible to get absolutely right for everyone. A few FPS less is not the end of the world, a display that does not show any image means that the user will turn and walk away. And it indeed was an excuse for not dealing with what people really needed at the time.</p>
<p>Looking back, I am really really happy with how this is turned out. I had hoped that we would have, in the meantime, convinced one hw vendor already (which then means that a few others will follow), but that still has not happened, although I am still hopeful. I am really pleased however with how lima was the motivator for several people to contribute either directly to lima, or for tackling a similarly insane task on their own. We now have a group of highly clued and dedicated people who devote their spare time on a task they believe is right, and which they enjoy doing. And people just do their stuff, there is no politics hampering anything, we are all too busy fighting our binary blobs and hardware to spend time doing anything else. And we are all hurtling rapidly towards being actually useful for users, I am sometimes shocked to see what progress some guys seem to make overnight. Two years ago, when I started down this path, I couldn't have dreamed that such a marvelous outcome would be possible.</p>
<p><strong>CA</strong>: Sometimes, that's a question that I ask myself :). I think a large part of it is simply the desire to figure out what's going on - can I put this together? I think that motivation helps especially with reverse-engineering, since it feels like a game where you're solving some particularly hard puzzle - and it's a fun game too, although frustrating at times. As for writing the compiler, the motivation is more extrinsic. I'm taking the information I learned through reverse-engineering and applying it to a useful end, i.e. writing an open-source driver for the Mali. I want this driver through a frustration with the current situation in ARM graphics (although some vendors, especially Nvidia, seem to be getting a clue and things are starting to progress), but also it's a fun project to learn a lot about graphics drivers and graphics in general, a lot more and much faster than I could have done through working on a desktop, x86 driver. In my case, I didn't even need any actual hardware to start contributing, since ARM helpfully provides an offline compiler that can be (ab)used for analyzing its generated output. And even for projects that do require hardware, the stuff itself is really cheap to get compared to a desktop setup, where you typically need two full-fledged computers (one for running the experimental code, and one for debugging it) and several expensive, power-sucking graphics cards in order to test your code.</p>
<blockquote><p><strong>What was the starting point of your development? Were you able to find any documentation or code to help you through your reverse-engineering journey?</strong></p></blockquote>
<p><strong>RC</strong>: Well, I actually started on 2d first. adreno/freedreno is actually about two distinct graphics accelerators, there is a 3d core that is derived from radeon, and a 2d core which really has nothing in common except sharing the MMU<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-15" id="rev-pnote-279-15">15</a>]</sup>. But since they are using roughly the same ioctls for command submission, this more or less applies to both.</p>
<p>The first step was kind of boring.. Just writing some simple test programs (plus figuring out how to link against android bionic/libc with a normal glibc gcc toolchain, since I don't actually have linux/glibc versions of the blob drivers). Once I had some tests, then I fired up strace to get an idea of the interfaces between kernel and userspace, and started looking at the kernel driver code and corresponding ioctl structs. And with that understanding of the kernel&lt;-&gt;userspace interfaces, I wrote my creatively named <em>libwrap.so</em>, which is a shim that can be LD_PRELOAD'd and log the cmdstream, keep track of gpu buffers, etc. And based on the log files generated by libwrap, I started figuring out how to parse the cmdstream dumps.</p>
<p>On the 3d side, I had some context save/restore code in the kernel driver from the <a href="https://android.googlesource.com/kernel/msm.git" hreflang="en">msm android kernel tree</a><sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-16" id="rev-pnote-279-16">16</a>]</sup>. That gave me a pretty good starting point for parsing the 3d cmdstream dumps, but It didn't really help for 2d or figuring out the shader ISA. And also, due to the AMD/ATI heritage, I spent a lot of time reading the public r300/r600 docs. Some way into the 3d, after I already had the <a href="http://bloggingthemonkey.blogspot.com/2012/08/open-source-lolscat.html" hreflang="en">rotating cat demo</a> and my own shader assembler, I found a freescale kernel which had the original amd-gpu kernel driver for adreno a200. (I have been mainly working on the a220, fwiw.) But this had definitions for the bitfields in most of the registers and shader ISA instruction encoding. So it would have been useful to have much earlier, but all the same I was able to correct a few mistakes in what I'd figured out about register bitfields and shader ISA... few places where I was off by a bit or two on sizes for some bitfields, etc.</p>
<p>I guess it is kind of a detective game. You search for hints and clues everywhere.</p>
<p><strong>WL</strong>: The starting point of my development was a rooted Rockchip 2918 tablet a friend gave me. I wanted to hack on it, and when I first started playing with android rendering internals, I hoped it'd have any of Mali, Adreno, etc GPU. But it turned to be this (new to me) Vivante GPU. As there was no project making open source drivers for those yet I thought it'd be fun to see how far I'd get. I also wanted to do some experiments with binary static analysis and symbolic execution to automatically map GL state to HW state.</p>
<p>In contrary to the userspace, the kernel driver is GPLed, which is great and I found various instances of the GPL drivers in SoC kernel trees. Unfortunately at first, none exactly matched the interface of my device. It took some puzzling with fields to get that part right, but it helped me along greatly in understanding the hw and kernel interface.</p>
<p>After a month or so I found out that there were some more things already out there. There is the (defunct) gcx project which was working on an accelerated 2D driver, and some TI OMAP documentation about the 2D hardware. Nothing about 3D, though (that's the same as with many other GPU vendors). This did help me fill in some gaps in the command stream format as the 2D and 3D pipe share the same DMA interface.</p>
<p><strong>EF</strong>: I simply started by intercepting writes and ioctls to /dev/nvhost-gr3d, and looking at what happened. Luckily, NVIDIA had released the source code for their kernel module, so I could more or less figure out what the ioctls did. Also, most of the CDMA (the command-stream DMA) opcodes were somewhat documented through usage there, so I could figure out how hardware-registers were written. Then, I looked through a lot of dumps of carefully crafted GLES-programs to see how things worked.</p>
<p>At a later point, NVIDIA also released documentation for their 2D unit, and some source code using it. This has been quite valuable so far as well.</p>
<p>Another thing that was useful, was that NVIDIA has released an off-line compiler. I used this to begin with when disassembling the shaders, but now we are tapping into their on-line compiler instead.</p>
<p><strong>CA</strong>: I had done a little graphics stuff a while ago, but the memories were rather vague - so the first step was to read the ESSL 1.0 specification from front to back to familiarize myself with the operations, features, etc. that I would have to figure out while reverse-engineering. It was actually surprisingly readable, being rather simple compared to desktop GLSL and free of legacy features. Then I compiled some simple shaders using the offline compiler, trying to figure out the format of the MBS files that it produces. Luckily, it was pretty similar to the format of the online compiler, which Luc had already reverse-engineered, and I quickly wrote a simple utility to dump the shader binary itself (i.e. just the instructions themselves, without any of the metadata the compiler inserted for the driver to use). Combined with a hex editor to look at the resulting file, that was all I used to start out. Luc had already figured out a small portion of the vertex shader ISA for his linking code, so that helped us a lot. But perhaps the most help came from Eric, who had internal knowledge from working the Mali team, and gave us hints whenever he could and stopped us from going down dead ends.</p>
<p>Unfortunately, there wasn't much code/documentation we could use when we started out other than what Luc had already done - so we pretty much started from scratch. What we did, though, was write a lot of our own code and documentation. I think that when reverse-engineering something, especially something as complex as the Mali shader ISA's, it's critical that you write all your guesses down. And then, when/if they turn out to be correct, you have to immediately turn around and write some code, something that abstracts away the details and keeps you from having to mentally parse all the stuff you've already figured out when you're trying to reason about something that's still unknown. I was lucky that Ben, who was paid to work on it, could spend more time doing the boring things, such as implementing a disassembler to help me while we were figuring out the ISA.</p>
<p><strong>LV</strong>: My starting point was the goal of freeing ARM GPUs, and then figuring out a plan of attack from scratch. And it started with picking a good candidate, and that ended up being ARMs own Mali.</p>
<p>I first had to get mali hardware, but the only hardware available at the time was a Mali-200 on the cheap and horrible Telechips tablets of late 2010. Only a pretty awful kernel tree was made available, and all we had which was runnable on actual devices, and which included binary drivers, was android-2.1. This did not even have LD_PRELOAD and i wasted my spare time trying to hack ELF binaries directly to achieve an effect like LD_PRELOAD. This and the android bionic<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-17" id="rev-pnote-279-17">17</a>]</sup> linker did not make that too successful an endeavour. Luckily, towards the summer of 2011, an android 2.3 image became available for a telechips device, and then things finally started moving along.</p>
<p><strong>TR</strong>: My first steps were to write a DRM driver because the display driver that NVIDIA provided was something between FB and DRM, with a completely non-standard interface. Once the DRM driver was merged into the mainline kernel (3.8), NVIDIA actually started contributing patches to support the host1x infrastructure on top of that. By the looks of it the patches should be able to make it into 3.10.</p>
<p>Those patches can be used to implement 2D and 3D acceleration. NVIDIA has provided documentation about the host1x and gr2d engines, so those parts don't need to be reverse-engineered. While NVIDIA plans to port their binary drivers to the DRM interface, there are no indications so far that any of the code will be open-source.</p>
<p>Meanwhile I've been spending some time on making the grate code work on top of the DRM interface and I have a couple of patches to the kernel which allow this to work. The nice thing is that grate now has an abstraction layer which works on top of both the L4T (NVIDIA-provided) and upstream kernel interfaces. So our very basic 2D and 3D test programs run unmodified on both L4T and upstream kernels, where upstream kernels even support on-screen display.</p>
<p><strong>MG</strong>: There was no interesting code available, but the documentation actually was helpful 1-2 times. Not because it documented anything interesting, but rather because, as it should be in a properly designed system, some registers looked similar to ones documented in the manual (mainly timer related registers). The most important help though were the hardware patents - they sometimes contained a fairly precise description of instruction encodings or other aspects of the programming model.</p>
<blockquote><p><strong>How does your project relate to the other projects in the same field? Were you able to reuse some code, design idea... ?</strong></p></blockquote>
<p><strong>RC</strong>: I think I took a relatively similar approach to what Luc had done on mali.. and I think it is probably similar to grate/etnaviv. I guess it is pretty standard technique for r/e'ing a userspace blob. I think I probably stole a piece or two of util code (like bmp dumper), and some of my early gles tests from lima. Probably a lot more useful was the idea sharing and bouncing theories about how things work on #lima and #freedreno<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-18" id="rev-pnote-279-18">18</a>]</sup>.</p>
<p>I've switched to using envytools for a3xx. I didn't use it for a2xx as I was pretty far through the process of writing my own hand-written parsing when I discovered envytools. But I guess since I'm starting again with a3xx, it is a good time to make the switch.</p>
<p><strong>WL</strong>: I used tools from nouveau<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-19" id="rev-pnote-279-19">19</a>]</sup> (envytools). As they already defined and documented an excellent format for mapping the state space, this allowed me to focus on doing experiments for finding out the bits instead of thinking how to structure things. This shows that, even though there is a wide difference in GPU architectures, there is also a lot in common between different endavours and we can benefit from standardized tools.</p>
<p>Overall I followed the same approach as Lima, by first running GLES demos on an off-screen buffer and dumping the output to bmp files, intercepting and later replaying the command streams and memory deltas. These can then be analyzed to see what the blob does, and why. This allowed me to avoid the Android surfaceflinger labyrinth and gory framebuffer details at first.</p>
<p>While figuring out the command stream I wrote increasingly higher-level utility functions to generate it, and these converged on a gallium-like interface that will eventually become the driver.</p>
<p><strong>EF</strong>: I stole more or less my whole approach from the Lima-driver. I don't think we've used any of their code, though. On my part, most of the code has been relatively simple throw-away stuff anyway.</p>
<p>I also used the rnn/rnndb stuff from Nouveau's envytools for my earlier tegra-re code-base, but it's not working with the grate-code (yet?).</p>
<p><strong>CA</strong>: For the compilers, I've stolen/used a lot of good ideas that I learned while doing my investigation into compiler theory; this is a well-established field, so even if it's complicated, at least I'm not exactly the first person to be implementing these algorithms. The register allocator I'm using, for example, is based on the one in Mesa that's used by the Intel and r300g drivers if I understand correctly.</p>
<p><strong>LV</strong>: All of the lima code is written from scratch, there were no examples for me to follow.</p>
<p>I had to write the wrapping of relevant libc calls myself. This is all relatively straightforward, but there was nothing similar out there yet. I had to also write simple GLES/EGL tests myself, so i had to first read up on that as well. Then building all of this and running it on android, that was quite a pain as well, and no-one was using proper makefiles to do it, everyone just seemed to use the android build system.</p>
<p>SuSE's yast and snapper developer <a href="http://arvin.schnell-web.net/" hreflang="en">Arvin Schnell</a> created some further tests for me, and wrote the Android demo app. This app goes fullscreen, stops rendering to fullscreen, and just runs the selected program. This meant that i could render to the FB without android interrupting, and that i could just select different tests and use the back-button to exit them. This was pretty important in the android only world.</p>
<p><strong>TR</strong>: When I first started, Erik had already done a lot of work. I think the framework (if one can call it that) is in many ways similar to what lima and freedreno are using. I think there just aren't that many different ways to do it.</p>
<p>There are frameworks for the proper drivers (DRM, Gallium, DDX) so I've been looking at a lot of other drivers for inspiration. For the reverse-engineering parts there isn't really anything that I've reused. The envytools have already been mentioned a couple of times and I may still look at them eventually but I haven't had the time to do so yet.</p>
<p>The reverse-engineering projects have a lot of commonalities, but so far no common framework has materialized so far. I'm very new to this whole area, but I have a feeling that something common won't be easy (or even not possible at all) to write. But maybe we don't need any common framework. One of the most helpful things to have is a community of people to talk to. Everybody in the #lima channel on IRC has been very giving good advice.</p>
<blockquote><p><strong>What was the most difficult point you had to overcome since you began to work on your project?</strong></p></blockquote>
<p><strong>RC</strong>: Hmm, I think r/e'ing a gpu (or possibly, even just writing a gpu driver) is a never-ending series of most difficult points to overcome ;-)</p>
<p>There were plenty of times where I was stuck on something or other for a few days or a week. I think the only really one where I had given up and then come back to it several times was on the 2d side.. when I was trying to enable batching of multiple blits in the exa driver, I was hitting cases where I'd either get too many or two few irq's (leaving me not knowing which blits had actually finished). Which turned out to be a simple issue.. a size field in hdr for the cmdstream which was not supposed to include the size of the header.</p>
<p><strong>WL</strong>: The reverse engineering part was mostly smooth sailing. There were some more difficult derived bits, and cache flushing/synchronization is hardest to get right. I had quite some WTFs with that, and I'm still not sure it's entirely correct. There is also the "context" handling which tracks the entire state of the GPU in a big command buffer, to be restored at a later time. This is not handled yet and will certainly cause some issues when multiple processes are using the GPU at the same time. But I got to say that Vivante GPUs have a sane and well-designed hardware interface (contrary to their kernel interface,... but that's another story). Like Adreno, the shader ISA is straightforward, and shaders are unified.</p>
<p>Another recent difficult point was learning how Mesa and Gallium works. It's a huge (but well-structured) project, so it took me quite some time to get a hang of how and why CSOs are used, and the GLSL-to-TGSI-to-eventually-GPU shader compilation pipeline. I also had to revisit some bits of compiler theory along the way. Luckily the developers in their IRC channel have been really helpful.</p>
<p>The biggest difficulty is remaining focused in this modern age full of distractions and other interesting projects. Even though I'm experienced at reverse engineering it's a lot of work for (effectively) one person. A lot of people troll about open source projects "when is this driver finally ready?!?" without understanding how much work goes into it, and that it's all unpaid.</p>
<p><strong>EF</strong>: I would say keeping up motivation. There's times where just nothing seems to make any sense, and it's hard to stay motivated then.</p>
<p><strong>CA</strong>: Well, there were a lot of difficult points... I've never found an ISA as insane as what's in the Mali 200/400, and everyone I've ever talked to who's looked at it has told me the same thing. I think the lima project was lucky to have someone like me that could focus on the crazy shader stuff while Luc went ahead and got everything else done. It would have been impossible for anyone to do this much, this fast, while having to RE both the command-stream and the shaders; instead, we had a rather nice division of labor where Luc and I could focus on totally different stuff and then put our work together where it mattered (most recently, with the Q3A demo).</p>
<p>As for the compilers, I've definitely had the most difficulty with the GP. There were a lot of difficult parts, but the code that stands out to me as the hardest to write was the scheduler. I tried to structure it as cleanly as possible, so that I could try a different approach later while changing as little code as possible, but I think that plan was dashed as I began to comprehend the number of corner cases, complications, etc. Of course, it ended up being very difficult to write, and to this day I'm surprised that it works as well as it does - in all the (admittedly simple) shaders I've compiled, it seems to have performed as well as or better than the scheduler in the binary compiler. Hopefully, it'll continue to perform that well with more complex shaders and I won't have to dive into that code again :).</p>
<p><strong>LV</strong>: Android and the lack of LD_PRELOAD was a pretty big hurdle. Time, and not staying focused is probably the other. Plus, the Mali-200/400 is not the easiest chip, but once it runs, it's fast and you do not have to play around much to optimize things further.</p>
<p><strong>MG</strong>: As all we have right now to trace and reverse engineer hardware initialization is a small and buggy emulator, we keep hitting emulator limitations and annoying timing issues - up to a point where the software just is not able to initialize the hardware anymore because everything is running so slow. We don't have a solution for that either...</p>
<blockquote><p><strong>Luc, it's not the first time you mention or use Quake 3 to show your result. Is there a technical reason for this choice?</strong></p></blockquote>
<p><strong>WL</strong>: I think because Doom3 is still too heavy for ARM-based devices and embedded GPUs :-)</p>
<p><strong>LV</strong>: For several very good reasons.</p>
<p>First off, the process of reverse engineering a graphics driver is understanding job submission and wrapping things fully, so that you can see things changing in the command stream, submission order, and the rendered result. You then take very simple tests, and re-implement them in open source software, and then gradually bump functionality until you have figured out most things of the hardware. Only then, in my view, can you move to writing a real driver.</p>
<p>Q3A<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-20" id="rev-pnote-279-20">20</a>]</sup> was just the next step after supporting multiple textures and multiple programs and multiple frames. It finally was a real world program where the tests were not written by an openGLES newbie with very specific functionality in mind. It's actually a program people use.</p>
<p>Q3A is a 1999 game which has been open sourced by idtech<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-21" id="rev-pnote-279-21">21</a>]</sup>. It has built in benchmarking, and its timedemo has been a well known benchmark for 14 years. It also makes for a nice little demo and a nice crowdpleaser.</p>
<p>Q3A was ported to openGLESv1 and therefor supported by the binary driver. There is no point working with applications which are not running on the binary driver first, because then you are no longer reverse engineering a graphics driver, you are porting an application, or worse, a whole game engine.</p>
<p>By having to depend on the binary shader still, i rather liked the fact that Q3A was written for fixed function engines, and only needed a few very simple shaders to run with.</p>
<p>Q3A was also doing many things that i never had to deal with before. All sorts of parameters influencing rendering had to be set all of a sudden. I had to fix up job scheduling to get performance up, as i finally had a benchmark to go measure some things (in the first approximation). Then, and this was quite lucky, since Q3A is a GLESv1 program, made for fixed function engines, the mali binaries were doing a few things which i would've never discovered when using GLESv2 applications.</p>
<p>All in all, Q3A, while it might seem old and boring to some, was the perfect target, and the absolutely correct next step for the lima reverse engineering. And this is part of reverse engineering is about: pick a target, and figure out the steps in between. Pick your target too ambitious, and you'll get lost in the swamp.</p>
<p>While Doom3 has been open sourced in the meantime, no-one has managed to make a correct openGLESv2 port of it. Oliver sadly left us<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-22" id="rev-pnote-279-22">22</a>]</sup> before he could finish it, a great loss for us all. Doom3 would run a lot slower on our hardware, but since Q3A runs fully fragment shader bound on mali, it barely uses any vertex shader time. If Doom3 has 5x the vertex shader load, and 2x fragment shader load, it will run acceptably on the mali-400. It would've been a nice next target, but we would learn a lot less from it, but the amount of work needed would be less as well.</p>
<p>So those people who roll their eyes at Q3A and who wonder why i would spend time on porting and supporting such an old game, they simply do not know any better. They have not approached this from a reverse engineers point of view, nor faced the facts and realities of existing GLES support. Q3A was the perfect mistress for me and the lima project.</p>
<blockquote><p><strong>Rob, freedreno is the first of this new crop of SoC GPU driver to made its way in mesa/gallium. Yet development went public only one year ago (first commit on March the 24th, 2012). How did you achieve so much, so fast?</strong></p></blockquote>
<p><strong>RC</strong>: Well, I guess I got a bit lucky on a few counts.</p>
<ol>
<li>context save/restore code in kernel, and similarities to r600 in some places helped early on to get an understanding</li>
<li>unified shader ISA, so didn't have to figure out two different instruction sets for vertex and frag shaders.</li>
<li>the a2xx has shader ISA has a very simple instruction encoding, with a single format for all ALU instructions. (Plus two FETCH instruction formats, and handful of CF instructions.) And nothing like the crazy of mali.</li>
</ol>
<p>fwiw, a3xx has a new, slightly more crazy ISA, which I now have a disassembler for.. and also in the early stages figuring out the a3xx registers, since they shuffled everything around compared to a2xx.</p>
<p><strong>LV</strong>: Rob is a highly clued and amazingly dedicated and focused graphics driver developer. His fast progress is mostly explained by that.</p>
<p>On the other hand, now that there are 3 other projects working with sane graphics drivers/hardware, and it seems like we lima guys picked the most complicated target. For what Rob managed to do in about 2000 lines of fdre, i needed about 5000 on limare. Since i did not want to be too encumbered by Mesa while figuring things out properly, i have implemented things a lot further in the prototype driver before thinking about going into mesa. Now i topped 10kloc in limare, but i am still not doing any superfluous work for supporting Q3A.</p>
<blockquote><p><strong>I know that Wladimir is actively working on a gallium driver. Is there any other on their way?</strong></p></blockquote>
<p><strong>WL</strong>: In my latest commits, the shader compiler is generating code from TGSI. I'm pretty close now. All the parts are there*. (some assembly required*)</p>
<p>Just kidding though, after the GL binding the real work only starts. Debugging, optimizing, profiling etc.</p>
<p><strong>EF</strong>: No code yet, but we're looking into it. So far it looks quite possible to do, so... Let's hope it's not so far away.</p>
<p><em>[editor note: update]</em><sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-23" id="rev-pnote-279-23">23</a>]</sup> In the time since I wrote this, the situation has changed a bit (as Thierry said in his respose)<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-24" id="rev-pnote-279-24">24</a>]</sup>. The Gallium driver is also slightly more capable than what Thierry said; it can currently clear the screen. That's not a very capable driver, but at least it's the first steps.</p>
<p><strong>CA</strong>: Be patient! It's been on my todo list to start working on Gallium for a long time, and recently I've been talking to some of the Mesa/Gallium developers about it. The thing is, I think we could write a simple, direct translation pretty easily, but taking advantage of some more advanced features of the hardware (especially varying/uniform packing<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-25" id="rev-pnote-279-25">25</a>]</sup>), as well as supporting the binary compiler as a backend for comparison/optimization purposes, might require some more changes to the Gallium interface that are going to be somewhat harder to upstream. So I've been starting to look at the Gallium code, and trying to get my hands on some Mali hardware that can run full-fledged Linux (I may have to end up buying it for myself, if it doesn't show up...); right now, my time is more limited anyways, but hopefully I'll be able to hack on it more once it arrives.</p>
<p><strong>LV</strong>: I am now cleaning up my Q3A support code, and Connor just got his OGT to generate the shaders for Q3A. We can now start looking into supporting Mesa.</p>
<p>I will not allow getting fully assimilated into gallium infrastructure. We have an easily accesible binary compiler, and we have just proven that we can have performance matching the binary driver. We have to keep the possibility of using the binary compiler, so that we can verify command stream and shaders separately, and make sure that we can deliver performance matching the binary stack, or at least figure out where mesa or gallium, or our implementation for it, is slowing us down.</p>
<p>We, very deliberately, delayed the start of our Mesa work, and we are fully aware that this will mean more work for us, as Mesa is still a 1990s monolith, with developers thinking like the borg. People have to wait longer for us to deliver something directly useful for them. But we will get them performance which generally matches the binary driver, instead of being forced to settle on 50% or so.</p>
<p><strong>TR</strong>: I've recently started to look into adding a Gallium driver for Tegra. So far I have something that can run Weston<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-26" id="rev-pnote-279-26">26</a>]</sup>, only with no output whatsoever because the driver is only stubbed-out. However it gave me some more insight into what needs to be done to make it work and what we still need to work on.</p>
<p>The next step will be to make clearing work, because we know how to do that pretty well. So I use a simple OpenGL ES test program that uses GBM and just clears the render buffer and displays it. This can be used to fill in the missing pieces of the Gallium driver. After that we can start thinking about adding 3D support, but that will require to generate shader instructions from TGSI, which we can't do yet. Erik has been making a lot of progress in that direction, so I'm pretty sure it will eventually be made to work.</p>
<p><strong>MG</strong>: Even if we knew how to enable the HDMI output (which we don't) or knew how to enable the ARM core (which we don't) or enable the 3D hardware (which we don't), we still wouldn't have any C compiler which could be used for writing the actual backend software...</p>
<blockquote><p><strong>Let's be a bit prospective. ARM-based devices took over the world (ARM says that <a href="http://www.arm.com/products/processors/index.php" hreflang="en">16 million ARM processors are sold each day</a>). Yet they're still representing a small fraction of the desktop world. [A] Do you think this will change? [B] What impact would have your work on such a change? [C] Finally, how do you envision the future of the SoC GPU market?<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-27" id="rev-pnote-279-27">27</a>]</sup></strong></p></blockquote>
<p><strong>RC</strong>: Well, in years gone by, I used to assume we'd see arm growing up into desktop/laptop, by way of the netbook. Although the netbook thing never really seemed to take off. (Which makes me a bit sad, I really just can't get into typing that much on a touchscreen or using android for anything serious, but then again I probably don't represent the average consumer.) Maybe there is another shot as the 64bit/armv8 stuff starts materializing. On the other hand, I think the market shifted, so maybe that doesn't matter anymore. For light-duty content-consumption there has been a big shift towards tablets.</p>
<p>However this plays out, in the end I think we will see more SoC devices. And I think it is important that open source community developed graphics and "desktop" stack is able to run on these devices if we ever want to bring proper linux to the mainstream. It will be an interesting journey for folks used to the desktop world where everything is pretty well standardized, compared to tablets/phones where still for the most part every device (or at least every vendor) has their own kernel branch. Although hopefully this will improve over time with the arm cleanup and kernel consolidation work going on, and with more of the SoC vendors caring about upstream. What nvidia is doing w/ tegra drm/kms driver is a great example... I hope more vendors follow their lead.</p>
<p>As far as the future.. well, I have no crystal ball. What I can say is that over the last few generations of SoC, the GPU has been taking up a larger and larger percentage of the area of the chip. I'm not sure where it will peak out, but if the display resolutions keep going up, then that is more pixels to push. And because the GPU is becoming worth more of the total cost of the SoC, it is going to be competitive between the independent IP vendors (IMG/vivante/arm).</p>
<p>On the SoC side, it costs a great deal of money to produce a SoC, and time to market is everything in the mobile space... If you are late to market with your generation N+1 SoC, then you can kiss that investment goodbye. This is why we've already seen some consolidation in the mobile market, and I expect we will see more. Which will leave IMG/vivante/arm fighting for a smaller # of customers. If Apple ever decides to develop their own GPU, then IMG<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-28" id="rev-pnote-279-28">28</a>]</sup> (at least the GPU end of their business) is in some real trouble. Vivante seems to have a nice little niche with freescale and marvell who seem to focus more on the slower paced industrial and automotive markets.</p>
<p><strong>WL</strong>: <em>[editor note: Wladimir broke his answer in three parts - each part below relates to the corresponding sub-question.]</em></p>
<p><em>[A]</em> People are very bad at prediction. It's often the black swan events that eventually determine the big outcomes. So here is my try, warning: handwaving ahead.</p>
<p>The attraction of ARM is mostly low power usage and low prices. My feeling is a lot of buyers of desktops don't care about that much, at least at the moment. As long as you still see adverts for gaming PCs with 800W power supplies, and expensive, noisy, GPU cards, I think x86 is a good fit for that. Additionally, Intel and AMD have excellent single-threaded performance, which is important for the still mostly non-parallellized, inefficient software that usually runs on it :-)</p>
<p>For laptops I do see an ARM market growing, especially for people that care about long battery usage, those that mostly use the laptop in transit, instead of as a desktop replacement. Also with the continuing economic troubles consumers have less to spend and there's a big low-end segment where ARM will likely get a foothold. On price, Intel cannot compete with SoCs such as i.MX6.</p>
<p><em>[B]</em> That's very hard to say. I hope my work will help people that are tinkering with SoCs, using them to build useful or creative things. At least one person is building a <a href="http://www.bunniestudios.com/blog/?p=2686" hreflang="en">laptop based on i.MX6 SoC</a><sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-29" id="rev-pnote-279-29">29</a>]</sup>, and it's already possible to use a Cubox or GK802 HDMI stick as a sort-of desktop (and my driver could help there). But impact on the desktop market? nah...</p>
<p><em>[C]</em> GPUs become general-purpose parallel coprocessors. This has already been happening for a long time, this trend will continue in the embedded space. It will happen because there are many reasons for fast parallel computing on modern embedded devices (for example computer vision tasks in robotics) and they only sometimes involve rendering.</p>
<p>Additionally there is a growing demand by developers for more control and programmability to implement radically different custom rendering. As an example, to do 'race the beam' rendering for low latency applications in augmented reality, see <a href="http://blogs.valvesoftware.com/abrash/latency-the-sine-qua-non-of-ar-and-vr/" hreflang="en">Latency – the sine qua non of AR and VR</a><sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-30" id="rev-pnote-279-30">30</a>]</sup>.</p>
<p><strong>TR</strong>: Most ARM SoCs target the mobile, automotive or embedded market, so it's not surprising that not many desktops come with the technology. However more and more SoCs are starting to provide interfaces that would make the chips more useful for desktop usage. There are quite a few vendors that add PCIe or SATA controllers, which makes for some nice use-cases. One such project is <a href="http://www.nvidia.com/object/seco-dev-kit.html" hreflang="en">CARMA</a><sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-31" id="rev-pnote-279-31">31</a>]</sup>. While this isn't strictly a desktop type of machine, it certainly provides a lot of the peripherals that you'd expect from one. <a href="http://en.wikipedia.org/wiki/Supercomputer" hreflang="en">HPC</a> is a market where ARM is very interesting and some interesting projects use these low-power SoCs to build large clusters. There are also companies like Calxeda, which provide servers based on ARM technology<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#pnote-279-32" id="rev-pnote-279-32">32</a>]</sup>.</p>
<p>On the other hand the traditional makers of desktop CPUs are starting to invest into the embedded market as well. Intel has been doing this for a long time and they are almost reaching competitive performance-per-watt now. Both camps have broken out of their traditional markets and are now competing on both fronts.</p>
<p>Both embedded and desktop have also been converging for some time. SoCs now come with high-performance GPUs, while desktop CPUs and GPUs at the same time need less and less power for the same performance. I don't think either one will eventually die out, but the differences certainly become smaller. The embedded and mobile markets will no doubt grow over the next years, but the need for high-performance desktop PCs will not go away. There are some things you just can't do on a mobile device. Reverse-engineering GPUs for instance.</p>
<p>I don't think my work will have much of an influence on those future developments at all, though. My hope is that eventually more vendors will start to provide open-source drivers from the start, because I think that everybody wins that way. If I can contribute in some small way to make this happen, that would be great.</p>
<p><strong>EF</strong>: I'm more of a techie than a visionary, so I'll keep my answer short.</p>
<p>The desktop market seems to shrink while the mobile/tablet marked grows, both in size and in complexity. I don't think there's any reason this shouldn't continue, so I expect to see ARM-based laptops and similar devices more and more in the future.</p>
<p>As for the other questions, I don't think I'd like to make a prediction. Time will tell ;)</p>
<p><strong>MG</strong>: Seriously, I have no idea. Until recently I always thought that the amount of legacy software would make any move away from x86 impossible, but things might have changed due to massive development in the Android world. However, by far most android software isn't usable on desktop computers either, so this certainly will take quite some time.</p>
<p><strong>LV</strong>: I think that by now, the others have covered all parts of this question, and whatever i reply would only end up repeating what was said earlier.</p>
<p>Maybe i can instead provide a soundtrack for this question instead. Google for "The Crystal Method" "Wide open" from their 2004 release "Legion of boom": "I have been informed, that it's totally wide open"</p>
<p>... And we made the future that open :)</p>
<p><em>[editor note: I googled it for you, so here is a video]</em></p>
<div class="external-media" style="margin: 1em auto; text-align: center;">
<iframe width="640" height="480" src="http://www.youtube.com/embed/yInOn0Kn3Hk?feature=oembed" frameborder="0" allowfullscreen></iframe>
<br /><a href="http://www.youtube.com/watch?v=yInOn0Kn3Hk">The Crystal Method - Wide Open</a>
</div>
<div class="footnotes"><h4 class="footnotes-title">Notes</h4>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-1" id="pnote-279-1">1</a>] for those who don't know: doing plumbing in the Linux world refers to the job of setting up the necessary tools to correctly run a full Linux-based system.</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-2" id="pnote-279-2">2</a>] for the demo-curious, some of his work is available <a href="http://kusma.demoscene.no/" hreflang="en">here</a></p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-3" id="pnote-279-3">3</a>] Instruction Set Architecture</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-4" id="pnote-279-4">4</a>] i.e. the status of the whole Videocore project.</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-5" id="pnote-279-5">5</a>] see the <a href="https://github.com/felipealmeida/gcc-vc4/tree/vc4" hreflang="en">gcc/vc4</a> and the <a href="https://github.com/mm120/binutils-vc4/tree/vc4" hreflang="en">binutils/vc4</a> projects</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-6" id="pnote-279-6">6</a>] of the Vivante GPUs</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-7" id="pnote-279-7">7</a>] Thierry is working on the tegra-drm in <a href="https://gitorious.org/thierryreding/linux" hreflang="en">this git repository</a>.</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-8" id="pnote-279-8">8</a>] Connor Abbot is 16. True. For the record, he gave a speech at FOSDEM 2013. You can find all the relevant information <a href="https://fosdem.org/2013/schedule/speaker/connor_abbott/" hreflang="en">here</a></p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-9" id="pnote-279-9">9</a>] Connor's work in this particular area is to be found in <a href="https://gitorious.org/open-gpu-tools" hreflang="en">OpenGpuTools</a></p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-10" id="pnote-279-10">10</a>] Originally, this was an acronym for <em>Tungsten Graphics Shader Infrastructure</em>; at that time, Tungsten was one of the company that help support of both mesa and gallium (TGSI is an important part of gallium). Tungsten was then bought by VMWare and no longer exist (though some high profile allumini of Tungsten still work for VMWare). The acronym now stands for <em>Tokenized Gallium Shader Instructions</em> -- thanks to Connor for the tip</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-11" id="pnote-279-11">11</a>] Ben Brewer is also the creator of the <em>Open GPU Tools</em> project</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-12" id="pnote-279-12">12</a>] Intermediate Representation ; the IR is what a compiler use to represent the program it's compiling. To make things a lot simpler than they are you can view this as the result the compilation that is used by the code generator (the compiler backend) to generate the assembly code. What one call IR may depend on how one uses it. Mesa might consider TGSI as an IR, while the gallium drivers consider it as their source language. Incidentally, the same distinction applies wiith LLVM: its IR is viewed as a source code language by the compiler backend. Here is what Conor says on the subject: <em>In case it wasn't clear, TGSI is part of the Gallium3D interface; it allows various state trackers (such as Mesa for OpenGL support, the vega state tracker for OpenVG support, etc.) to pass shaders to the various Gallium3D drivers (radeon, nouveau, softpipe, llvmpipe, freedreno, etc.) in a standard format. Calling it an IR is therefore a little misleading, since it isn't designed to be operated upon internally as part of a compiler; all drivers must translate TGSI into their own internal IR (for lima, we have 3 IR's, called pp_hir, pp_lir, and gp_ir).</em>. For further information on TGSI and IR, you can read <a href="http://zrusin.blogspot.fr/2010/10/intermediate-representation-again.html" hreflang="en">this blog post by Zack Rusin</a></p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-13" id="pnote-279-13">13</a>] since you might read this article long after its publication: we're talking about year 2013.</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-14" id="pnote-279-14">14</a>] An overview of the Linux graphic stack is available <a href="http://blog.mecheye.net/2012/06/the-linux-graphics-stack/" hreflang="en">here</a></p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-15" id="pnote-279-15">15</a>] memory management unit</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-16" id="pnote-279-16">16</a>] the msm android kernel targets Qualcomm-based android devices, including the Nexus One and Nexus 4</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-17" id="pnote-279-17">17</a>] <a href="https://github.com/android/platform_bionic" hreflang="en">bionic</a> is the Android implementation of the standard C library.</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-18" id="pnote-279-18">18</a>] both #lima and #freedreno are IRC channels hosted on Freenode. You can access both channels from <a href="http://webchat.freenode.net/" hreflang="en">this web application</a></p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-19" id="pnote-279-19">19</a>] GPU driver for the "classical" NVIDIA GPU - i.e. not the GeForce ULP found on the Tegra SoC</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-20" id="pnote-279-20">20</a>] Quake 3 Arena</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-21" id="pnote-279-21">21</a>] Wikipedia has <a href="http://en.wikipedia.org/wiki/Quake_III_Arena" hreflang="en">further information on Q3A</a>.</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-22" id="pnote-279-22">22</a>] <a href="http://omcfadde.blogspot.fr/" hreflang="en">Oliver McFadden</a> passed away earlier this year (2013).</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-23" id="pnote-279-23">23</a>] as said above, the interview took a few weeks from its start to its completion.</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-24" id="pnote-279-24">24</a>] see below</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-25" id="pnote-279-25">25</a>] packing helps to reduce register use on the GPU ; you can refer to <a href="http://www.opengl.org/wiki/GLSL_Interface_Block#Memory_layout" hreflang="en">this document</a> and <a href="http://blog.emmanueldeloget.com/www.khronos.org/webgl/public-mailing-list/archives/1003/pdf7z773meQcF.pdf" hreflang="en">this book sample</a> (pdf) for further information. The book sample is taken from <a href="http://www.amazon.co.uk/gp/product/0321502795/ref=as_li_ss_tl?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=0321502795&amp;linkCode=as2&amp;tag=emmasplay02-21" hreflang="en">Open GL ES 2 Programming Guide</a>, by Mushad et Al.</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-26" id="pnote-279-26">26</a>] Weston is the reference compositor of the <a href="http://wayland.freedesktop.org/" hreflang="en">wayland</a> framework</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-27" id="pnote-279-27">27</a>] the question has been broken in three sub-questions by some of the respondents.</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-28" id="pnote-279-28">28</a>] Imagination Technology, the maker of the <a href="http://www.imgtec.com/powervr/sgx.asp" hreflang="en">SGX GPU</a> that powers Apple phones and tablets</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-29" id="pnote-279-29">29</a>] link courtesy of Wladimir</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-30" id="pnote-279-30">30</a>] link courtesy of Wladimir</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-31" id="pnote-279-31">31</a>] link courtesy of Thierry.</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#rev-pnote-279-32" id="pnote-279-32">32</a>] <a href="http://www.calxeda.com/" hreflang="en">Calxeda</a> proposes ARM-based Linux servers/clusters. They also propose a <a href="http://www.calxeda.com/technology/products/processors/ecx-1000-features/" hreflang="en">specialized ARM SoC</a> which is quite impressive (even if it does not contain any GPU).</p></div>
http://blog.emmanueldeloget.com/index.php?post/2013/03/08/The-SoC-GPU-driver-interview#comment-formhttp://blog.emmanueldeloget.com/index.php?feed/atom/comments/279Linux : suivi du kernel 3.9urn:md5:29bdf82c0fc9343f7f4f8405befd202b2013-03-09T13:00:00+01:002013-03-09T13:00:00+01:00Emmanuel DelogetOpen SourceARMExynoskernellinuxOMAPOpen SourceSoC<p>La fenêtre de fusion (oh, que c'est barbare en Français) pour la version 3.9 de Linux est maintenant fermée. Cette fermeture indique que, sauf cas exceptionnel, aucune nouvelle fonctionnalité ne sera ajoutée dans le noyau Linux - seuls des corrections de bug seront maintenant acceptées. De fait, on peut dès maintenant tracer le contour de la future version.</p>
<p>Bien entendu, ce n'est ici qu'un aperçu - biaisé qui plus est. Vous y trouverez principalement des informations sur les sujets qui sont d'importance pour moi.</p> <h3>Coté ARM</h3>
<p>Encore une fois, ce kernel contient de nombreuses modifications concernant les architectures ARM. D'une part, le travail de redesign de l'architecture avance à grand pas (pour ceux qui l'ont oublié, le but de ce redesign est au final de ne proposer qu'un seul binaire pour tous les processeurs ARM. Ce n'est à l'heure actuelle pas encore tout à fait le cas, même si il est déjà possible d'avoir le support de plusieurs SoCs dans le même kernel). D'autre part, de plus en plus de constructeurs poussent pour que leurs plateformes soient complètement reconnues par le kernel upstream.</p>
<h4>Support des plateformes de développement Armada XP</h4>
<p><a href="http://www.marvell.com/embedded-processors/armada-xp/" hreflang="en">Ce SoC Marvell</a> est un processeur ARM orienté réseau. Il cible principalement les serveurs d'application, le cloud et (dans une moindre mesure) les serveurs NAS. Dans sa déclinaison la plus puissante, il propose 4 coeurs cadencés à 1,6 Ghz, 4 ports 1000-BaseT full duplex, et de nombreuses options pour le lien avec le stockage (SATA, PCI-e...). On le retrouve <a href="http://www.datacenterknowledge.com/archives/2013/02/28/baidu-deploys-marvell-arm-based-server/" hreflang="en">dans les serveurs Cloud récemment déployés par le géant chinois Baidu</a>.</p>
<h4>Virtualisation</h4>
<p>Les coeurs ARM Cortex-A15 proposent un jeu d'instruction qui cible spécifiquement la virtualisation. Linux 3.9 implémente (via l'hyperviseur KVM) ce jeu d'instruction pour offrir cette fonctionnalité sur l'architecture ARM. Concrètement, ça signifie que les serveurs Cloud (grands adeptes de la virtualisation) peuvent maintenant se passer de processeurs Intel gourmands. On devrait voir sous peu se développer une offre de serveurs d'application accessible pour entreprise.</p>
<p>Le futur kernel 3.9 intègre aussi une plateforme "dummy ARM", qui sert de pseudo-plateforme minimale pour la virtualisation.</p>
<h4>Driver DRM</h4>
<p>Le driver DRM OMAP est sorti de staging pour intégrer le kernel standard. L'interface vers ce driver est donc considérée comme stable et son code est jugé satisfaisant en termes de fonctionnalités et de qualité. C'est une bonne nouvelle pour les propriétaires de Pandaboard.</p>
<p>Coté Exynos, il y a eu un bon nombre de correction de bugs et d'ajout de fonctionnalités (par exemple, la découverte automatique des résolutions HDMI - en lieu et place de configurations forcées, ce qui manque de souplesse).</p>
<h3>Autres points intéressants</h3>
<p>Pour finir, une liste de points intéressants concernant différents sujets.</p>
<h4>Coté réseau</h4>
<p>Il y a plusieurs avancées importantes coté réseau&nbsp;:</p>
<ul>
<li>Le support des namespace réseau a été étendu à NFS. Il est maintenant possible de créer des serveurs NFS contenus dans un namespace réseau.</li>
<li>Netpoll support maintenant IPv6 (netpoll est utilisé notamment pour implémenter les consoles réseau)</li>
<li>un certain nombre de vieux drivers réseau ont été supprimés du kernel (ce sont pour la plupart des drivers de cartes 10-BaseT obsolètes datant des années 80).</li>
<li>Le support de 802.1ak (<em>Multiple VLAN Registration Protocol</em>, <em>MVRP</em>) a été ajouté dans le kernel. Ce support permet l'autoconfiguration des VLAN sur un switch compatible.</li>
<li>l'option socket SO_REUSEPORT a été intégré en TCP et UDP. Elle permet à plusieurs socket en écoute de se binder au même port.</li>
</ul>
<h4>En vrac</h4>
<ul>
<li>Les drivers Nouveau et Radeon ont encore une fois bien progressé.</li>
<li>Le système de fichier brtfs propose maintenant le support RAID5 et RAID6.</li>
<li>Les headers du kernel continuent d'être "désintégrés" (c'est à dire coupés en deux parties distinctes&nbsp;: une partie kernel et une partie user). Les headers "user" sont maintenant disponibles dans un répertoire <em>uapi</em>.</li>
</ul>http://blog.emmanueldeloget.com/index.php?post/2013/03/05/Linux-%3A-suivi-du-kernel-3.9#comment-formhttp://blog.emmanueldeloget.com/index.php?feed/atom/comments/277Linux : suivi du kernel 3.8urn:md5:8484d27885839152dfaa5606ec8c14342013-02-19T12:30:00+01:002013-02-19T12:30:00+01:00Emmanuel DelogetOpen SourceAarch64ARMExynosGPUkernellinuxOpen SourceSoCTegra 3<p><img src="http://blog.emmanueldeloget.com/public/logos/.linux-logo_t.jpg" alt="Logo Linux" style="float:left; margin: 0 1em 1em 0;" title="Logo Linux, fév. 2013" /></p>
<p>Le kernel Linux 3.8 est enfin sorti, après moult -rc et un cycle de release décalé vers le milieu de semaine. Au menu, pas mal de nouveautés qui ont un intérêt fort pour les plateformes embarquées - et principalement ARM.</p> <h3>Support des namespace user</h3>
<p>Le support des namespace user est complètement implémenté. Dans linux, les namespace permettent de créer simplement des conteneurs qui vont avoir (par exemple) leur propre vision du système de fichier, du réseau ou bien encore de la liste des processus actifs. Théoriquement, utilisé en conjonction avec cgroups, les namespaces permettent de proposer une solution simple de pseudo-virtualisation (vous pouvez imaginer N serveurs web, ne communiquant pas ensemble, et fonctionnant tous sur un seul et unique kernel). D'autres applications sont possibles (sandboxing...).</p>
<p>Les namespace user permettent de créer un espace virtuel où l'utilisateur actuel devient l'administrateur du sous-système. Il ne peut pas prétendre avoir les droits root sur toute la machine, mais pour tout ce qui se passe dans l'espace de nom il sera considéré comme root (ou comme un autre utilisateur). Un tel namespace permet par exemple d'implémenter aisément un pseudo-chroot.</p>
<h3>Extension du contrôlleur de mémoire</h3>
<p>Les cgroups mémoire (memcg) ont été étendu pour permettre le contrôle de la pile et des allocations. Cette évolution ouvre de nouvelles possibilités tant dans le domaine de la maîtrise du système (détection et contrôle des fork bomb) que dans d'autres domaines plus ésotériques - par exemple le test&nbsp;: la possibilité de contrôler la taille de pile et la taille des allocations que peut faire un programme dans un memcg permet de tester sa résistance à ces contraintes - malloc() peut enfin retourner NULL&nbsp;! :)</p>
<h3>Evolutions coté ARM</h3>
<h4>Support de l'Exynos 5440</h4>
<p>Ce processeur devrait sortir en 2013. Il s'agit d'un SoC ARM quadcore (Cortex A15) cadencé à 1.7 Ghz et pourvu d'un GPU MALI T604, gravé en 28 nm. Le support intégré au kernel est basique et devrait permettre de le faire booter et d'accéder aux UART.</p>
<p>Il n'y a pas encore de produits prévus avec ce processeur. Ceci dit, les gentils développeurs de <a href="http://www.hardkernel.com/" hreflang="en">hardKernel</a> doivent certainement avoir quelque chose dans les cartons...</p>
<h4>Support des processeurs AllWinner</h4>
<p>Ces processeurs sont peu connus et peu utilisés en europe ou aux Etats Unis, mais il s'agit d'une gamme complète de processeurs chinnois very low cost, principalement créés pour supporter les développements de tablettes et smartphone alliant une puissance acceptable à un faible (voire très faible) coût<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/02/19/Linux-%3A-suivi-du-kernel-3.8#pnote-265-1" id="rev-pnote-265-1">1</a>]</sup>.</p>
<p>Le kernel 3.8 ajoute un support minimal pour les version A10 et A13 de ces processeurs.</p>
<h4>Meilleur support Aarch64</h4>
<p>Derrière ce nom barbare se cache le support officiel de l'architecture ARM 64 bits. Ce support, intégré récemment, est étendu dans la nouvelle version du kernel Linux.</p>
<p>A noter que les processeurs de cette génération ne sont pas attendu avant (prédiction personnelle) le second trimestre 2014<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/02/19/Linux-%3A-suivi-du-kernel-3.8#pnote-265-2" id="rev-pnote-265-2">2</a>]</sup></p>
<h3>Evolutions coté GPU</h3>
<p>Au niveau des GPU, cette nouvelle version du kernel apporte pas mal de nouveautés&nbsp;:</p>
<ul>
<li>support HDMI pour le gma600 (rebranding Intel d'un GPU PowerVR)</li>
<li>ajout du support Tegra20 et Tegra30</li>
<li>support HDMI pour les GPU Tegra</li>
<li>support IPP amélioré pour les processeurs Exynos<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/02/19/Linux-%3A-suivi-du-kernel-3.8#pnote-265-3" id="rev-pnote-265-3">3</a>]</sup></li>
</ul>
<p>Dans une moindre mesure, le driver Nouveau (NVIDIA GeForce) supporte maintenant les opérations 3D pour tous les GPU NVIDIA - ce n'est pas nécessairement intéressant coté embarqué, mais il faut se rappeler que les GPU intégrés aux processeurs Tegra sont à la base des GPU GeForce. Il y a fort à parier que ces avancées dans le domaine du desktop vont avoir un effet coté embedded.</p>
<h3>Autres points intéressants</h3>
<p>Le kernel 3.8 supporte des devices d'entrée utilisateurs utilisant le protocole Windows 8. Dans l'idée, ça permettra a terme d'utiliser Linux sur les systèmes où Windows 8 est préinstallé et sur lesquels les systèmes d'entrée utilisateur sont certifiés et signés par Microsoft au niveau firmware. Sont par exemple concernés à l'heure actuelle les écrans tactiles des tablettes Surface.</p>
<p>Le support de dma_buf dans les drivers Video 4 Linux permet de partager les buffers DMA entre le GPU et le décodeur/encodeur vidéo hardware. On devrait obtenir de meilleures performances dans les mois à venir (le temps que les lecteurs vidéo se mettent à la page).</p>
<p>Il va être possible dans peu de temps de démarrer ou arrêter un processeur (CPU hotplug). Les premiers pas sont fait dans le domaine de x86, mais les autres architectures devraient pouvoir suivre. En ligne de mire&nbsp;: la possibilité de rajouter une capacité de calcul supplémentaire à chaud (utile par exemple pour les serveurs à faible tolérance aux pannes). Dans le domaine de l'embarqué, ça permettrait d'avoir un CPU qu'on peut démarrer et arrêter sur demande, de manière à profiter d'une grosse capacité de calcul supplémentaire ou au contraire à limiter la consommation électrique. C'est intéressant dans le domaine des TV connectées, des smartphone...</p>
<div class="footnotes"><h4>Notes</h4>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/02/19/Linux-%3A-suivi-du-kernel-3.8#rev-pnote-265-1" id="pnote-265-1">1</a>] exemple de produit basé sur un processeur AllWinner A10 : <a href="http://www.alibaba.com/product-gs/609510476/7_inch_Allwinner_A10_1_2GHz.html" hreflang="en">une tablette 7'' avec écran capacitif à 30$ en volume</a></p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/02/19/Linux-%3A-suivi-du-kernel-3.8#rev-pnote-265-2" id="pnote-265-2">2</a>] c'est vraiment un prédiction toute personnelle. L'architecture AArch64 vient d'être fournie aux fondeurs, qui ne l'ont pas encore tous intégré à leur roadmap. Cette année, c'est le règne des coeurs Cortex A15 avec support de l'architecture big.LITTLE (Tegra 4, Exynos 5 Octa...). C'est une année de proposition technologique. L'année prochaine pourrait être aussi forte comme elle pourrait se transformer en année de transition technologique (avec l'abandon progressif des Cortex A9 en faveur des Cortex A15+Cortex A7 en big.LITTLE). Si bien que l'arrivée de l'architecture 64 bit pourrait même être repoussée en 2015.</p>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/02/19/Linux-%3A-suivi-du-kernel-3.8#rev-pnote-265-3" id="pnote-265-3">3</a>] IPP est un canal de communication entre le GPU et un chipset graphique dédié (par exemple un contrôlleur caméra ou un décodeur h.264 hardware)</p></div>
http://blog.emmanueldeloget.com/index.php?post/2013/02/19/Linux-%3A-suivi-du-kernel-3.8#comment-formhttp://blog.emmanueldeloget.com/index.php?feed/atom/comments/265Open source drivers for SoC GPUsurn:md5:382033c29f2ba20869e8b92da96e8d762013-01-12T10:00:00+01:002013-02-07T11:14:23+01:00Emmanuel DelogetOpen SourceExynosGPUlinuxMedia CenterO-DROIDOpen SourceOUYAPandaboardRapsberry PiSoCTegra 3<p>More and more ARM SoCs are targetted by OSS developpers in order to free their GPU from proprietary blobs. While the current free drivers are not fully functionnal, their development pace is quit fast and most of them should already be labeled "worth a look".</p>
<p>Let's dive in this world for a short while...</p> <h3>Known GPUs and drivers for ARM SoCs</h3>
<p>The ARM SoC world is full of GPUs which are unknown to the public. They emmerge because of the success of the current generation of mobile platform. Let's cite a few to begin with :</p>
<ul>
<li>SGX 5xx series, by Imagination : used within the OMAP4 line of processors as well as in other products (including some Intel APUs). No spec, no driver source, binary blob only. The same goes for other Imagination GPU - including the recent 543 MP4+ (PS Vita). No good news for the 6xx series. Texas Instrument was trying to negotiate with Imagination to release some source code but that discussion most likely failed (TI annouced they will not make any other CPU, meaning that Imagination has no incentive to free their source code).</li>
</ul>
<ul>
<li>VideoCore, by Broadcom : used (for example) by the Rapsberry Pi. An <a href="http://lwn.net/Articles/520930/" hreflang="en">earlier announce</a> said that the Rapsberry Pi foundation released a source version of the driver. This is not exactly true: the whole 3D logic is still hidden in closed binaries.</li>
</ul>
<ul>
<li>GeForce ULP, by NVIDIA : this GPU can be found in the Tegra line of SoCs. NVIDIA didn't release any source version of the driver but Erik Faye-Lund is doing a reverse engineering of the existing binary driver. So far, the results are good. <a href="https://github.com/kusma/tegra-re" hreflang="en">See github</a>.</li>
</ul>
<ul>
<li>MALI, by ARM : MALI cores are found in a large number of SoCs, including the Exynos 4 line by Samsung. This is a powerfull GPU and while ARM haven't released any source version of the driver, it has been reverse engineered and works quite well (nearly full 3D support with OpenGL ES 2.0 shaders). The open source driver has been code-named <a href="http://limadriver.org/" hreflang="en">Limadriver</a>. It's not yet production ready but it can probably be used on several baord - including the ODROID-U2.</li>
</ul>
<ul>
<li>Adreno, by Qualcomm : this GPU is found in the Snapdragon line of product. The vendor distributes binary blobs but Rob Clark (from TI) works on a reverse engineered open source version of the driver - named <a href="http://freedreno.github.com/" hreflang="en">freedreno</a>. The Adreno is based upon the Radeon architecture (hence the name, which is an anagram of Radeon).</li>
</ul>
<ul>
<li>Vivante, by Vivante Corp : the GPU is widely available. You can (for example) find them on a large number of Marvell SoCs. Again, Vivante Corp released a source version of the driver - and the community (lead by Wladimir J. van der Laan) is studying this. <a href="https://github.com/laanwj/etna_viv" hreflang="en">See github</a>.</li>
</ul>
<p>I migh have missed a few esoteric GPU here and there. Some of the listed drivers are restricted to only one SoC vendor (NVIDIA bundles the GeForce ULP with the Tegra SoCs; Broadcom ties the VideoCore GPUs with their own SoCs - both ARM and MIPS; Adreno is own by Qualcomm following the sell of the product line by ATI a few years ago). Others are sold to CPU founders as an IP block.</p>
<h3>Conclusion: which GPU should I choose?</h3>
<p>Assuming the question is solely based upon the availabilty of open source drivers, I would go with some Vivante GPU. The fact that the company released their GPU driver source code is of interest. The fact that the community is working hard to get these drivers to a good quality level is quite important too. The <strong>CuBox</strong> dev board uses a Marvell SoC that integrates a Vivante GPU<sup>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/01/12/Open-source-drivers-for-SoC-GPUs#pnote-256-1" id="rev-pnote-256-1">1</a>]</sup>.</p>
<p>After that, I would propose you to try any recent MALI GPU (the MALI 400 is ubuquitous in Cortex A9 processors). It's a very powerfull processor and the limadriver is in very good shape. Their is stille some work to do but the development is going fast. The <strong>ODROID-U2</strong> is using an overclocked MALI 400 GPU.</p>
<p>I would place the Adreno and the GeForce ULP on par. Their drivers are quite good - a bit lighter than the limadriver. The problem lies in the fact that these processors are not that easy to find on low cost development boards. The <strong>OUYA</strong> console will ship with a Tegra 3 and should be easily rootable so the GeForce ULP might win.</p>
<p>Finaly, I would not use any SGX or VideoCore GPU unless I have no other choice. The SGX can be found on many low-cost dev board (<strong>Pandaboard</strong>, <strong>Beagleboard</strong>), and the <strong>Rapsberry Pi</strong> is powered by a VideoCore. I would treat these as bad news since there is no free (as in speech) 2D/3D driver for them. TI releases new binary blobs for the SGX540 - these might be used on other platforms but these blobs are inherently limited (want a specific hardware+software setup? too bad...).</p>
<div class="footnotes"><h4>Note</h4>
<p>[<a href="http://blog.emmanueldeloget.com/index.php?post/2013/01/12/Open-source-drivers-for-SoC-GPUs#rev-pnote-256-1" id="pnote-256-1">1</a>] too bad I don't own one...</p></div>
http://blog.emmanueldeloget.com/index.php?post/2013/01/12/Open-source-drivers-for-SoC-GPUs#comment-formhttp://blog.emmanueldeloget.com/index.php?feed/atom/comments/256