nine: Add state tracker nine for Direct3D9 (v2)

Work of Joakim Sindholt (zhasha) and Christoph Bumiller (chrisbmr).
DRI3 port done by Axel Davy (mannerov).

v2: - nine_debug.c: klass extended from 32 chars to 96 (for sure)
      pointed by glennk
    - build system improvements by Emil Velikov
    - Nine improvements by Axel Davy

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
nine: Add drirc options (v2)

Implements vblank_mode and throttling, which  allows us change default ratio
between framerate and input lag.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
Signed-off-by: Axel Davy <axel.davy@ens.fr>
nine: buildsystem improvements, convert to static/shared drivers

...and as any other target (according to configure.ac) default to
static one. Why - the shared pipe-drivers bare unstable API/ABI and
can cause additional problems.

Lots to small changes all over with most significant ones:
 - Sort and cleanup the includes
 - Use AM_CPPFLAGS for the defines
 - Add the linker garbage collector
 - Restrict the exported symbols (think llvm)
nine: Implement threadpool

DRI_PRIME setups have different issues due the lack of dma-buf fences
support in the drivers. For DRI3 DRI_PRIME, a race can appear, making
tearings visible, or worse showing older content than expected. Until
dma-buf fences are well supported (and by all drivers), an alternative
is to send the buffers to the server only when rendering has finished.
Since waiting the rendering has finished in the main thread has a
performance impact, this patch uses an additional thread to offload the
wait and the sending of the buffers to the server.

Signed-off-by: Axel Davy <axel.davy@ens.fr>
ilo: Advertise DMA-BUF
nvc0: define numbers, make code better readable

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
mesa/gallium: API settings / rasterization rules

D3D9 has different system coordinate, add neccessary infrastructure for it.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
nvc0: use API settings / rasterization rules

Implement D3D9 infrastructure inside NVC0.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
nv50,nvc0: handle TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION

Allow viewport bypass used by D3D9 applications.
nv50,nvc0: handle NULL vertex elements without fallback

This makes Gallium Nine faster.
nv50/ir/tgsi: implement TGSI_OPCODE_NRM,DP2A

Used by d3d9 st.
hack/nv50: don't emit buffer for skipped vertex elements

Grr, should forbid that and insert dummy elements in nine.
hack/nvc0: avoid fault in get_query_result if there was no begin_query
nv50: support for hackish viewport bypass
nv50,nvc0: d3d9 requires transfer stride to be aligned to 4
gallium: add blending to pipe blit

Following nouveau commit make use of these.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
nvc0: use blending to pipe blit
nvc0: NULL vertex buffers are allowed
nv50/ir/tgsi: handle TGSI_OPCODE_CND
nvc0: reset constant vertex attribute data after blit

To make wine's test_vshader_input happy.