clover: clGetProgramInfo support for OpenCL 1.2.

[ Francisco Jerez: Rework using fold() for conciseness. ]

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Tested-by: EdB <edb+mesa@sigluy.net>
clover/util: Implement minimalist reference to clover::ref_counter object.

Tested-by: EdB <edb+mesa@sigluy.net>
clover/util: Pass initial count value to ref_counter constructor.

And mark the ref_count() method as const.

Tested-by: EdB <edb+mesa@sigluy.net>
clover: Refuse to build a program if there are kernel objects attached to it.

Fixes piglit cl-api-build-program.

Tested-by: EdB <edb+mesa@sigluy.net>
docs/relnotes: document GLX_MESA_query_renderer
vc4: Fix viewport handling in the uniforms upload.

I had the right viewports in vc4_emit.c, but grabbed the wrong values in
the uniform setup, so primitives would claim to be in the wrong parts of
the screen.  (The vc4_emit.c state looks like it just decides how big the
clipping guardband is).

This gets fbo-viewport closer to working (which still has the problem that
the HW is always guard-band clipping), and fixes inverted FBO rendering in
general.
vc4: Fix multi-level texture setup.

We weren't accounting for the level 0 offset in the texture setup (so it
only worked if it happened to be a single-level texture), and doing so
required that we get the level 0 offset page aligned so that the offset
bits don't get interpreted as the texture format and such.
vc4: Don't forget to set up the offset for render targets.

This almost fixes fbo-generatemipmap rendering, except that the 1x1 level
isn't getting rendered.
vc4: Add a helper for QOP_R4_UNPACK_[ABCD].
vc4: Add support for color masking.

This gets fbo-colormask-formats working for core formats, which increases
my confidence in some of the swizzle and blend handling.
vc4: Extract the swizzle handling from vertex fetch.

I want to reuse this elsewhere, and NONE debug output hasn't been useful
so I don't miss it being as detailed as it was before.
vc4: Fix handling of non-XYZW swizzles in color outputs.

The SWIZZLE_1 of the winsys destination was dereffing off the end of the
array, which surprisingly often worked out (since nobody reads the
rendered value anyway, so whatever junk was referenced in the QIR didn't
matter), but shader dumping would sometimes segfault.
vc4: Add support for swizzling of texture colors.

Fixes swapped colors on the copypix demo and some piglit tests like
pbo-teximage-tiling .
nv50/ir: (trivial) initialize pointer to silence warning

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
mesa: fix copy and paste errors in glBindVertexBuffers

Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Fredrik Höglund <fredrik@kde.org>
i965/disasm: Add CSEL.
i965: Reverse condition ordering to let us support other gens.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965: Update JIP/UIP compaction code to operate on bytes.

JIP/UIP were previously in units of compacted instructions. On Gen8
they're in units of bytes.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
i965/gen8: Add instruction compaction tables.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
i965/gen8: Add 3-src instruction compaction tables.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>