st/mesa: fix glClear with multiple colorbuffers and different formats

Cc: 10.0 9.2 9.1 <mesa-stable@lists.freedesktop.org>
gallium: allow choosing which colorbuffers to clear

Required for glClearBuffer, which only clears one colorbuffer attachment.

Example:
   If the first colorbuffer is float and the second one is int:
      pipe->clear(pipe, PIPE_CLEAR_COLOR0, float_clear_color, ...);
      pipe->clear(pipe, PIPE_CLEAR_COLOR1, int_clear_color, ...);

This doesn't need any driver changes yet, because all drivers just use:
  if (flags & PIPE_CLEAR_COLOR) ..

The drivers which support GL 3.0 will have to implement it properly though.
st/mesa: set correct PIPE_CLEAR_COLORn flags

This also fixes the clear_with_quad function for glClearBuffer.
gallium/util: implement new color clear API in u_blitter
util: move variable declaration out of for-loop

To fix MSVC build.
util: fix compile breakage

D'oh!
swrast* (gallium, classic): add MESA_copy_sub_buffer support (v3)

This patches add MESA_copy_sub_buffer support to the dri sw loader and
then to gallium state tracker, llvmpipe, softpipe and other bits.

It reuses the dri1 driver extension interface, and it updates the swrast
loader interface for a new putimage which can take a stride.

I've tested this with gnome-shell with a cogl hacked to reenable sub copies
for llvmpipe and the one piglit test.

I could probably split this patch up as well.

v2: pass a pipe_box, to reduce the entrypoints, as per Jose's review,
add to p_screen doc comments.

v3: finish off winsys interfaces, add swrast classic support as well.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>

swrast: add support for copy_sub_buffer
docs: Import 10.0.1 release notes, add news item.
docs: Import 9.2.5 release notes, add news item.
docs: Fix typo

Simply replacing Extentions with the correct Extensions.
docs: Update note regarding nominating patches for the stable branch.

This brings the documentation up to date with the current practice of using
the CC syntax for patch nomination.
dri_util: Don't assume __DRIcontext->driverPrivate is a gl_context

The driverPrivate pointer is opaque to the driver and we can't assume
it's a struct gl_context in dri_util.c.  Instead provide a helper function
to set the struct gl_context flags from the incoming DRI context flags.

v2 (idr): Modify the other classic drivers to also use
driContextSetFlags.  I ran all the piglit GLX_ARB_create_context tests
with i965 and classic swrast without regressions.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Ilia Mirkin <imirkin@alum.mit.edu> [v1 on Gallium nouveau]
Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Makefile: Add bin/test-driver to EXTRA_FILES

I'm not sure why this change is necessary. When I've built previous tar files
(such as 9.2.4) with the "make tarballs" target, they include the
bin/test-driver file. But at my first attempt to build the tar files for the
10.0.1 release this file was not being included and the build failed.

(cherry picked from commit d573899b932435b0b37a7a33ebcbdc3c8cedd3e1)

[The cherry pick is because I original applied this on the 10.0 branch while
working on the 10.0.1 release. But if we don't have this on master as well,
this issue will trip us up again the next time we make a new major-release
branch off of master.]
mesa: Fix error code generation in glBeginConditionalRender()

This patch changes the error condition to satisfy below statement
from OpenGL 4.3 core specification:
"An INVALID_OPERATION error is generated if id is the name of a query
object with a target other SAMPLES_PASSED, ANY_SAMPLES_PASSED, or
ANY_SAMPLES_PASSED_CONSERVATIVE, or if id is the name of a query
currently in progress."

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: Add API definitions for ARB_texture_view

Stub in glTextureView API call to go with the
glTextureView API xml definition.
Includes dispatch test for glTextureView

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: Tracking for ARB_texture_view extension

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: update texture object for ARB_texture_view

Add state needed by glTextureView to the gl_texture_object.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: ARB_texture_view get parameters

Add support for ARB_texture_view get parameters:
GL_TEXTURE_VIEW_MIN_LEVEL
GL_TEXTURE_VIEW_NUM_LEVELS
GL_TEXTURE_VIEW_MIN_LAYER
GL_TEXTURE_VIEW_NUM_LAYERS

Incorporate feedback regarding when to allow query of
GL_TEXTURE_IMMUTABLE_LEVELS.

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: Add driver entry point for ARB_texture_view

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>

Reviewed-by: Brian Paul <brianp@vmware.com>
mesa: consolidate multiple next_mipmap_level_size

Refactor to make next_mipmap_level_size defined in mipmap.c a
_mesa_ helper function that can then be used by texture_view

Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com>

Reviewed-by: Brian Paul <brianp@vmware.com>