tgsi: fixup the string of VS_WINDOW_SPACE_POSITION

Tested-by: Nick Sarnie <commendsarnex@gmail.com>
gallium/util: add a window_space option to the passthrough vertex shader

Tested-by: Nick Sarnie <commendsarnex@gmail.com>
gallium/util: add a test for TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION

Not testable by OpenGL. Required by Nine.

This is an example of how to implement a piglit-like test using gallium only.
tgsi/ureg: simplify code for declaring properties

Tested-by: Nick Sarnie <commendsarnex@gmail.com>
radeonsi: implement TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION

Required by Nine.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Tested-by: Nick Sarnie <commendsarnex@gmail.com>
gallium: remove unused pipe_viewport_state::translate[3] and scale[3]

Almost all drivers ignore them.
dri/kms: Always zero out struct drm_mode_create_dumb

The DRM_IOCTL_MODE_CREATE_DUMB (and others) IOCTL isn't very rigorously
specified, which has the effect that some kernel drivers do not consider
the .pitch and .size fields of struct drm_mode_create_dumb outputs only.
Instead they will use these as lower bounds and overwrite them only if
the values that they compute are larger than what userspace provided.

This works if and only if userspace initializes the fields explicitly to
either 0 or some meaningful value. However, if userspace just leaves the
values uninitialized and the struct drm_mode_create_dumb is allocated on
the stack for example, the driver may try to overallocate buffers.

Fortunately most userspace does zero out the structure before passing it
to the IOCTL, but there are rare exceptions. Mesa is one of them. In an
attempt to rectify this situation, kernel drivers are being updated to
not use the .pitch and .size fields as inputs. However in order to fix
the issue with older kernels, make sure that Mesa always zeros out the
structure as well.

Future IOCTLs should be more rigorously defined so that structures can
be validated and IOCTLs rejected if output fields aren't set to zero.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
pipe-loader: consolidate sources into Makefile.sources

Drop the unneeded subdir-objects.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
gallium: ship the gallium API headers

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
auxiliary: ship all files in the distribution tarball

 - Add all headers into Makefile.sources
 - Don't forget the target-helpers
 - Add the python scripts & the formats table/list (csv)
 - Temporary add vl/vl_winsys_dri.c to EXTRA_DIST until we rework the
way VL is build.
 - Add the following to EXTRA_DIST - they are included via the
generated u_indices_gen.c thus we should not add them to *SOURCES.
  indices/u_indices.c
  indices/u_unfilled_indices.c

XXX: Should we nuke gallivm/f.cpp ? It seems that no-one is using it.

v2: Rebase

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
targets: bundle all files in the tarball

We were missing a few files
 - The version scripts
 - Android & scons build scripts
 - A few headers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
freedreno: add missing headers in Makefile.sources

... or autotools will fail to pick them up for the distribution tarball.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
gallium/auxiliary: Remove GALLIVM_CPP_SOURCES

Redundant.

Should fix ttps://bugs.freedesktop.org/show_bug.cgi?id=86330
gallium/auxiliary: Fix build without LLVM.

Trivial.
draw: Fix breakage due to removal pipe_viewport_state::translate[3] and scale[3].

Unfortunately no LLVM type was generated for pipe_viewport_state -- it
was being treated as a single floating point array --, so llvmpipe (and
any driver that relies on draw/llvm) got totally busted.
draw: Make it more clear that *_jit_context points to pipe_viewport_state structures.

No change in behavior.
scons: Require glproto >= 1.4.13 for X11.

GLXBadProfileARB and X_GLXCreateContextAtrribsARB require glproto >=
1.4.13. These symbols were added in commit
d5d41112cbccd9301500e8e023be77eb9cb622cd "st/xlib: Generate errors as
specified."

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
radeonsi: Disable asynchronous DMA except for PIPE_BUFFER

Using the asynchronous DMA engine for multi-dimensional operations seems
to cause random GPU lockups for various people. While the root cause for
this might need to be fixed in the kernel, let's disable it for now.

Before re-enabling this, please make sure you can hit all newly enabled
paths in your testing, preferably with both piglit and real world apps,
and get in touch with people on the bug reports below for stability
testing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85647
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=83500
Cc: "10.3 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Grigori Goronzy <greg@chown.ath.cx>
gallium/tests: add missing arg to util_make_vertex_passthrough_shader()

Fix oversights from the "add a window_space option to the passthrough
vertex shader" patch.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
st/mesa: copy sampler_array_size field when copying instructions

The sampler_array_size field was added by "mesa/st: add support for
dynamic sampler offsets".  But the field wasn't getting copied in
the get_pixel_transfer_visitor() or get_bitmap_visitor() functions.

The count_resources() function then didn't properly compute the
glsl_to_tgsi_visitor::samplers_used bitmask.  Then, we didn't declare
all the sampler registers in st_translate_program().  Finally, we
asserted when we tried to emit a tgsi ureg src register with File =
TGSI_FILE_UNDEFINED.

Add the missing assignments and some new assertions to catch the
invalid register sooner.

Cc: "10.3, 10.4" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>