diff options
author | Kenneth Graunke <[email protected]> | 2013-11-02 20:58:10 -0700 |
---|---|---|
committer | Kenneth Graunke <[email protected]> | 2013-11-21 15:01:14 -0800 |
commit | c289c70ce156e1248c53f018401a7670b9f513eb (patch) | |
tree | 002b6b408eb993ea0b0611fcb5ef76111619b576 /src/mesa/drivers/dri/i965/intel_batchbuffer.c | |
parent | 834c9575b281f72385085fc1b9adca3893c9c71e (diff) |
i965: Start and stop OA counters as necessary.
We need to start OA at the beginning of each batch where monitors are
active. OACONTROL isn't part of the hardware context, so to avoid
leaving counters enabled for other applications, we turn them off at the
end of the batch too.
We also need to start them at BeginPerfMonitor time (unless they've
already been started). We stop them when the monitor last ends as well.
Signed-off-by: Kenneth Graunke <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965/intel_batchbuffer.c')
-rw-r--r-- | src/mesa/drivers/dri/i965/intel_batchbuffer.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_batchbuffer.c b/src/mesa/drivers/dri/i965/intel_batchbuffer.c index f66c2dd193a..99608dce9af 100644 --- a/src/mesa/drivers/dri/i965/intel_batchbuffer.c +++ b/src/mesa/drivers/dri/i965/intel_batchbuffer.c @@ -187,6 +187,9 @@ intel_batchbuffer_emit_render_ring_prelude(struct brw_context *brw) * what that batch contributed. Emit state packets to write them to a BO. */ brw_emit_query_begin(brw); + + /* We may also need to enable OA counters. */ + brw_perf_monitor_new_batch(brw); } /** @@ -247,6 +250,10 @@ brw_finish_batch(struct brw_context *brw) */ brw_emit_query_end(brw); + /* We may also need to disable OA counters. */ + if (brw->batch.ring == RENDER_RING) + brw_perf_monitor_finish_batch(brw); + if (brw->curbe.curbe_bo) { drm_intel_gem_bo_unmap_gtt(brw->curbe.curbe_bo); drm_intel_bo_unreference(brw->curbe.curbe_bo); |