Mesa (master): i965: Fix OACONTROL assertion failures on Ironlake.
Kenneth Graunke
kwg at kemper.freedesktop.org
Wed Dec 4 00:58:56 UTC 2013
Module: Mesa
Branch: master
Commit: da07e1b6837616ef101d1374dbff322694d6a7d9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=da07e1b6837616ef101d1374dbff322694d6a7d9
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Tue Nov 26 16:32:13 2013 -0800
i965: Fix OACONTROL assertion failures on Ironlake.
I guarded half of the callers to start/stop_oa_counters with generation
checks, but missed the other half (which were added later). OACONTROL
doesn't exist on Ironlake, so we better not write it. Also, there's no
need---Ironlake's performance counters are always running.
This patch moves the generation checks into start/stop_oa_counters,
rather than requiring the caller to do them.
Fixes assertion failures in Piglit's AMD_performance_monitor/measure.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Eric Anholt <eric at anholt.net>
---
.../drivers/dri/i965/brw_performance_monitor.c | 12 ++++++++----
1 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_performance_monitor.c b/src/mesa/drivers/dri/i965/brw_performance_monitor.c
index 9bddd8e..ff3cb97 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_monitor.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_monitor.c
@@ -642,6 +642,8 @@ start_oa_counters(struct brw_context *brw)
/* Pick the counter format which gives us all the counters. */
switch (brw->gen) {
+ case 5:
+ return; /* Ironlake counters are always running. */
case 6:
counter_format = 1; /* 0b001 */
break;
@@ -667,6 +669,10 @@ start_oa_counters(struct brw_context *brw)
static void
stop_oa_counters(struct brw_context *brw)
{
+ /* Ironlake counters never stop. */
+ if (brw->gen == 5)
+ return;
+
BEGIN_BATCH(3);
OUT_BATCH(MI_LOAD_REGISTER_IMM | (3 - 2));
OUT_BATCH(OACONTROL);
@@ -1367,8 +1373,7 @@ brw_perf_monitor_new_batch(struct brw_context *brw)
if (brw->perfmon.oa_users == 0)
return;
- if (brw->gen >= 6)
- start_oa_counters(brw);
+ start_oa_counters(brw);
/* Make sure bookend_bo has enough space for a pair of snapshots.
* If not, "wrap" the BO: gather up any results so far, and start from
@@ -1405,8 +1410,7 @@ brw_perf_monitor_finish_batch(struct brw_context *brw)
emit_bookend_snapshot(brw);
- if (brw->gen >= 6)
- stop_oa_counters(brw);
+ stop_oa_counters(brw);
}
/******************************************************************************/
More information about the mesa-commit
mailing list