summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuha-Pekka Heikkilä <juha-pekka.heikkila@intel.com>2013-10-21 15:56:31 -0700
committerCarl Worth <cworth@cworth.org>2013-10-21 16:51:20 -0700
commit2793d689cd1e6599403baf7e90c1db97e785c9d5 (patch)
tree3e8d698ec020f9dfef86bf3091870c16b6ea2a25
parentb797a4e2bf418b097b083ebf4cf730953ba462be (diff)
Fix corner case from AMD_performance_monitoramdperf
If between BeginPerfMonitorAMD and EndPerfMonitorAMD there is nothing causing batch buffer flushing EndPerfMonitorAMD would hit extension's internal assert. This patch fix that problem.
-rw-r--r--src/mesa/drivers/dri/i965/brw_performance_monitor.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_performance_monitor.c b/src/mesa/drivers/dri/i965/brw_performance_monitor.c
index deccd6d971..1687fd1819 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_monitor.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_monitor.c
@@ -546,6 +546,10 @@ brw_end_perf_monitor(struct gl_context *ctx,
struct brw_context *brw = brw_context(ctx);
struct brw_perf_monitor_object *monitor = brw_perf_monitor(m);
if (aggregating_counters_needed(brw, m)) {
+ if (drm_intel_bo_references(brw->batch.bo, monitor->bo)) {
+ intel_batchbuffer_flush(brw);
+ }
+
snapshot_aggregating_counters(brw, monitor->bo,
SECOND_SNAPSHOT_OFFSET_IN_BYTES);
stop_aggregating_counters(brw);