i965: drop brw->gen in favor of devinfo->gen
[mesa.git] / src / mesa / drivers / dri / i965 / brw_performance_query.h
1 /*
2 * Copyright © 2015 Intel Corporation
3 *
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:
10 *
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
13 * Software.
14 *
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
21 * IN THE SOFTWARE.
22 */
23
24 #ifndef BRW_PERFORMANCE_QUERY_H
25 #define BRW_PERFORMANCE_QUERY_H
26
27 #include <stdint.h>
28
29 #include "brw_context.h"
30
31 struct brw_pipeline_stat
32 {
33 uint32_t reg;
34 uint32_t numerator;
35 uint32_t denominator;
36 };
37
38 struct brw_perf_query_counter
39 {
40 const char *name;
41 const char *desc;
42 GLenum type;
43 GLenum data_type;
44 uint64_t raw_max;
45 size_t offset;
46 size_t size;
47
48 union {
49 uint64_t (*oa_counter_read_uint64)(struct brw_context *brw,
50 const struct brw_perf_query_info *query,
51 uint64_t *accumulator);
52 float (*oa_counter_read_float)(struct brw_context *brw,
53 const struct brw_perf_query_info *query,
54 uint64_t *accumulator);
55 struct brw_pipeline_stat pipeline_stat;
56 };
57 };
58
59 #endif /* BRW_PERFORMANCE_QUERY_H */