struct gen_perf_query_object *obj = perf_query->query;
struct gen_perf_context *perf_ctx = ice->perf_ctx;
- gen_perf_get_query_data(perf_ctx, obj, data_size, data, bytes_written);
+ gen_perf_get_query_data(perf_ctx, obj, &ice->batches[IRIS_BATCH_RENDER],
+ data_size, data, bytes_written);
}
void
perf_cfg->vtbl.batchbuffer_flush(perf_ctx->ctx, __FILE__, __LINE__);
perf_cfg->vtbl.bo_wait_rendering(bo);
-
- /* Due to a race condition between the OA unit signaling report
- * availability and the report actually being written into memory,
- * we need to wait for all the reports to come in before we can
- * read them.
- */
- if (query->queryinfo->kind == GEN_PERF_QUERY_TYPE_OA ||
- query->queryinfo->kind == GEN_PERF_QUERY_TYPE_RAW) {
- while (!read_oa_samples_for_query(perf_ctx, query, current_batch))
- ;
- }
}
bool
return (query->oa.results_accumulated ||
(query->oa.bo &&
!perf_cfg->vtbl.batch_references(current_batch, query->oa.bo) &&
- !perf_cfg->vtbl.bo_busy(query->oa.bo) &&
- read_oa_samples_for_query(perf_ctx, query, current_batch)));
+ !perf_cfg->vtbl.bo_busy(query->oa.bo)));
+
case GEN_PERF_QUERY_TYPE_PIPELINE:
return (query->pipeline_stats.bo &&
!perf_cfg->vtbl.batch_references(current_batch, query->pipeline_stats.bo) &&
void
gen_perf_get_query_data(struct gen_perf_context *perf_ctx,
struct gen_perf_query_object *query,
+ void *current_batch,
int data_size,
unsigned *data,
unsigned *bytes_written)
case GEN_PERF_QUERY_TYPE_OA:
case GEN_PERF_QUERY_TYPE_RAW:
if (!query->oa.results_accumulated) {
+ /* Due to the sampling frequency of the OA buffer by the i915-perf
+ * driver, there can be a 5ms delay between the Mesa seeing the query
+ * complete and i915 making all the OA buffer reports available to us.
+ * We need to wait for all the reports to come in before we can do
+ * the post processing removing unrelated deltas.
+ * There is a i915-perf series to address this issue, but it's
+ * not been merged upstream yet.
+ */
+ while (!read_oa_samples_for_query(perf_ctx, query, current_batch))
+ ;
+
read_gt_frequency(perf_ctx, query);
uint32_t *begin_report = query->oa.map;
uint32_t *end_report = query->oa.map + MI_RPC_BO_END_OFFSET_BYTES;