diff options
author | Mark Janes <[email protected]> | 2019-07-17 12:29:00 -0700 |
---|---|---|
committer | Mark Janes <[email protected]> | 2019-08-07 21:33:56 -0700 |
commit | 2df1ab4d48027c642abe316a10ad39fb399f3d60 (patch) | |
tree | 1ee63903317de834b6707ff58164096a2f9dbf5b /src/intel/perf/gen_perf.c | |
parent | deea3798b6e7bc54e62cd6a7b1c08c4e51801144 (diff) |
intel/perf: make gen_perf_query_object private
Encapsulate the details of this structure within the perf implemenation.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/perf/gen_perf.c')
-rw-r--r-- | src/intel/perf/gen_perf.c | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/src/intel/perf/gen_perf.c b/src/intel/perf/gen_perf.c index 03f29d5222f..ba6afb94e71 100644 --- a/src/intel/perf/gen_perf.c +++ b/src/intel/perf/gen_perf.c @@ -189,6 +189,78 @@ struct oa_sample_buf { uint32_t last_timestamp; }; +/** + * gen representation of a performance query object. + * + * NB: We want to keep this structure relatively lean considering that + * applications may expect to allocate enough objects to be able to + * query around all draw calls in a frame. + */ +struct gen_perf_query_object +{ + const struct gen_perf_query_info *queryinfo; + + /* See query->kind to know which state below is in use... */ + union { + struct { + + /** + * BO containing OA counter snapshots at query Begin/End time. + */ + void *bo; + + /** + * Address of mapped of @bo + */ + void *map; + + /** + * The MI_REPORT_PERF_COUNT command lets us specify a unique + * ID that will be reflected in the resulting OA report + * that's written by the GPU. This is the ID we're expecting + * in the begin report and the the end report should be + * @begin_report_id + 1. + */ + int begin_report_id; + + /** + * Reference the head of the brw->perfquery.sample_buffers + * list at the time that the query started (so we only need + * to look at nodes after this point when looking for samples + * related to this query) + * + * (See struct brw_oa_sample_buf description for more details) + */ + struct exec_node *samples_head; + + /** + * false while in the unaccumulated_elements list, and set to + * true when the final, end MI_RPC snapshot has been + * accumulated. + */ + bool results_accumulated; + + /** + * Frequency of the GT at begin and end of the query. + */ + uint64_t gt_frequency[2]; + + /** + * Accumulated OA results between begin and end of the query. + */ + struct gen_perf_query_result result; + } oa; + + struct { + /** + * BO containing starting and ending snapshots for the + * statistics counters. + */ + void *bo; + } pipeline_stats; + }; +}; + struct gen_perf_context { struct gen_perf_config *perf; @@ -254,6 +326,12 @@ struct gen_perf_context { int n_query_instances; }; +const struct gen_perf_query_info* +gen_perf_query_info(const struct gen_perf_query_object *query) +{ + return query->queryinfo; +} + struct gen_perf_context * gen_perf_new_context(void *parent) { |