freedreno: Fix detection of being in a blit for acc queries.
authorEric Anholt <eric@anholt.net>
Sat, 28 Mar 2020 00:23:19 +0000 (17:23 -0700)
committerMarge Bot <eric+marge@anholt.net>
Mon, 30 Mar 2020 21:35:21 +0000 (21:35 +0000)
commitd0b3ccb06076c921e60afbf0810b3b50bbce39e4
tree09d3e6b53e17fb231a16bb145921bd9663c2963b
parent57d54bcf994f2b3a963f73775a3dd756e8d96be3
freedreno: Fix detection of being in a blit for acc queries.

The batch might not have stage == FD_STAGE_BLIT set because
fd_blitter_pipe_begin was sticking the stage on some random batch (or none
at all) rather than the one that would be used in the meta operation.

What we actually wanted to be looking at was set_active_query_state(),
which is already called by util_blitter and whose state we just needed to
track.

Fixes piglit occlusion_query_meta_no_fragments.  I haven't changed
query_hw.c's stage handling to clean the rest up because I don't have a
db410c/db820c at home to iterate over the piglit tests.

Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4356>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4356>
src/gallium/drivers/freedreno/a2xx/fd2_query.c
src/gallium/drivers/freedreno/a5xx/fd5_query.c
src/gallium/drivers/freedreno/a6xx/fd6_query.c
src/gallium/drivers/freedreno/freedreno_blitter.c
src/gallium/drivers/freedreno/freedreno_context.c
src/gallium/drivers/freedreno/freedreno_context.h
src/gallium/drivers/freedreno/freedreno_query.c
src/gallium/drivers/freedreno/freedreno_query_acc.c
src/gallium/drivers/freedreno/freedreno_query_acc.h
src/gallium/drivers/freedreno/freedreno_query_hw.c