WIP: freedreno: prepare for a3xx (v3)

Split the parts that are specific to adreno a2xx series GPUs from the
parts that will be in common with a3xx, so that a3xx support can be
added more cleanly.
WIP: freedreno: add a3xx support (v3)

The adreno a3xx GPU is found in newer snapdragon devices, such as the
nexus4.  The a3xx is GLESv3 and OpenCL capable, although that is not
enabled yet in gallium.

Compared to a2xx, it introduces an entirely new unified shader ISA, and
re-shuffles all or nearly all of the registers.  The good news is that
(for the most part) the registers are more orthogonal, not combining
unrelated state in a single register.  And that there is a lot more
flexibility, so we don't need to patch and re-emit the shader like we
did on a2xx.

The shader compiler is currently quite dumb, there would be a lot of
room for improvement with an optimizing pass.  Despite that, with the
a320 in my nexus4 it seems to be ~2-3x faster compared to the a220 in my
HP touchpad.
WIP: freedreno: gmem bypass

The GPU (at least a3xx, but I think also a2xx) can render directly to
memory, bypassing tiling.  Although it can't do this if blend, depth,
and a few other features of the pipeline are enabled.  This direct
memory mode can be faster for some sorts of operations, such as simple
blits.  In particular, this significantly speeds up XA by avoiding to
pull the entire dest pixmap into GMEM, render tiles, and write it all
back out again.  This should also speed up resource copy-region and
blit.
WIP: hack for quads->tris
WIP: xa: add xa_surface_from_handle()
WIP: freedreno: add xa-freedreno target
gallium/xa: add handle type parameter to get handle

Allow to retrieve non shared handle.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
xa: export a common context flush function

First step before moving flushing inside the ddx.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
xa: fix dma copy function

pipe_transfer_map already offset the surface properly so using the offset
again with util_copy_rect might lead to read/write outside the surface.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
xa: let ddx handle flush

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
gallium/xa: move surface to ref/unref api

This make ddx life easier.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>