dri drivers: Link dricommon before dynamic libraries

I think libtool should be handling this for us, but the build fails for
Jordan because libdricommon (a static library, which uses expat) appears
before -lexpat on the linker command.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
intel: Fix intel_texsubimage_tiled_memcpy to skip GL_EXT_unpack_subimage case

413c49141 added an optimisation to improve the performance of teximage
under a limited set of circumstances. If GL_EXT_unpack_subimage has been
used then we we must also skip this optimisation since the optimised
codepath does not take the packing values into consideration.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
mesa: don't call TexImage driver hooks for zero-sized images

This simply avoids some failed assertions but there's no reason to
call the driver hooks for storing a tex image if its size is zero.

Note: This is a candidate for the stable branches.
i915g: Don't bind 0-length programs

Since we started doing fixups for different render target formats,
this has been an issue. Instead just don't do anything, when the
program gets emitted later it'll get the correct fixup.

Fixes a bunch of piglit tests.
mesa: don't enable glVertexPointer() when using API_OPENGLES2.

This function is only present in GLES1 and in the OpenGL compatibility
profile.

Fixes the following "make check" failure:

    [----------] 1 test from DispatchSanity_test
    [ RUN      ] DispatchSanity_test.GLES2
    Mesa warning: couldn't open libtxc_dxtn.so, software DXTn
    compression/decompression unavailable
    dispatch_sanity.cpp:122: Failure
    Value of: table[i]
       Actual: 0x4de54e
    Expected: (_glapi_proc) _mesa_generic_nop
    Which is: 0x41af72
    i = 321
    [  FAILED  ] DispatchSanity_test.GLES2 (4 ms)
    [----------] 1 test from DispatchSanity_test (4 ms total)

NOTE: This is a candidate for stable release branches.

Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Tested-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
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.
Allow #extension directives anywhere (against the spec)

After preprocessing, a certain engine's shaders look like:

   #version 120
   uniform type blah;
   #extension GL_ARB_whatever : enable

This isn't valid.  #extension directives must come before any
non-preprocessor code.  See page 10 of the GLSL 1.20.8 spec.

Allow it anyway, just to get things running for now.  This shouldn't be
necessary in a few days.

Cc: Ian Romanick <idr@freedesktop.org>
Cc: Chad Versace <chad.versace@linux.intel.com>
Output a debug message when we spill a reg
backend instrumentation and hacks
WIP: create pointer for multithread marshalling dispatch table.
WIP: Restore MarshalExec in _mesa_EndList()
Move _mesa_create_marshal_table to its own file
WIP: initial marshal table (empty)
Implement just enough dummy marshalling functions to get gl-1.0-edgeflag to pass
Prototype marshalling/unmarshalling code for glViewport()
Prototype marshalling/unmarshalling code for other calls
Create unmarshalling dispatch function
Create a dumb command queue