i965/gen6: Enable GL 3.3 and GLSL 3.30

Tested on my snb-gt2:

4 tests skip->pass in spec/EXT_texture_array
51 tests skip->pass in spec.glsl-3.30
4 tests skip->pass in spec/!OpenGL 3.3
No regressions; no skip->fail changes.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
ilo: make ilo_fence opaque

It is manipulated only in ilo_screen.c.
ilo: rename ilo_gpe_gen*.[ch]

Rename them to ilo_state_gen*.[ch].
ilo: merge ilo_gpe.h to ilo_state*.h

Move the #define's and struct's to ilo_state.h.  Move the inline functions and
function declarations to ilo_state_gen.h.
ilo: add a new struct for context states

Move pipe states in ilo_context to the new ilo_state_vector.  The motivation
is that ilo_context consists of several loosely related things.  When we need
an ilo_context somewhere, we usually need only one or two of the things in it.
This change makes ilo_state_vector one such thing.

An immediate result is that we no longer need ilo_context in 3D pipelines,
something we have planned for since early days.
ilo: fix headers in Makefile.sources
ilo: no direct ilo_context access in BLT blitter

We need ilo_builder for command building and ilo_cp for size check.
ilo_context is not used.
ilo: add a helper for RECTLIST blitter

Add ilo_3d_draw_rectlist() for use by RECTLIST blitter.
ilo: add a pointer to builder in ilo_3d_pipeline

It saves quite some typings.
ilo: clarify cp owning/releasing

Make it own()'s responsibility to make room for release() and itself.  To be
able to do that, allow ilo_cp_submit() in own().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
ilo: rework query support

This fixes some corner cases, but more importantly, the new code should be
easier to reason about.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
ilo: add ilo_3d_pipeline_emit_query()

It replaces

  ilo_3d_pipeline_emit_write_timestamp(),
  ilo_3d_pipeline_emit_write_depth_count(), and
  ilo_3d_pipeline_emit_write_statistics().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
ilo: support prim queries in ilo_3d_pipeline_emit_query()

Add support for PIPE_QUERY_PRIMITIVES_GENERATED and
PIPE_QUERY_PRIMITIVES_EMITTED in ilo_3d_pipeline_emit_query().

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
ilo: replace software queries by hardware ones

Read PIPE_QUERY_PRIMITIVES_GENERATED and PIPE_QUERY_PRIMITIVES_EMITTED from
hardware registers.  Because all queries now have a bo, remove unnecessary
checks for q->bo.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
ilo: use a single list for queries

We used different lists for different types of queries because we wanted to
update software queries quickly.  Now that there is no software queries, we
are fine with a single list.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
freedreno: add DRM_CONF_SHARE_FD

And config query and DRM_CONF_SHARE_FD to both mega-driver and
traditional build configs, so that EGL_EXT_image_dma_buf_import
works.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
freedreno/a3xx: more texture array fixes

Signed-off-by: Rob Clark <robclark@freedesktop.org>
ilo: move size estimation check out of pipeline

It can be done outside of the pipeline.  Let's move it.
ilo: flush before setting SOL_RESET

SOL_RESET happens before bo execution.  It should not be observed by the
commands that are already in the bo.

Move the code out of the pipeline now that it submits.
ilo: move aperture checks out of pipeline

They can be done outside of the pipeline.  Move them and let the pipeline
focus on building commands.