Etnaviv

Over the last four months, I have been working on reverse engineering the Vivante GPU present on many ARM SoCs such as the Freescale i.mx6, Marvell Dove, and Rockchip 2918 (just for fun, after a five-year hiatus from reverse engineering GPUs since decuda).

After a few months of research, figuring most of the 3D state bits and how they relate to GL state, I've recently started working on a Gallium driver.

At first this will only be a subset of the full Gallium (which I've dubbed "etna_pipe") developed and tested separately from the Mesa tree. When this is complete and bug-free enough to my taste I'll start the arduous process of integrating it into the main mesa tree. The demos in native/fb make use of this driver. These are some of the newer ones:

  • displacement - Demonstrates vertex texture fetch by performing displacement mapping on a sphere. A texture is sampled in the vertex shader to determine an offset factor along the normal.
  • mip_cube - Demonstrates mipmapped texture mapping using compressed texture formats.
  • cubemap_sphere - Demonstrates that cubemaps work by sampling a 1×1×6 texture with has a different color on every face.
  • particle_system - Demonstrates vertex shaders and point sprites by animating a simple particle system in the vertex shader and rendering an alpha-blended texture for each particle.

The driver is in a usable state for the GC600 (Marvell Dove) and GC800 (RK2918), by which I mean that it can render full screen 3D to a double-buffered frame buffer.

In the road ahead the biggest bump will be the shader compiler. To make a TGSI to native compiler, it is necessary to figure out the native shader instructions in enough detail to generate efficient and correct code. An assembler and disassembler for the native instructions are available in the tools directory.

The code can be found in the repository etna_viv on Github. See also the wiki for up to date information about progress.

Written on February 24, 2013
Tags:
Filed under