Mesa (17.1): i965: perf: minimize the chances to spread queries across batchbuffers
Andres Gomez
tanty at kemper.freedesktop.org
Fri Aug 25 20:55:28 UTC 2017
Module: Mesa
Branch: 17.1
Commit: e3e4477fedf53e9b7151d969219271d90fea4ced
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e3e4477fedf53e9b7151d969219271d90fea4ced
Author: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Date: Thu Jun 22 02:15:50 2017 +0100
i965: perf: minimize the chances to spread queries across batchbuffers
Counter related to timings will be sensitive to any delay introduced
by the software. In particular if our begin & end of performance
queries end up in different batches, time related counters will
exhibit biffer values caused by the time it takes for the kernel
driver to load new requests into the hardware.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Acked-by: Kenneth Graunke <kenneth at whitecape.org>
(cherry picked from commit adafe4b733c0242720ccfe10d391e5d44c0e7401)
---
src/mesa/drivers/dri/i965/brw_performance_query.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c
index 2f49efae00..cbb2da80c6 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_query.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_query.c
@@ -1095,6 +1095,14 @@ brw_end_perf_query(struct gl_context *ctx,
obj->oa.begin_report_id + 1);
}
+ /* We flush the batchbuffer here to minimize the chances that MI_RPC
+ * delimiting commands end up in different batchbuffers. If that's the
+ * case, the measurement will include the time it takes for the kernel
+ * scheduler to load a new request into the hardware. This is manifested
+ * in tools like frameretrace by spikes in the "GPU Core Clocks"
+ * counter.
+ */
+ intel_batchbuffer_flush(brw);
--brw->perfquery.n_active_oa_queries;
/* NB: even though the query has now ended, it can't be accumulated
More information about the mesa-commit
mailing list