ilo: move GPE common functions to ilo_builder_render.h

Move 3D/media common functions to the new header.
ilo: move media functions to ilo_builder_media.h

Move functions for the media pipeline to the new header.
ilo: move 3D functions to ilo_builder_3d*.h

Move functions for the 3D pipeline to the new headers.  We artificially split
the functions into top (vertex processing) and bottom (pixel processing), to
keep the headers at reasonable sizes.
ilo: clean up 3D/media common functions

Rename ilo_builder_batch_state_base_address() to gen6_state_base_address() for
consistency and remove unused gen6_STATE_BASE_ADDRESS().  Reorder the code in
gen6_PIPE_CONTROL() a bit.  Finally, some mostly cosmetic changes.
ilo: clean up 3DPRIMITIVE functions

Add ILO_PRIM_RECTANGLES to replace the rectlist bool.
nouveau: change internal variables to avoid conflicts with macro args

Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
nouveau: avoid leaking screen on initialization fail

Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
nouveau: check for mesa context init failure

Reported by Coverity

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
ilo: derive 3-src instructions from the opcode table

One less switch statement to maintain.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
ilo: simplify src operand gathering in disassembler

Always initialize the operand array to point to src0, src1, and src2.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
ilo: trust vertex element count more

We might run into ve->count == 0 and last_velement_edgeflag == true in
gen6_3DSTATE_VERTEX_ELEMENTS() when the state tracker sets an invalid
combination of VS and VE (does not seem to happen with st/mesa).  Do not
assume ve->count is positive when last_velement_edgeflag is true.

Reported by Coverity.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
freedreno: update generated headers

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a3xx: 3d/array textures

Signed-off-by: Rob Clark <robclark@freedesktop.org>