d93d12c71825ab49c2cdf85c5bfb69d6db10cefb
2 * Copyright (c) 2017 Etnaviv Project
3 * Copyright (C) 2017 Zodiac Inflight Innovations
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sub license,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice (including the
13 * next paragraph) shall be included in all copies or substantial portions
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22 * DEALINGS IN THE SOFTWARE.
25 * Rob Clark <robclark@freedesktop.org>
26 * Christian Gmeiner <christian.gmeiner@gmail.com>
29 #ifndef H_ETNAVIV_QUERY_PM
30 #define H_ETNAVIV_QUERY_PM
32 #include "etnaviv_query.h"
36 #define ETNA_QUERY_HI_TOTAL_CYCLES (ETNA_PM_QUERY_BASE + 0)
37 #define ETNA_QUERY_HI_IDLE_CYCLES (ETNA_PM_QUERY_BASE + 1)
38 #define ETNA_QUERY_HI_AXI_CYCLES_READ_REQUEST_STALLED (ETNA_PM_QUERY_BASE + 2)
39 #define ETNA_QUERY_HI_AXI_CYCLES_WRITE_REQUEST_STALLED (ETNA_PM_QUERY_BASE + 3)
40 #define ETNA_QUERY_HI_AXI_CYCLES_WRITE_DATA_STALLED (ETNA_PM_QUERY_BASE + 4)
42 #define ETNA_QUERY_PE_PIXEL_COUNT_KILLED_BY_COLOR_PIPE (ETNA_PM_QUERY_BASE + 5)
43 #define ETNA_QUERY_PE_PIXEL_COUNT_KILLED_BY_DEPTH_PIPE (ETNA_PM_QUERY_BASE + 6)
44 #define ETNA_QUERY_PE_PIXEL_COUNT_DRAWN_BY_COLOR_PIPE (ETNA_PM_QUERY_BASE + 7)
45 #define ETNA_QUERY_PE_PIXEL_COUNT_DRAWN_BY_DEPTH_PIPE (ETNA_PM_QUERY_BASE + 8)
46 #define ETNA_QUERY_PE_PIXELS_RENDERED_2D (ETNA_PM_QUERY_BASE + 9)
48 #define ETNA_QUERY_SH_SHADER_CYCLES (ETNA_PM_QUERY_BASE + 10)
49 #define ETNA_QUERY_SH_PS_INST_COUNTER (ETNA_PM_QUERY_BASE + 11)
50 #define ETNA_QUERY_SH_RENDERED_PIXEL_COUNTER (ETNA_PM_QUERY_BASE + 12)
51 #define ETNA_QUERY_SH_VS_INST_COUNTER (ETNA_PM_QUERY_BASE + 13)
52 #define ETNA_QUERY_SH_RENDERED_VERTICE_COUNTER (ETNA_PM_QUERY_BASE + 14)
53 #define ETNA_QUERY_SH_VTX_BRANCH_INST_COUNTER (ETNA_PM_QUERY_BASE + 15)
54 #define ETNA_QUERY_SH_VTX_TEXLD_INST_COUNTER (ETNA_PM_QUERY_BASE + 16)
55 #define ETNA_QUERY_SH_PXL_BRANCH_INST_COUNTER (ETNA_PM_QUERY_BASE + 17)
56 #define ETNA_QUERY_SH_PXL_TEXLD_INST_COUNTER (ETNA_PM_QUERY_BASE + 18)
58 #define ETNA_QUERY_PA_INPUT_VTX_COUNTER (ETNA_PM_QUERY_BASE + 19)
59 #define ETNA_QUERY_PA_INPUT_PRIM_COUNTER (ETNA_PM_QUERY_BASE + 20)
60 #define ETNA_QUERY_PA_OUTPUT_PRIM_COUNTER (ETNA_PM_QUERY_BASE + 21)
61 #define ETNA_QUERY_PA_DEPTH_CLIPPED_COUNTER (ETNA_PM_QUERY_BASE + 22)
62 #define ETNA_QUERY_PA_TRIVIAL_REJECTED_COUNTER (ETNA_PM_QUERY_BASE + 23)
63 #define ETNA_QUERY_PA_CULLED_COUNTER (ETNA_PM_QUERY_BASE + 24)
65 #define ETNA_QUERY_SE_CULLED_TRIANGLE_COUNT (ETNA_PM_QUERY_BASE + 25)
66 #define ETNA_QUERY_SE_CULLED_LINES_COUNT (ETNA_PM_QUERY_BASE + 26)
68 struct etna_pm_query
{
69 struct etna_query base
;
70 struct etna_perfmon_signal
*signal
;
77 static inline struct etna_pm_query
*
78 etna_pm_query(struct etna_query
*q
)
80 return (struct etna_pm_query
*)q
;
84 etna_pm_query_setup(struct etna_screen
*screen
);
87 etna_pm_create_query(struct etna_context
*ctx
, unsigned query_type
);
90 etna_pm_get_driver_query_info(struct pipe_screen
*pscreen
, unsigned index
,
91 struct pipe_driver_query_info
*info
);