diff options
author | Mark Janes <mark.a.janes@intel.com> | 2019-06-28 16:19:32 -0700 |
---|---|---|
committer | Mark Janes <mark.a.janes@intel.com> | 2019-08-07 21:33:56 -0700 |
commit | 8c9eac12345fb6ca7a6ae108a0451cbbcfff47ed (patch) | |
tree | 83c8322c478bd488382fdc1863782e8b20921f06 /src/intel | |
parent | a9be292722abb2d1a3aa400d0060633f4a2a6f5d (diff) |
intel/perf: move is_query_ready to gen_perf
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/perf/gen_perf.c | 28 | ||||
-rw-r--r-- | src/intel/perf/gen_perf.h | 3 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c index c051d064bd6..fe5bbabe3c8 100644 --- a/src/intel/perf/gen_perf.c +++ b/src/intel/perf/gen_perf.c @@ -1501,3 +1501,31 @@ gen_perf_wait_query(struct gen_perf_context *perf_ctx, ; } } + +bool +gen_perf_is_query_ready(struct gen_perf_context *perf_ctx, + struct gen_perf_query_object *query, + void *current_batch) +{ + struct gen_perf_config *perf_cfg = perf_ctx->perf; + + switch (query->queryinfo->kind) { + case GEN_PERF_QUERY_TYPE_OA: + case GEN_PERF_QUERY_TYPE_RAW: + 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))); + case GEN_PERF_QUERY_TYPE_PIPELINE: + return (query->pipeline_stats.bo && + !perf_cfg->vtbl.batch_references(current_batch, query->pipeline_stats.bo) && + !perf_cfg->vtbl.bo_busy(query->pipeline_stats.bo)); + + default: + unreachable("Unknown query type"); + break; + } + + return false; +} diff --git a/src/intel/perf/gen_perf.h b/src/intel/perf/gen_perf.h index 597fb1028ea..efb884afe36 100644 --- a/src/intel/perf/gen_perf.h +++ b/src/intel/perf/gen_perf.h @@ -627,5 +627,8 @@ void gen_perf_end_query(struct gen_perf_context *perf_ctx, void gen_perf_wait_query(struct gen_perf_context *perf_ctx, struct gen_perf_query_object *query, void *current_batch); +bool gen_perf_is_query_ready(struct gen_perf_context *perf_ctx, + struct gen_perf_query_object *query, + void *current_batch); #endif /* GEN_PERF_H */ |