freedreno/ir3: standalone compiler updates for ir3test

In order to test compiler changes more easily, spit out the assembled
shader with some header information so that we can know about
inputs/outputs more easily.

See: git://people.freedesktop.org/~robclark/ir3test

In ir3test we have a big collection of tgsi shaders and reference
ir3_compiler outputs.  When making compiler changes, regenerate the
compiler outputs and feed to ir3test to compare the new vs reference
shader.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
mesa: Add ARB_clip_control.xml to automake.

Adding this makes 'make check' catch failures introduced from
within ARB_clip_control.xml earlier.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
glx: Fix make check.

This fixes https://bugs.freedesktop.org/show_bug.cgi?id=85429.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
freedreno/ir3: skip virtual outputs in standalone compiler

Kills get added to the outputs list, to ensure they get scheduled.  But
they aren't *really* outputs so skip them in the header comment block.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno: rename a couple debug flags

dscis -> noscis
dbypass -> nobypass

a bit more consistant w/ nobin, etc.  And IMO a bit more sensible names.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/ir3: always mov tex coords

Always insert extra mov's for the tex coord into the fanin.  This
simplifies things a bit, and avoids a scenario where multiple sam
instructions can have mutually exclusive input's to it's fanin, for
example:

  1: TEX OUT[0].xy, IN[0].xyxx, SAMP[0], 2D
  2: TEX OUT[0].zw, IN[0].yxxx, SAMP[0], 2D

The CP pass can always remove the mov's that are not actually needed,
so better to start out with too many mov's in the front end, than not
enough.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/ir3: consider instruction neighbors in cp

Fanin (merge) nodes require it's srcs to be "adjacent" in consecutive
scalar registers.  Keep track of instruction neighbors in copy-
propagation step and avoid eliminating mov's which would cause an
instruction to need multiple distinct left and/or right neighbors.

This lets us not fall on our face when we encounter things like:

  1: MOV TEMP[2], IN[0].xyzw
  2: TEX OUT[0].xy, TEMP[2], SAMP[0], SHADOW2D
  3: MOV TEMP[2].xy, IN[0].yxzz
  4: TEX OUT[0].zw, TEMP[2], SAMP[0], SHADOW2D
  5: END

Signed-off-by: Rob Clark <robclark@freedesktop.org>
nv50: handle inverted render conditions

This enables ARB_conditional_render_inverted.

Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
tgsi/ureg: add ureg_UARL shortcut (v2)

v2: moved in in same order as in p_shader_tokens (thanks Brian)
winsys/sw/wrapper: hook up is_displaytarget_format_supported

Gallium Nine make use of it, because we wrapping around sw screen.
gallium/auxiliary: implement sw_probe_wrapped

This is useful for resource sharing.

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
gallium/draw: support hack to disable clipping (v2)

v2: drop ifdef change, which may be send later in separate commit
gallium/auxiliary: Prefer intrinsics to handrolled atomic ops for Linux (v2)

v2: prefer intrinsics only on Linux to avoid compilation problems
    on other platforms [1].

We need this patch, because Gallium Nine use directly intrinsics.
Otherwise build fails.

[1] https://bugs.freedesktop.org/show_bug.cgi?id=30514

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
gallium/auxiliary: add inc and dec alternative with return (v2)

At this moment we use only zero or positive values.

v2: Implement it for also for Solaris, MSVC assembly
    and enable for other combinations.

Solaris use uint (which is fine for Nine) but others use int.
What to do?

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
gallium/auxiliary: add contained and rect checks (v3)

v3: thanks to Brian, improved coding style, also glennk helped spot few
things (unsigned -> int, two constify)

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
gallium/auxiliary: add dump functions for bind and transfer flags

v2: rename and add support for MSVC (thanks to Brian)

Signed-off-by: David Heidelberger <david.heidelberger@ixit.cz>
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)

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: 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>
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)