!UPSTREAM: i965/gs: Reorder triangle strip vertices on Ivy Bridge.

When rendering a triangle strip or triangle strip with adjacency, Ivy
Bridge doesn't order the input vertices of odd numbered triangles in
the way OpenGL requires.  We work around this by using the primitive
ID to detect which triangles are odd numbered, and rearrange the order
of vertices during the geometry shader prolog.

A problem with consulting the primitive ID is that if primitive
restart is in use, triangles may have opposite parity relative to the
entire draw call vs. relative to the strip.  We need to look at the
parity of the triangle relative to the strip.  Fortunately, we can
work around this by using software primitive restart in this case.

TODO:
- Confirm that HSW doesn't need this.

- Consider dropping this whole sub-series, since it still doesn't do
  the right thing in the presence of instanced rendering.
vbo: Implement new gs prim types in vbo_count_tessellated_primitives.
vbo: Make vbo_sw_primitive_restart optionally count primitives.

This will be necessary in order to get the i965 back-end to produce
the correct value of gl_PrimitiveIDIn when using software primitive
restart.
!UPSTREAM: i965/gs: Fix gl_PrimitiveIDIn when using SW primitive restart.

TODO: We really ought to set _NEW_PROGRAM_CONSTANTS only when software
primitive restart is in use.  Currently we set it for hardware
primitive restart too.