r300g: fix CS checker errors caused by emit_dsa_state

size is 10 on r500 and 8 on r300
r300g: fix the GPU name in the renderer string

Broken by ca474f98f2cda5cb333e9f851.
r300g: optionally log MSAA resources to stderr

Set: RADEON_DEBUG=msaa
r600g: Fix memory leak in r600_bytecode_add_vtx.

Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
intel: Move compute_msaa_layout earlier in file.

No functional change.  This patch moves the compute_msaa_layout()
function earlier in intel_mipmap_tree.c so that it can be used by
other functions in that file.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
intel: Add a force_y_tiling parameter to intel_miptree_create().

This allows intel_miptree_alloc_mcs() to force Y tiling for the MCS
buffer.  Previously we accomplished this by the hack of passing
INTEL_MSAA_LAYOUT_CMS as the msaa_layout parameter, but that parameter
is going to be going away soon.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
intel: Clean up confusion between logical and physical surface dimensions.

In most cases, the width, height, and depth of the physical surface
used by the driver to implement a texture or renderbuffer is equal to
the logical width, height, and depth exposed to the client through
functions such as glTexImage3D().  However, there are two exceptions:
cube maps (which have a physical depth of 6 but a logical depth of 1)
and multisampled renderbuffers (which have larger physical dimensions
than logical dimensions to allow multiple samples per pixel).

Previous to this patch, we accounted for the difference between
physical and logical surface dimensions at inconsistent places in the
call graph (multisampling was accounted for in
intel_miptree_create_for_renderbuffer(), and cubemaps were accounted
for in intel_miptree_create_internal()).  As a result, it wasn't
always clear, when calling a miptree creation function, whether
physical or logical dimensions were needed.  Also, we weren't
consistent about storing logical dimensions in the intel_mipmap_tree
structure (we only did so in the
intel_miptree_create_for_renderbuffer() code path, and we did not
store depth).

This patch refactors things so that intel_miptree_create_internal() is
responsible for converting logical to physical dimensions and for
storing both the physical and logical dimensions in the
intel_mipmap_tree structure.  As a result, all miptree creation
functions interpret their arguments as logical dimensions, and both
physical and logical dimensions are always available to functions that
work with intel_mipmap_trees.

In addition, it renames the fields in intel_mipmap_tree used to store
the dimensions, so that it is clear from the name whether physical or
logical dimensions are being referred to.

This should fix the following bugs:

- When creating a separate stencil surface for a depthstencil cubemap,
  we would erroneously try to convert the depth from 1 to 6 twice,
  resulting in an assertion failure.

- When creating an MCS buffer for compressed multisampling, we used
  physical dimensions instead of logical dimensions, resulting in
  wasted memory.

In addition, this should considerably simplify the implementation of
ARB_texture_multisample, because it moves the code to compute the
physical size of multisampled surfaces out of renderbuffer-only code.

Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
WIP: allow varying structs
Merge assign_locations and store_locations
Move set of varying matches into linked lists
Move struct match out of varying_matches and rename to varying_match.
Store producer-centric locations in varying_match.

This will allow a future patch to use varying_match for non-generic
varyings.
Store varying_match objects in a hashtable by producer var
Have record() return a varying_match data structure even for non-generic varyings.
Use a simpler algorithm for computing initial transform feedback array size.

Since we are likely to overestimate, realloc the array once we have
determined its true size.
Move call to store_tfeedback_info() into assign_varying_locations().

This will allow us to take advantage of the varying_match objects
(which only exist during execution of assign_varying_locations()) in
tfeedback_decl::store().
Remove tfeedback_decl::assign_location.  Instead, store the
association between tfeedback_decl and varying_match earlier in
linking, and then look up the location at the time of
tfeedback_decl::store().
Simplify the handling of gl_ClipDistanceMESA