i965: Reserve batchbuffer space for a closing MI_REPORT_PERF_COUNT.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 22 Oct 2013 18:21:43 +0000 (11:21 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 21 Nov 2013 23:01:14 +0000 (15:01 -0800)
commit1172974ddddd785e7441d0eb68cc561b4e8d010f
treec1112f5b844d720ff6ece681ac0983dbe9efa8fa
parentfedc14a050cac9cc4501a648b9c84c62fc6e1086
i965: Reserve batchbuffer space for a closing MI_REPORT_PERF_COUNT.

In order to use the Observability Architecture effectively, we'll need
to take snapshots of the OA counters via MI_REPORT_PERF_COUNT at the
start and end of each batch.

Experimentation reveals that we need to flush before and after each
MI_REPORT_PERF_COUNT to get working values.  For simplicitly, I chose to
use intel_batchbuffer_emit_mi_flush(), which unfortunately expands to
triple pipe controls on Sandybridge.

We may want to start computing per-generation reserved batch space to
avoid the insanity of Sandybridge's PIPE_CONTROL cost.  That said, much
of this cost existed before I rewrote the query object support to use
hardware contexts, so it's at least not entirely new.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/drivers/dri/i965/intel_batchbuffer.h