summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri
diff options
context:
space:
mode:
authorMark Janes <[email protected]>2019-06-28 16:12:44 -0700
committerMark Janes <[email protected]>2019-08-07 21:33:56 -0700
commita9be292722abb2d1a3aa400d0060633f4a2a6f5d (patch)
treee7a1989bb3bd53e52b63d3b2a396f0b14893166d /src/mesa/drivers/dri
parent3c8ed58486744b7e83058b867b1e66e56431a224 (diff)
intel/perf: move wait_query to perf
The following methods have duplicate implementation of read_oa_samples_until in brw_performance_query.c: - read_oa_samples_for_query - read_oa_samples_until They ar still referenced by other methods in the file and will be removed on the subsequent commit. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri')
-rw-r--r--src/mesa/drivers/dri/i965/brw_performance_query.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_performance_query.c b/src/mesa/drivers/dri/i965/brw_performance_query.c
index 6f55187ed79..03ac82369ca 100644
--- a/src/mesa/drivers/dri/i965/brw_performance_query.c
+++ b/src/mesa/drivers/dri/i965/brw_performance_query.c
@@ -667,47 +667,10 @@ brw_wait_perf_query(struct gl_context *ctx, struct gl_perf_query_object *o)
struct brw_context *brw = brw_context(ctx);
struct brw_perf_query_object *brw_query = brw_perf_query(o);
struct gen_perf_query_object *obj = brw_query->query;
- struct brw_bo *bo = NULL;
- struct gen_perf_config *perf_cfg = brw->perf_ctx.perf;
assert(!o->Ready);
- switch (obj->queryinfo->kind) {
- case GEN_PERF_QUERY_TYPE_OA:
- case GEN_PERF_QUERY_TYPE_RAW:
- bo = obj->oa.bo;
- break;
-
- case GEN_PERF_QUERY_TYPE_PIPELINE:
- bo = obj->pipeline_stats.bo;
- break;
-
- default:
- unreachable("Unknown query type");
- break;
- }
-
- if (bo == NULL)
- return;
-
- /* If the current batch references our results bo then we need to
- * flush first...
- */
- if (perf_cfg->vtbl.batch_references(&brw->batch, bo))
- perf_cfg->vtbl.batchbuffer_flush(brw, __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 (obj->queryinfo->kind == GEN_PERF_QUERY_TYPE_OA ||
- obj->queryinfo->kind == GEN_PERF_QUERY_TYPE_RAW) {
- while (!read_oa_samples_for_query(brw, obj))
- ;
- }
+ gen_perf_wait_query(&brw->perf_ctx, obj, &brw->batch);
}
static bool