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.
ilo: create the pipeline from the builder

The pipeline needs just the builder to build commands.  It does not need CP.
ilo: handle conditional rendering in the context

Conditional rendering is not limited to draw_vbo().  Move the support to
ilo_context, and replace ilo_3d_pass_render_condition() by
ilo_skip_rendering().
ilo: clean up fallback path for primitive restart

We should be able to draw with the index buffer mapped.  That simplifies
things a lot.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
target-helpers: add inline qualifier on configuration_query()

To silence unused function warnings.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
st/xa: silence unused variable warning

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>