2 * Copyright © 2019 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 #ifndef GEN_PERF_QUERY_H
25 #define GEN_PERF_QUERY_H
29 struct gen_device_info
;
31 struct gen_perf_config
;
32 struct gen_perf_context
;
33 struct gen_perf_query_object
;
35 struct gen_perf_context
*gen_perf_new_context(void *parent
);
37 void gen_perf_init_context(struct gen_perf_context
*perf_ctx
,
38 struct gen_perf_config
*perf_cfg
,
39 void * ctx
, /* driver context (eg, brw_context) */
40 void * bufmgr
, /* eg brw_bufmgr */
41 const struct gen_device_info
*devinfo
,
45 const struct gen_perf_query_info
* gen_perf_query_info(const struct gen_perf_query_object
*);
48 void gen_perf_init_context(struct gen_perf_context
*perf_ctx
,
49 struct gen_perf_config
*perf_cfg
,
50 void * ctx
, /* driver context (eg, brw_context) */
51 void * bufmgr
, /* eg brw_bufmgr */
52 const struct gen_device_info
*devinfo
,
56 struct gen_perf_config
*gen_perf_config(struct gen_perf_context
*ctx
);
58 int gen_perf_active_queries(struct gen_perf_context
*perf_ctx
,
59 const struct gen_perf_query_info
*query
);
61 struct gen_perf_query_object
*
62 gen_perf_new_query(struct gen_perf_context
*, unsigned query_index
);
65 bool gen_perf_begin_query(struct gen_perf_context
*perf_ctx
,
66 struct gen_perf_query_object
*query
);
67 void gen_perf_end_query(struct gen_perf_context
*perf_ctx
,
68 struct gen_perf_query_object
*query
);
69 void gen_perf_wait_query(struct gen_perf_context
*perf_ctx
,
70 struct gen_perf_query_object
*query
,
72 bool gen_perf_is_query_ready(struct gen_perf_context
*perf_ctx
,
73 struct gen_perf_query_object
*query
,
75 void gen_perf_delete_query(struct gen_perf_context
*perf_ctx
,
76 struct gen_perf_query_object
*query
);
77 void gen_perf_get_query_data(struct gen_perf_context
*perf_ctx
,
78 struct gen_perf_query_object
*query
,
82 unsigned *bytes_written
);
84 void gen_perf_dump_query_count(struct gen_perf_context
*perf_ctx
);
85 void gen_perf_dump_query(struct gen_perf_context
*perf_ctx
,
86 struct gen_perf_query_object
*obj
,
89 #endif /* GEN_PERF_QUERY_H */