!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.

TODO:
- Confirm that HSW doesn't need this.
!UPSTREAM: WIP: i965/gs: Fix gl_PrimitiveIDIn when using SW primitive restart.

TODO:
- Write the front-end portion.  At the moment nobody is setting brw->prim_restart.sw_prim_counter.