Sunday, April 14, 2013

a320, first renders

A while back, I got my shiny new nexus4 in order to start playing with the new a320 adreno gpu.  It turns out, there are some quite significant changes in the new generation, in particular new shader ISA and all the registers around shader setup.  Other registers are mostly shuffled around, with a few new registers for new features (like MRT) and a few tweaks here and there.

There is quite a lot more flexibility in the shader ISA (thank-you opencl), and some nice changes like moving vertex fetch out of the shader and a lot more flexibility in the positioning of outputs/varyings.  Although as a result there was more that needed to be figured out to setup the shader related registers compared to a2xx.

At this point, I'm working with simple "fdre-a3xx" tests.  Basically libfdre (freedreno reverse engineering) gives a very simplified gl-ish API, with shaders written in assembly, rather than full on GLSL compiler.  I've got a pretty good shader assembler/disassembler, and cmdstream parsing utilizing envytools/librnn for parsing the register values.  There is still some more work to do at the fdre level (depth, stencil, textures) before work on the gallium driver can start, but things are progressing well.








4 comments:

  1. Is there anything a mortal could do to help?
    I have access to a N4, and am willing to learn:)

    ReplyDelete
    Replies
    1. well, I think there is never a shortage of work ;-)

      Depending on your knowledge of GL(ES) and your interest in learning in that area, there are still a handful of unknown bits that are showing up in some of the tests that I have (conveniently showing up in red in the register decode in cffdump, thanks to the fancy parsing of envytools/librnn). Also, I've been meaning to do some cleanup to move parsing of the PM4 packets (other than register writes) over to librnn (I've started defining a few of the PM4 packets in adreno_pm4.xml).

      Also, there is a need of some general cleanup stuff, for example building cffdump is a bit cobbled together because of cmake build system in envytools vs simple makefile in freedreno.

      And more documentation all around in freedreno wiki could certainly be helpful for everyone, and is something that I haven't really had time for.

      At some point, I also need to figure out what the best way is for bringing up X11 and a more "traditional" linux graphics environment on the n4. Right now I'm working in a chroot on the n4, which is enough for the time being, but might start being awkward when I want to run x11+gallium. But since the n4 doesn't have an sd card slot, I'm not really sure what my best options are. I can 'stop' to kill android UI and then launch X11. Although for something like gnome-shell, I think pulseaudio/dbus/etc would need to be running, which is normally started by systemd, and not sure if there is a way to do that in a chroot. Probably on a freshly wiped phone, the system partition is empty enough that it can be backed up and repartitioned into two partitions, which would give us a linux partition to boot directly. Although that is a bit heavy handed. Maybe there are some other options that I haven't thought of.

      Anyways, feel free to join us on #freedreno (on freenode) and discuss :-)

      BR,
      -R

      Delete
  2. Hi Rob, I've read about your project on Phoronix some weeks ago and if I remember correctly, you've said you have trouble finding a proper hardware. I've found something interesting while searching on the web: http://inforcecomputing.com/product/moreinfo/ifc6410.html
    It's a development board with a Qualcomm S4 Pro and an Adreno A320. The guy in the promo video said, that they will support Android and Linux. I hope this can help you solve some of your hardware or software-related problems :)

    ReplyDelete
    Replies
    1. Hi,

      Yeah, I put my name on the pre-order list for that board a week or so ago.. it looks really nice. Hopefully SATA works well, as that should also make it a much faster system to do development on.

      BR,
      -R

      Delete