i965/gen7+: Implement fast color clear operation in blorp.
!UPSTREAM: i965/blorp: Expand clear class hierarchy to prepare for RT resolves.

The fragment shaders that to do color clears will be re-used to
perform so-called "render target resolves" (the resolves associated
with fast color clears).  To prepare for that, this patch expands the
class hierarchy for blorp params: brw_blorp_clear_params (which will
be used for both fast and slow color clears) derives from
brw_blorp_const_color_params (which will be used for all blorp
operations where the fragment shader outputs a constant color).

Some other data structures and functions were also renamed to use
"const_color" nomenclature where appropriate.

TODO: Move earlier in series.
i965/blorp: Write blorp code to do render target resolves.

This patch implements the "render target resolve" blorp operation.
This will be needed when a buffer that has experienced a fast color
clear is later used for a purpose other than as a render target
(texturing, glReadPixels, or swapped to the screen).  It resolves any
remaining deferred clear operation that was not taken care of during
normal rendering.

Fortunately not much work is necessary; all we need to do is scale
down the size of the rectangle primitive being emitted, run the
fragment shader with the "Render Target Resolve Enable" bit set, and
ensure that the fragment shader writes to the render target using the
"replicated color" message.  We already have a fragment shader that
does that (the shader that we use for fast color clears), so for
simplicity we re-use it.

I've manually verified that this blorp program has the intended effect
on the color buffer.
i965/gen7+: Ensure that color buffers are resolved when necessary.

This is parallel to the logic used to resolve depth buffers.
i965/gen7+: Ensure that front/back buffers are fast-clear resolved.

We already had code in intel_downsample_for_dri2_flush() for
downsampling front and back buffers when multisampling was in use.
This patch extends that function to perform fast color clear resolves
when necessary.

To account for the additional functionality, the function is renamed
to simply intel_resolve_for_dri2_flush().
!UPSTREAM: i965/gen7+: Allocate MCS buffers for use by fast color clears.

TODO:

- write code to ensure that color resolves happen when necessary

- write code to do fast rather than slow color clears when possible

- Create a bit to keep track of whether a resolve is necessary

- Do we need to do any extra work for window system color buffers?

- In circumstances where SwapBuffers() makes the back buffer contents
  undefined (when is this?), can we save time by doing a pre-emptive
  fast color clear?  (Seems like it would save time by avoiding
  unnecessary reads when rendering causes a cache miss) Note: a lot of
  apps probably do a glClear() as the first operation after a swap, so
  to avoid slowing down those apps, we probably would only want to do
  this if we also were able to detect redundant clears (see above).
!UPSTREAM: i965/gen7+: Support fast color clear values other than (0,0,0,0)

TODO:

- Test

- Move into earlier patches
!UPSTREAM: Temporary debugging hack to dump clear color bits
!UPSTREAM: Temporary debugging hack to print out contents of MCS buffer
!UPSTREAM: Temporary debugging hack to test RT resolves
!UPSTREAM: Stop doing pre-emptive resolves