automake: stop building i915-sw and drop explicit linking to softpipe

Unused and possibly broken. Will be completely removed in
upcomming commits.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
pipe-loader: note that we leak pipe_loader_drm_device->base->driver_name

The string is malloc'd (strdup) in loader_get_driver_for_fd().

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
pipe-loader: add pipe_loader_ops::configuration()

Required for the dri state-tracker. Will be used to retrieve
driver specific configuration parameters:
 - share_fd (dmabuf) capability
 - throttle

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
targets/pipe-loader: add driver specific drm_configuration

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
target-helpers: add a note about debug wrappers

If memory serves me right, at least one debug wrapper does
not return the base screen on failure.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
target-helpers: add dd_create_screen() helper

Will be used by gallium targets that statically link the
pipe-drivers in the final library. Provides identical
functionality to device_descriptor.create_screan.

v2:
 - Don't sw_screen_wrap the i915/svga screen.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
target-helpers: add dd_configuration(), dd_driver_name()

Add a couple of helpers to be used by the dri targets when
built with static pipe-drivers. Both functions provide
functionality required by the dri state-tracker.

With this patch ilo, nouveau and r300 gain support for
throttle dri configuration.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
automake: introduce helper variable

- gallium_pipe_loader_winsys_libs

Will be used in upcomming commits to reduce duplication
in the build.

v2: Drop the megadriver/static_target variables.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
targets: use GALLIUM_PIPE_LOADER_WINSYS_LIB_DEPS

Drop ~50 lines of buildsystem mayhem.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
configure: add HAVE_GALLIUM_STATIC_TARGETS

Will be used to control the linking mode of pipe-drivers
in gallium targets.

Keep this hardcoded to static, as the pipe-drivers bare
an unstable interface which we do not want to expose to
the normal user.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
radeon/llvm: Adapt to AMDGPU.rsq intrinsic change in LLVM 3.5

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
clover: Prevent Clang from printing number of errors and warnings to stderr.

https://bugs.freedesktop.org/show_bug.cgi?id=78581

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
clover: Don't use llvm's global context

An LLVMContext should only be accessed by a single and using the global
context was causing crashes in multi-threaded environments.  Now we use
a separate context for each compile.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
gallivm: set mcpu when initializing llvm execution engine

Previously llvm detected cpu features automatically when the execution engine
was created (based on host cpu). This is no longer the case, which meant llvm
was then not able to emit some of the intrinsics we used as we didn't specify
any sse attributes (only on avx supporting systems this was not a problem since
despite at least some llvm versions enabling it anyway we always set this
manually). So, instead of trying to figure out which MAttrs to set just set
MCPU.

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

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
clover: Optimize module serialization for vectors of fundamental types.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
clover: Calculate the serialized size of a module efficiently.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
automake: include the libdeps in the correct order

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80254
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
glsl: Rebalance expression trees that are reduction operations.

The intention of this pass was to give us better instruction scheduling
opportunities, but it unexpectedly reduced some instruction counts as
well:

total instructions in shared programs: 1666639 -> 1666073 (-0.03%)
instructions in affected programs:     54612 -> 54046 (-1.04%)
(and trades 4 SIMD16 programs in SS3)
glsl: Pass in options to do_algebraic().

Will be used in the next commit.

Reviewed-by: Eric Anholt <eric@anholt.net>
glsl: Optimize (v.x + v.y) + (v.z + v.w) into dot(v, 1.0).

Cuts five instructions out of SynMark's Gl32VSInstancing benchmark.