i965: perf: flush batchbuffers at the beginning of queries
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 25 Jul 2017 16:49:22 +0000 (17:49 +0100)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Tue, 25 Jul 2017 17:56:33 +0000 (18:56 +0100)
commit9f439ae1201cb049ffedb9b0e2d4f393fb0a761e
tree4a51a64eddd48be08bb7adf4759348b78f7a5478
parent45383d32d4fd0265a7133704cb3e6c15620177cd
i965: perf: flush batchbuffers at the beginning of queries

As Chris commented, it makes more sense to have batch buffer flushes
before the query. Usually applications like frame_retrace do a series
of queries and in that case, with flushes at the end of the queries,
we might still have the first query contained in 2 different batchs.
More generally it would be quite usual to have the query contained in
2 batch buffers because we never now what's the fill rate of the
current batch buffer.

If we move the flushing at the beginning of the queries, it's pretty
much guaranteed that queries will be contained in a single batch
buffer (unless the amount of commands is huge, but then it's only fair
to include reloading request times in the measurements).

Fixes: adafe4b733c02 ("i965: perf: minimize the chances to spread queries across batchbuffers")
Reported-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: "17.2 17.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_performance_query.c