clover: Handle NULL value for clEnqueueNDRangeKernel local_work_size

[ Francisco Jerez: Slight simplification. ]
clover: Silence narrowing conversion warnings in resource.cpp.
Use signbit() in IS_NEGATIVE and DIFFERENT_SIGNS

signbit() appears to be available everywhere (even MSVC according to
MSDN), so let's use it instead of open-coding some messy and confusing
bit twiddling macros.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54805
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Suggested-by: Ian Romanick <ian.d.romanick@intel.com>
build: substitute X11_INCLUDES variable

There are a few automake files that reference $(X11_INCLUDES) such as
src/glx/Makefile.am but configure.ac wasn't declaring the variable for
substitution. This would break builds of glx if libxcb, for example, was
installed in its own prefix since AM_CFLAGS wouldn't coincidentally
list the needed include path in that case.

Reviewed-by: Matt Turner <mattst88@gmail.com>
r600g: Set RADEON_FLUSH_KEEP_TILING_FLAGS when emitting compute cs
mesa: add signbit() macro

Reviewed-by: Matt Turner <mattst88@gmail.com>
build: remove signbit check in configure.ac

We now have a fallback macro in imports.h
This reverts part of 0f3ba405.

Reviewed-by: Matt Turner <mattst88@gmail.com>
radeon/llvm: Fix instruction encoding for r600 family GPUs

Tested-by: Michel Dänzer <michel.daenzer@amd.com>

https://bugs.freedesktop.org/show_bug.cgi?id=55217
darwin: do not create double-buffered offscreen pixel formats

http://xquartz.macosforge.org/trac/ticket/536

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
i965/blorp: Fix sRGB MSAA resolves.

Commit e2249e8c4d06a85d6389ba1689e15d7e29aa4dff (i965/blorp: Add
support for blits between SRGB and linear formats) changed blorp to
always configure surface states for in linear format (even if the
underlying surface is sRGB).  This allowed sRGB-to-linear and
linear-to-sRGB blits to occur without causing the image to be
inappropriately brightened or darkened.

However, it broke sRGB MSAA resolves, since they rely on the
destination buffer format being sRGB in order to ensure that samples
are averaged together in sRGB-correct fashion.

This patch fixes the problem by instead configuring the source buffer
to use the *same* format as the destination buffer.  This ensures that
the image won't be brightened or darkened, but preserves proper sRGB
averaging.

Fixes piglit tests "EXT_framebuffer_multisample/accuracy srgb".

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

NOTE: This is a candidate for the stable branches.
i965/vs: fix unit mismatch in base_offset.

Callers of emit_scratch_{read,write}() pass a base_offset that is
measured in bytes, but emit_scratch_{read,write}() was assuming it was
measured in multiples of a complete register.  As a result, a shader
using a scratch read/write offset greater than zero (in practice, a
shader containing more than one variable in scratch) would use too
large an offset, frequently exceeding the available scratch space.

This patch corrects the mismatch by dividing base_offset by REG_SIZE
at the beginning of emit_scratch_{read,write}().

NOTE: This is a candidate for stable release branches.
glapi/gen: Move documentation in gl_API.dtd next to ATTLISTs being documented.

This will make it easier to add more documentation in the future.
glapi/gen: Add some documentation.
enable: Create _mesa_set_framebuffer_srgb() function for use by meta ops.

GLES3 supports sRGB formats, but it does not support the
GL_FRAMEBUFFER_SRGB enable/disable flag (instead it behaves as if this
flag is always enabled).  Therefore, meta ops that need to disable
GL_FRAMEBUFFER_SRGB will need a backdoor mechanism to do so when the
API is GLES3.

We were already doing a similar thing for GL_MULTISAMPLE, which has
the same constraints.
meta: Properly save/restore GL_FRAMEBUFFER_SRGB in Meta.

Previously, meta logic was saving and restoring the value of
GL_FRAMEBUFFER_SRGB in an ad-hoc fashion.  As a result, it was not
properly disabled and/or restored for some meta operations.

This patch causes GL_FRAMEBUFFER_SRGB to be saved/restored in the
conventional way of meta-ops (using _mesa_meta_begin() and
_mesa_meta_end()).  It is now reliably saved/restored for
_mesa_meta_BlitFramebuffer, _mesa_meta_GenerateMipmap, and
decompress_texture_image, and preserved for all other meta ops.

Fixes piglit tests "ARB_framebuffer_sRGB/blit renderbuffer
{linear_to_srgb,srgb} scaled {disabled,enabled}".
gles3: Prohibit set/get of GL_FRAMEBUFFER_SRGB.

GLES 3 supports sRGB functionality, but it does not expose the
GL_FRAMEBUFFER_SRGB enable/disable bit.  Instead the implementation
is expected to behave as though that bit is always enabled.

This patch ensures that ctx->Color.sRGBEnabled (the internal variable
tracking GL_FRAMEBUFFER_SRG) is initially true in GLES 2/3 contexts,
and that it cannot be modified through the GLES 3 API.