diff options
author | Mark Janes <[email protected]> | 2019-06-07 12:15:54 -0700 |
---|---|---|
committer | Mark Janes <[email protected]> | 2019-08-07 21:33:55 -0700 |
commit | 8ae6667992ccca41d08884d863b8aeb22a4c4e65 (patch) | |
tree | b86905bbd1592ce058d98b0dfe583a2fa3dedfce /src/intel | |
parent | 7e890ed4764d9d5927de4ee326f41e97d3bf0332 (diff) |
intel/perf: move query_object into perf
Query objects can now be encapsulated within the perf subsystem.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/perf/gen_perf.h | 74 |
1 files changed, 73 insertions, 1 deletions
diff --git a/src/intel/perf/gen_perf.h b/src/intel/perf/gen_perf.h index 45ca8228a80..1c588a121e8 100644 --- a/src/intel/perf/gen_perf.h +++ b/src/intel/perf/gen_perf.h @@ -350,6 +350,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; @@ -396,7 +468,7 @@ struct gen_perf_context { * These may be active, or have already ended. However, the * results have not been requested. */ - struct brw_perf_query_object **unaccumulated; + struct gen_perf_query_object **unaccumulated; int unaccumulated_elements; int unaccumulated_array_size; |