mesa: add indirect drawing buffer parameter to draw functions

Split from patch implementing ARB_draw_indirect.

v2: Const-qualify the struct gl_buffer_object *indirect argument.
v3: Fix up some more draw calls for new argument.
v4: Fix up rebase conflicts in i965.
mesa: implement GL_ARB_draw_indirect and GL_ARB_multi_draw_indirect

v2:
Removed some stray extern qualifiers.

Documented use of Draw*IndirectCommand sizes.

Removed separate extension enable flag for ARB_multi_draw_indirect
since this can always be supported by looping.

Kept generation of GL_INVALID_OPERATION in display list compile.
The spec doesn't say anything about them, but all the direct drawing
commands that support instancing do the same.

v3:
Initialize DrawIndirectBuffer with NullBufferObj.

Only hook up the Draw functions in vtxfmt.c if API_OPENGL_CORE
instead of _mesa_is_desktop_gl.

Fix index bounds.

v4: [Chris Forbes] Rebase to master -- significant conflicts due to
vtxfmt vtable no longer containing draw functions.

Conflicts:
	src/mesa/main/bufferobj.c
	src/mesa/main/dd.h
	src/mesa/main/dlist.c
	src/mesa/vbo/vbo_exec_array.c
	src/mesa/vbo/vbo_save_api.c
mesa: add is_indirect to _mesa_prim

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: Add new defines for indirect draws

- MMIO registers for draw parameters
- New bit in 3DPRIMITIVE command to enable indirection

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: add state atom for indirect buffer

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: flag new indirect buffer in brw_try_draw_prims

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: implement indirect drawing for Gen7

Just prior to emitting the 3DPRIMITIVE command, we load each of the
indirect registers. The values loaded are either from offsets into the
current indirect BO, or constant zero if the parameter is not used for
this draw.

Enabling use of the indirect registers is done by turning on a bit in
the first dword of the 3DPRIMITIVE command itself.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
i965: Enable ARB_draw_indirect (and ARB_multi_draw_indirect) on Gen7+

.. and mark them off on the extensions list as done.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>