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>
clover: Add support to mem objects for multiple destructor callbacks v2

The spec says that mem objects should maintain a stack of callbacks
not just one.

v2:
  - Remove stray printf.

Reviewed-by: Francisco Jerez <currojerez@riseup.net>

CC: "10.3" <mesa-stable@lists.freedesktop.org>
i965/fs: Remove direct fs_visitor brw_wm_prog_data dependence

Instead we store a brw_stage_prog_data pointer, and cast it to
brw_wm_prog_data for fragment shader specific code paths.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
i965/fs: Use brw_sampler_prog_key_data instead of brw_wm_prog_key::tex

This helps:
1. Reduce the need to have fs_visitor::key's type be brw_wm_prog_key*
2. Align the code to allow brw_sampler_prog_key_data to be pulled out of other
   prog_key types for different stages.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
i965/fs: Remove direct fs_visitor brw_wm_prog_key dependence

Instead we store a void pointer to the key, and cast it to
brw_wm_prog_key for fragment shader specific code paths.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
glsl: use ptrdiff_t cast to silence g++ sign warning

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
tgsi: add prolog() method to tgsi_transform_context

Called when the user can insert new decls, instructions.
This could be used in a few places in the 'draw' module.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
tgsi: fix tgsi transform's epilog callback

We want to call the caller's epilog callback when we find the TGSI
END instruction, not after it.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
draw: use tgsi transform prolog/epilog callbacks in AA point code

This simplifies the code and makes it a little easier to understand.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>