summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorRobert Bragg <[email protected]>2017-04-13 19:50:37 +0100
committerLionel Landwerlin <[email protected]>2017-06-27 14:10:29 +0300
commite277ff41c0aafa6bd213da058b0256ddccbde6ae (patch)
tree4c4f939f0cb27ef0ac8df436e3a26bfa8f68e3a9 /src/mesa
parent31b11f69f75ff92cb42a13bb2f6740c183f761df (diff)
i965: perf: ensure isolated timer reports while idle don't confuse filtering
From experimentation in IGT, we found that the OA unit might label some report as "idle" (using an invalid context ID), right after a report for a given context. Deltas generated by those reports actually belong to the previous context, even though they're not labelled as such. This change makes ensure that while reading OA reports, we only consider the GPU actually idle after 2 reports with an invalid context ID. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_performance_query.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c
index 4af06185680..519c3ec2f99 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_query.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_query.c
@@ -832,6 +832,7 @@ accumulate_oa_reports(struct brw_context *brw,
struct exec_node *first_samples_node;
bool in_ctx = true;
uint32_t ctx_id;
+ int out_duration = 0;
assert(o->Ready);
assert(obj->oa.map != NULL);
@@ -903,13 +904,27 @@ accumulate_oa_reports(struct brw_context *brw,
* of OA counters while any other context is acctive.
*/
if (brw->gen >= 8) {
+
if (in_ctx && report[2] != ctx_id) {
DBG("i915 perf: Switch AWAY (observed by ID change)\n");
in_ctx = false;
+ out_duration = 0;
} else if (in_ctx == false && report[2] == ctx_id) {
DBG("i915 perf: Switch TO\n");
in_ctx = true;
- add = false;
+
+ /* From experimentation in IGT, we found that the OA unit
+ * might label some report as "idle" (using an invalid
+ * context ID), right after a report for a given context.
+ * Deltas generated by those reports actually belong to the
+ * previous context, even though they're not labelled as
+ * such.
+ *
+ * We didn't *really* Switch AWAY in the case that we e.g.
+ * saw a single periodic report while idle...
+ */
+ if (out_duration >= 1)
+ add = false;
} else if (in_ctx) {
assert(report[2] == ctx_id);
DBG("i915 perf: Continuation IN\n");
@@ -917,6 +932,7 @@ accumulate_oa_reports(struct brw_context *brw,
assert(report[2] != ctx_id);
DBG("i915 perf: Continuation OUT\n");
add = false;
+ out_duration++;
}
}