Tuesday, July 30, 2013

freedreno update: drm/kms and ifc6410

About a month ago, I received a new ARM dev board, a IFC6410!  Which despite the boring sounding name is quite an impressive bit of kit.  About $150, quad-core krait, 2G DDR, SATA, gigabit ethernet.. and adreno a320.  It is basically the same SoC that is in the nexus4 (or the new nexus7).  But in more convenient form factor for development.

And with this board that I've been developing a new msm drm/kms driver.  For a while now, freedreno has been limping along with the msm fbdev and kgsl drivers from their android kernel tree, while I focused on the userspace gallium driver and ddx (xf86-video-freedreno).  But that was always a short-term solution.. with the qcom android drivers, I can't really handle synchronization between processes, which gets really crazy w/ x11 and compositing window manager where you have sharing in both directions (as texture and/or render target), I can't handle page flipping (let alone page flipping synchronized with the GPU), and have general robustness issues.

Unfortunately, the msm android fbdev driver code is a real mess (at least the mdp4 parts).  Even by android / vendor kernel standards, which are pretty low to begin with.  And I don't have any docs on the display controller.  In the end, I ended up instrumenting the code to trace all the register reads/writes, etc, wrote a small parser tool using envytools/librnn, and starting writing rnndb register database for the display controller registers.  It was a lot easier to get a general picture of how the hardware works that way!  Plus I can generate register level headers from rnndb in the same way I do for the gallium driver.

So, earlier in the month, I sent first round of RFC patches, with just basic KMS support.  A couple weeks ago I send the 2nd round which added a3xx gpu support and basic kmscube working.  Since then I've fixed a few things, added HW cursor support and more gpu debugfs bits to help when things go wrong.  And added kms support in xf86-video-freedreno.  And so 3rd (and hopefully final-RFC round) of patches will go out soon.  But now, time for some eye candy:

gnome-shell running on freedreno + msm drm/kms:



and, now that we have drm/kms support, we can use wayland/weston drm compositor:


so, as gnome-shell as-a wayland compositor work progresses, freedreno should be in good shape for the next generation of linux desktop :-)

-----

NOTE: If you look on the msm-drm branches in libdrm and xf86-video-freedreno trees, you'll notice that I've structured things to work on either current android drivers (with a couple small patches), or on msm drm/kms driver.  This is mainly because it is unlikely that I'll be able to support every random lcd panel on every snapdragon phone/tablet that someone might want to try out freedreno on.  Time permitting, I'll eventually add support for the LCD panels on devices I have (HP touchpad, nexus4), and support for some of the older generation adreno gpus.. although patches certainly welcome ;-)

Wednesday, June 5, 2013

fedora 19 installer for nexus4

As promised in my previous post, now there is an f19 installer for nexus4:

https://github.com/freedreno/nexus4-fedora

So if you have an n4 and a bit of free space, you can play around with accelerated open-source gpu goodness :-)

Sunday, June 2, 2013

freedreno + gnome-shell on nexus4/a320

We don't need no binary blobz :-)



gallium/freedreno + xf86-video-freedreno using XA gallium state tracker on fedora F18.  Gnome-shell, compiz, xonontic, ioquake all work.  Just need to clean up the patches for XA and freedreno a bit more before they are ready for upstream.  And hopefully in the next couple days I'll have some time to put together a sort of make-shift installer for anyone else who wants to try.

Sunday, May 19, 2013

gallium a3xx es2gears

So, I've been working on the freedreno gallium support for adreno a3xx  for the past few weeks or so, and now it is starting to take shape:



 
 The full video here.

The code is on the a3xx branch on github.. still has a ways got go before I'm ready to go upstream with it, but now we're getting into the fun bits :-)

Special thanks to Benjamin Tissoires for getting the touchscreen going for me on the nexus4.


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.








Tuesday, March 5, 2013

Fedora 18 + gnome-shell + Freedreno

After fixing a handful of bugs, and adding support (still in a slightly hacky way) for some desktop GL (1.4) features (namely, GL_QUADS), I've got gnome-shell working with freedreno:


Full video here

I've also made a sort of fedora F18 installer for the touchpad, for anyone out there who wants to give it a spin:


Note that gnome-shell itself is not installed by default in the arm fedora builds.. so, 'sudo yum install gnome-shell'

Friday, February 8, 2013

fosdem demo

Last weekend was fosdem, where I showed a few more things working on freedreno (compiz, q3a).  The recording of the talk is provided by phoronix.  Although unfortunately the mic was closer to the audience than me (and I'm not really a loud speaker), and the camera remained pointed at the projector while I was showing the demo, so you miss the exciting bits.

So I re-ran the demo and captured it with my advanced cinematic skillz, and without the backlight hickups which plagued the original demo (but had nothing to do with freedreno... have I mentioned before that drivers/video/msm is made of fail?).

Full video here.

I still need to fix support for mip-map textures (which you may have noticed in the q3a part), and there are a couple rendering bugs with the unity plugin in compiz, but at least the other compiz plugins I've tried so far seem fine.  Until now I have not put much (or really, any) focus on performance and there is definitely some low hanging fruit on the performance front.  Unfortunately some of the issues, like proper synchronization between xorg and gl/dri2 client, and flipping rather than doing fullscreen presentation blits, will I think require a proper drm kernel driver.  Although I suspect there is room for some compiler optimization and a few other things.