summaryrefslogtreecommitdiffstats
path: root/src/intel/perf/gen_perf.h
diff options
context:
space:
mode:
authorMark Janes <[email protected]>2019-08-06 10:00:16 -0700
committerMark Janes <[email protected]>2019-08-07 21:33:55 -0700
commit52d3db9ab68ccc6d6ea25e3ef30d2ce3f92c0050 (patch)
tree97e1ebde86bb2226d61d528b73ec2179ebff196e /src/intel/perf/gen_perf.h
parentdf18acee78e6251283f806a80585fc592ff37d0a (diff)
intel/perf: move perf-related state into gen_perf_context
To move more operations into intel/perf, several state items are needed. Save references to that state in the perf_ctxt, rather than passing them in for every operation. This commit includes an initializer for gen_perf_context, to set those references and also encapsulate the initialization of the sample buffer state. Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/intel/perf/gen_perf.h')
-rw-r--r--src/intel/perf/gen_perf.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/intel/perf/gen_perf.h b/src/intel/perf/gen_perf.h
index 0f2fdc9d9f6..48a8469e9a2 100644
--- a/src/intel/perf/gen_perf.h
+++ b/src/intel/perf/gen_perf.h
@@ -428,6 +428,13 @@ struct gen_perf_query_object
struct gen_perf_context {
struct gen_perf_config *perf;
+ void * ctx; /* driver context (eg, brw_context) */
+ void * bufmgr;
+ const struct gen_device_info *devinfo;
+
+ uint32_t hw_ctx;
+ int drm_fd;
+
/* The i915 perf stream we open to setup + enable the OA counters */
int oa_stream_fd;
@@ -483,6 +490,14 @@ struct gen_perf_context {
int n_query_instances;
};
+void gen_perf_init_context(struct gen_perf_context *perf_ctx,
+ struct gen_perf_config *perf_cfg,
+ void * ctx, /* driver context (eg, brw_context) */
+ void * bufmgr, /* eg brw_bufmgr */
+ const struct gen_device_info *devinfo,
+ uint32_t hw_ctx,
+ int drm_fd);
+
static inline size_t
gen_perf_query_counter_get_size(const struct gen_perf_query_counter *counter)
{