summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965/brw_performance_monitor.c
diff options
context:
space:
mode:
authorKenneth Graunke <kenneth@whitecape.org>2013-11-02 19:44:49 -0700
committerKenneth Graunke <kenneth@whitecape.org>2013-11-21 15:01:14 -0800
commitb05b1eff1c974c897d99f8ae1b3cb480ee39ef67 (patch)
tree99a16cebb85b2d0381749d27f2dd8075fda64c1d /src/mesa/drivers/dri/i965/brw_performance_monitor.c
parent7329f8dd10673a474554fd881eb09d6908496e0f (diff)
downloadexternal_mesa3d-b05b1eff1c974c897d99f8ae1b3cb480ee39ef67.zip
external_mesa3d-b05b1eff1c974c897d99f8ae1b3cb480ee39ef67.tar.gz
external_mesa3d-b05b1eff1c974c897d99f8ae1b3cb480ee39ef67.tar.bz2
i965: Track the number of monitors that need OA counters.
Using the OA counters requires some per-batch work. When starting and ending a batch, it's useful to know whether any monitors are actually interested in OA data. Signed-off-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'src/mesa/drivers/dri/i965/brw_performance_monitor.c')
-rw-r--r--src/mesa/drivers/dri/i965/brw_performance_monitor.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_performance_monitor.c b/src/mesa/drivers/dri/i965/brw_performance_monitor.c
index 850dba7..1e04938 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_monitor.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_monitor.c
@@ -518,7 +518,7 @@ void
brw_dump_perf_monitors(struct brw_context *brw)
{
struct gl_context *ctx = &brw->ctx;
- DBG("Monitors:\n");
+ DBG("Monitors: (OA users = %d)\n", brw->perfmon.oa_users);
_mesa_HashWalk(ctx->PerfMonitor.Monitors, dump_perf_monitor_callback, brw);
}
@@ -588,6 +588,13 @@ gather_statistics_results(struct brw_context *brw,
/******************************************************************************/
+static bool
+monitor_needs_oa(struct brw_context *brw,
+ struct gl_perf_monitor_object *m)
+{
+ return m->ActiveGroups[OA_COUNTERS];
+}
+
/**
* Initialize a monitor to sane starting state; throw away old buffers.
*/
@@ -618,6 +625,10 @@ brw_begin_perf_monitor(struct gl_context *ctx,
reinitialize_perf_monitor(brw, monitor);
+ if (monitor_needs_oa(brw, m)) {
+ ++brw->perfmon.oa_users;
+ }
+
if (monitor_needs_statistics_registers(brw, m)) {
monitor->pipeline_stats_bo =
drm_intel_bo_alloc(brw->bufmgr, "perf. monitor stats bo", 4096, 64);
@@ -641,6 +652,10 @@ brw_end_perf_monitor(struct gl_context *ctx,
DBG("End(%d)\n", m->Name);
+ if (monitor_needs_oa(brw, m)) {
+ --brw->perfmon.oa_users;
+ }
+
if (monitor_needs_statistics_registers(brw, m)) {
/* Take ending snapshots. */
snapshot_statistics_registers(brw, monitor,