History

drm/v3d: Fix perfmon build error/warning

Move static const array into the source file to fix the "defined but not used" errors. The fix is perhaps not the prettiest due hand crafting the array sizes in v3d_performance_counters.h, but I did add some build time asserts to validate the counts look sensible, so hopefully it is good enough for a quick fix.

Tvrtko Ursulin committed 2 years ago

Commit 9c3951e1 parent 35e7a724 files · +205 −195Browse files

Unified · Split

4 files
  1. drivers/gpu/drm/v3d/v3d_drv.c +2 −2
  2. drivers/gpu/drm/v3d/v3d_drv.h +0 −3
  3. drivers/gpu/drm/v3d/v3d_perfmon.c +198 −6
  4. drivers/gpu/drm/v3d/v3d_performance_counters.h +5 −184
drivers/gpu/drm/v3d/v3d_drv.c+2−2
@@ -299,9 +299,9 @@ static int v3d_platform_drm_probe(struct platform_device *pdev) · 298 unmodified lines
299 WARN_ON(v3d->cores > 1); /* multicore not yet implemented */299 WARN_ON(v3d->cores > 1); /* multicore not yet implemented */
300 300
301 if (v3d->ver >= 71)301 if (v3d->ver >= 71)
302 v3d->max_counters = ARRAY_SIZE(v3d_v71_performance_counters);302 v3d->max_counters = V3D_V71_NUM_PERFCOUNTERS;
303 else if (v3d->ver >= 42)303 else if (v3d->ver >= 42)
304 v3d->max_counters = ARRAY_SIZE(v3d_v42_performance_counters);304 v3d->max_counters = V3D_V42_NUM_PERFCOUNTERS;
305 else305 else
306 v3d->max_counters = 0;306 v3d->max_counters = 0;
307 307
drivers/gpu/drm/v3d/v3d_drv.h+0−3
@@ -351,9 +351,6 @@ struct v3d_timestamp_query { · 350 unmodified lines
351 struct drm_syncobj *syncobj;351 struct drm_syncobj *syncobj;
352};352};
353 353
354/* Maximum number of performance counters supported by any version of V3D */
355#define V3D_MAX_COUNTERS ARRAY_SIZE(v3d_v71_performance_counters)
356
357/* Number of perfmons required to handle all supported performance counters */354/* Number of perfmons required to handle all supported performance counters */
358#define V3D_MAX_PERFMONS DIV_ROUND_UP(V3D_MAX_COUNTERS, \355#define V3D_MAX_PERFMONS DIV_ROUND_UP(V3D_MAX_COUNTERS, \
359 DRM_V3D_MAX_PERF_COUNTERS)356 DRM_V3D_MAX_PERF_COUNTERS)
drivers/gpu/drm/v3d/v3d_perfmon.c+198−6
@@ -9,6 +9,192 @@ · 8 unmodified lines
9#define V3D_PERFMONID_MIN 19#define V3D_PERFMONID_MIN 1
10#define V3D_PERFMONID_MAX U32_MAX10#define V3D_PERFMONID_MAX U32_MAX
11 11
12static const struct v3d_perf_counter_desc v3d_v42_performance_counters[] = {
13 {"FEP", "FEP-valid-primitives-no-rendered-pixels", "[FEP] Valid primitives that result in no rendered pixels, for all rendered tiles"},
14 {"FEP", "FEP-valid-primitives-rendered-pixels", "[FEP] Valid primitives for all rendered tiles (primitives may be counted in more than one tile)"},
15 {"FEP", "FEP-clipped-quads", "[FEP] Early-Z/Near/Far clipped quads"},
16 {"FEP", "FEP-valid-quads", "[FEP] Valid quads"},
17 {"TLB", "TLB-quads-not-passing-stencil-test", "[TLB] Quads with no pixels passing the stencil test"},
18 {"TLB", "TLB-quads-not-passing-z-and-stencil-test", "[TLB] Quads with no pixels passing the Z and stencil tests"},
19 {"TLB", "TLB-quads-passing-z-and-stencil-test", "[TLB] Quads with any pixels passing the Z and stencil tests"},
20 {"TLB", "TLB-quads-with-zero-coverage", "[TLB] Quads with all pixels having zero coverage"},
21 {"TLB", "TLB-quads-with-non-zero-coverage", "[TLB] Quads with any pixels having non-zero coverage"},
22 {"TLB", "TLB-quads-written-to-color-buffer", "[TLB] Quads with valid pixels written to colour buffer"},
23 {"PTB", "PTB-primitives-discarded-outside-viewport", "[PTB] Primitives discarded by being outside the viewport"},
24 {"PTB", "PTB-primitives-need-clipping", "[PTB] Primitives that need clipping"},
25 {"PTB", "PTB-primitives-discarded-reversed", "[PTB] Primitives that are discarded because they are reversed"},
26 {"QPU", "QPU-total-idle-clk-cycles", "[QPU] Total idle clock cycles for all QPUs"},
27 {"QPU", "QPU-total-active-clk-cycles-vertex-coord-shading", "[QPU] Total active clock cycles for all QPUs doing vertex/coordinate/user shading (counts only when QPU is not stalled)"},
28 {"QPU", "QPU-total-active-clk-cycles-fragment-shading", "[QPU] Total active clock cycles for all QPUs doing fragment shading (counts only when QPU is not stalled)"},
29 {"QPU", "QPU-total-clk-cycles-executing-valid-instr", "[QPU] Total clock cycles for all QPUs executing valid instructions"},
30 {"QPU", "QPU-total-clk-cycles-waiting-TMU", "[QPU] Total clock cycles for all QPUs stalled waiting for TMUs only (counter won't increment if QPU also stalling for another reason)"},
31 {"QPU", "QPU-total-clk-cycles-waiting-scoreboard", "[QPU] Total clock cycles for all QPUs stalled waiting for Scoreboard only (counter won't increment if QPU also stalling for another reason)"},
32 {"QPU", "QPU-total-clk-cycles-waiting-varyings", "[QPU] Total clock cycles for all QPUs stalled waiting for Varyings only (counter won't increment if QPU also stalling for another reason)"},
33 {"QPU", "QPU-total-instr-cache-hit", "[QPU] Total instruction cache hits for all slices"},
34 {"QPU", "QPU-total-instr-cache-miss", "[QPU] Total instruction cache misses for all slices"},
35 {"QPU", "QPU-total-uniform-cache-hit", "[QPU] Total uniforms cache hits for all slices"},
36 {"QPU", "QPU-total-uniform-cache-miss", "[QPU] Total uniforms cache misses for all slices"},
37 {"TMU", "TMU-total-text-quads-access", "[TMU] Total texture cache accesses"},
38 {"TMU", "TMU-total-text-cache-miss", "[TMU] Total texture cache misses (number of fetches from memory/L2cache)"},
39 {"VPM", "VPM-total-clk-cycles-VDW-stalled", "[VPM] Total clock cycles VDW is stalled waiting for VPM access"},
40 {"VPM", "VPM-total-clk-cycles-VCD-stalled", "[VPM] Total clock cycles VCD is stalled waiting for VPM access"},
41 {"CLE", "CLE-bin-thread-active-cycles", "[CLE] Bin thread active cycles"},
42 {"CLE", "CLE-render-thread-active-cycles", "[CLE] Render thread active cycles"},
43 {"L2T", "L2T-total-cache-hit", "[L2T] Total Level 2 cache hits"},
44 {"L2T", "L2T-total-cache-miss", "[L2T] Total Level 2 cache misses"},
45 {"CORE", "cycle-count", "[CORE] Cycle counter"},
46 {"QPU", "QPU-total-clk-cycles-waiting-vertex-coord-shading", "[QPU] Total stalled clock cycles for all QPUs doing vertex/coordinate/user shading"},
47 {"QPU", "QPU-total-clk-cycles-waiting-fragment-shading", "[QPU] Total stalled clock cycles for all QPUs doing fragment shading"},
48 {"PTB", "PTB-primitives-binned", "[PTB] Total primitives binned"},
49 {"AXI", "AXI-writes-seen-watch-0", "[AXI] Writes seen by watch 0"},
50 {"AXI", "AXI-reads-seen-watch-0", "[AXI] Reads seen by watch 0"},
51 {"AXI", "AXI-writes-stalled-seen-watch-0", "[AXI] Write stalls seen by watch 0"},
52 {"AXI", "AXI-reads-stalled-seen-watch-0", "[AXI] Read stalls seen by watch 0"},
53 {"AXI", "AXI-write-bytes-seen-watch-0", "[AXI] Total bytes written seen by watch 0"},
54 {"AXI", "AXI-read-bytes-seen-watch-0", "[AXI] Total bytes read seen by watch 0"},
55 {"AXI", "AXI-writes-seen-watch-1", "[AXI] Writes seen by watch 1"},
56 {"AXI", "AXI-reads-seen-watch-1", "[AXI] Reads seen by watch 1"},
57 {"AXI", "AXI-writes-stalled-seen-watch-1", "[AXI] Write stalls seen by watch 1"},
58 {"AXI", "AXI-reads-stalled-seen-watch-1", "[AXI] Read stalls seen by watch 1"},
59 {"AXI", "AXI-write-bytes-seen-watch-1", "[AXI] Total bytes written seen by watch 1"},
60 {"AXI", "AXI-read-bytes-seen-watch-1", "[AXI] Total bytes read seen by watch 1"},
61 {"TLB", "TLB-partial-quads-written-to-color-buffer", "[TLB] Partial quads written to the colour buffer"},
62 {"TMU", "TMU-total-config-access", "[TMU] Total config accesses"},
63 {"L2T", "L2T-no-id-stalled", "[L2T] No ID stall"},
64 {"L2T", "L2T-command-queue-stalled", "[L2T] Command queue full stall"},
65 {"L2T", "L2T-TMU-writes", "[L2T] TMU write accesses"},
66 {"TMU", "TMU-active-cycles", "[TMU] Active cycles"},
67 {"TMU", "TMU-stalled-cycles", "[TMU] Stalled cycles"},
68 {"CLE", "CLE-thread-active-cycles", "[CLE] Bin or render thread active cycles"},
69 {"L2T", "L2T-TMU-reads", "[L2T] TMU read accesses"},
70 {"L2T", "L2T-CLE-reads", "[L2T] CLE read accesses"},
71 {"L2T", "L2T-VCD-reads", "[L2T] VCD read accesses"},
72 {"L2T", "L2T-TMU-config-reads", "[L2T] TMU CFG read accesses"},
73 {"L2T", "L2T-SLC0-reads", "[L2T] SLC0 read accesses"},
74 {"L2T", "L2T-SLC1-reads", "[L2T] SLC1 read accesses"},
75 {"L2T", "L2T-SLC2-reads", "[L2T] SLC2 read accesses"},
76 {"L2T", "L2T-TMU-write-miss", "[L2T] TMU write misses"},
77 {"L2T", "L2T-TMU-read-miss", "[L2T] TMU read misses"},
78 {"L2T", "L2T-CLE-read-miss", "[L2T] CLE read misses"},
79 {"L2T", "L2T-VCD-read-miss", "[L2T] VCD read misses"},
80 {"L2T", "L2T-TMU-config-read-miss", "[L2T] TMU CFG read misses"},
81 {"L2T", "L2T-SLC0-read-miss", "[L2T] SLC0 read misses"},
82 {"L2T", "L2T-SLC1-read-miss", "[L2T] SLC1 read misses"},
83 {"L2T", "L2T-SLC2-read-miss", "[L2T] SLC2 read misses"},
84 {"CORE", "core-memory-writes", "[CORE] Total memory writes"},
85 {"L2T", "L2T-memory-writes", "[L2T] Total memory writes"},
86 {"PTB", "PTB-memory-writes", "[PTB] Total memory writes"},
87 {"TLB", "TLB-memory-writes", "[TLB] Total memory writes"},
88 {"CORE", "core-memory-reads", "[CORE] Total memory reads"},
89 {"L2T", "L2T-memory-reads", "[L2T] Total memory reads"},
90 {"PTB", "PTB-memory-reads", "[PTB] Total memory reads"},
91 {"PSE", "PSE-memory-reads", "[PSE] Total memory reads"},
92 {"TLB", "TLB-memory-reads", "[TLB] Total memory reads"},
93 {"GMP", "GMP-memory-reads", "[GMP] Total memory reads"},
94 {"PTB", "PTB-memory-words-writes", "[PTB] Total memory words written"},
95 {"TLB", "TLB-memory-words-writes", "[TLB] Total memory words written"},
96 {"PSE", "PSE-memory-words-reads", "[PSE] Total memory words read"},
97 {"TLB", "TLB-memory-words-reads", "[TLB] Total memory words read"},
98 {"TMU", "TMU-MRU-hits", "[TMU] Total MRU hits"},
99 {"CORE", "compute-active-cycles", "[CORE] Compute active cycles"},
100};
101
102static const struct v3d_perf_counter_desc v3d_v71_performance_counters[] = {
103 {"CORE", "cycle-count", "[CORE] Cycle counter"},
104 {"CORE", "core-active", "[CORE] Bin/Render/Compute active cycles"},
105 {"CLE", "CLE-bin-thread-active-cycles", "[CLE] Bin thread active cycles"},
106 {"CLE", "CLE-render-thread-active-cycles", "[CLE] Render thread active cycles"},
107 {"CORE", "compute-active-cycles", "[CORE] Compute active cycles"},
108 {"FEP", "FEP-valid-primitives-no-rendered-pixels", "[FEP] Valid primitives that result in no rendered pixels, for all rendered tiles"},
109 {"FEP", "FEP-valid-primitives-rendered-pixels", "[FEP] Valid primitives for all rendered tiles (primitives may be counted in more than one tile)"},
110 {"FEP", "FEP-clipped-quads", "[FEP] Early-Z/Near/Far clipped quads"},
111 {"FEP", "FEP-valid-quads", "[FEP] Valid quads"},
112 {"TLB", "TLB-quads-not-passing-stencil-test", "[TLB] Quads with no pixels passing the stencil test"},
113 {"TLB", "TLB-quads-not-passing-z-and-stencil-test", "[TLB] Quads with no pixels passing the Z and stencil tests"},
114 {"TLB", "TLB-quads-passing-z-and-stencil-test", "[TLB] Quads with any pixels passing the Z and stencil tests"},
115 {"TLB", "TLB-quads-written-to-color-buffer", "[TLB] Quads with valid pixels written to colour buffer"},
116 {"TLB", "TLB-partial-quads-written-to-color-buffer", "[TLB] Partial quads written to the colour buffer"},
117 {"PTB", "PTB-primitives-need-clipping", "[PTB] Primitives that need clipping"},
118 {"PTB", "PTB-primitives-discarded-outside-viewport", "[PTB] Primitives discarded by being outside the viewport"},
119 {"PTB", "PTB-primitives-binned", "[PTB] Total primitives binned"},
120 {"PTB", "PTB-primitives-discarded-reversed", "[PTB] Primitives that are discarded because they are reversed"},
121 {"QPU", "QPU-total-instr-cache-hit", "[QPU] Total instruction cache hits for all slices"},
122 {"QPU", "QPU-total-instr-cache-miss", "[QPU] Total instruction cache misses for all slices"},
123 {"QPU", "QPU-total-uniform-cache-hit", "[QPU] Total uniforms cache hits for all slices"},
124 {"QPU", "QPU-total-uniform-cache-miss", "[QPU] Total uniforms cache misses for all slices"},
125 {"TMU", "TMU-active-cycles", "[TMU] Active cycles"},
126 {"TMU", "TMU-stalled-cycles", "[TMU] Stalled cycles"},
127 {"TMU", "TMU-total-text-quads-access", "[TMU] Total texture cache accesses"},
128 {"TMU", "TMU-cache-x4-active-cycles", "[TMU] Cache active cycles for x4 access"},
129 {"TMU", "TMU-cache-x4-stalled-cycles", "[TMU] Cache stalled cycles for x4 access"},
130 {"TMU", "TMU-total-text-quads-x4-access", "[TMU] Total texture cache x4 access"},
131 {"L2T", "L2T-total-cache-hit", "[L2T] Total Level 2 cache hits"},
132 {"L2T", "L2T-total-cache-miss", "[L2T] Total Level 2 cache misses"},
133 {"L2T", "L2T-local", "[L2T] Local mode access"},
134 {"L2T", "L2T-writeback", "[L2T] Writeback"},
135 {"L2T", "L2T-zero", "[L2T] Zero"},
136 {"L2T", "L2T-merge", "[L2T] Merge"},
137 {"L2T", "L2T-fill", "[L2T] Fill"},
138 {"L2T", "L2T-stalls-no-wid", "[L2T] Stalls because no WID available"},
139 {"L2T", "L2T-stalls-no-rid", "[L2T] Stalls because no RID available"},
140 {"L2T", "L2T-stalls-queue-full", "[L2T] Stalls because internal queue full"},
141 {"L2T", "L2T-stalls-wrightback", "[L2T] Stalls because writeback in flight"},
142 {"L2T", "L2T-stalls-mem", "[L2T] Stalls because AXI blocks read"},
143 {"L2T", "L2T-stalls-fill", "[L2T] Stalls because fill pending for victim cache-line"},
144 {"L2T", "L2T-hitq", "[L2T] Sent request via hit queue"},
145 {"L2T", "L2T-hitq-full", "[L2T] Sent request via main queue because hit queue is full"},
146 {"L2T", "L2T-stalls-read-data", "[L2T] Stalls because waiting for data from SDRAM"},
147 {"L2T", "L2T-TMU-read-hits", "[L2T] TMU read hits"},
148 {"L2T", "L2T-TMU-read-miss", "[L2T] TMU read misses"},
149 {"L2T", "L2T-VCD-read-hits", "[L2T] VCD read hits"},
150 {"L2T", "L2T-VCD-read-miss", "[L2T] VCD read misses"},
151 {"L2T", "L2T-SLC-read-hits", "[L2T] SLC read hits (all slices)"},
152 {"L2T", "L2T-SLC-read-miss", "[L2T] SLC read misses (all slices)"},
153 {"AXI", "AXI-writes-seen-watch-0", "[AXI] Writes seen by watch 0"},
154 {"AXI", "AXI-reads-seen-watch-0", "[AXI] Reads seen by watch 0"},
155 {"AXI", "AXI-writes-stalled-seen-watch-0", "[AXI] Write stalls seen by watch 0"},
156 {"AXI", "AXI-reads-stalled-seen-watch-0", "[AXI] Read stalls seen by watch 0"},
157 {"AXI", "AXI-write-bytes-seen-watch-0", "[AXI] Total bytes written seen by watch 0"},
158 {"AXI", "AXI-read-bytes-seen-watch-0", "[AXI] Total bytes read seen by watch 0"},
159 {"AXI", "AXI-writes-seen-watch-1", "[AXI] Writes seen by watch 1"},
160 {"AXI", "AXI-reads-seen-watch-1", "[AXI] Reads seen by watch 1"},
161 {"AXI", "AXI-writes-stalled-seen-watch-1", "[AXI] Write stalls seen by watch 1"},
162 {"AXI", "AXI-reads-stalled-seen-watch-1", "[AXI] Read stalls seen by watch 1"},
163 {"AXI", "AXI-write-bytes-seen-watch-1", "[AXI] Total bytes written seen by watch 1"},
164 {"AXI", "AXI-read-bytes-seen-watch-1", "[AXI] Total bytes read seen by watch 1"},
165 {"CORE", "core-memory-writes", "[CORE] Total memory writes"},
166 {"L2T", "L2T-memory-writes", "[L2T] Total memory writes"},
167 {"PTB", "PTB-memory-writes", "[PTB] Total memory writes"},
168 {"TLB", "TLB-memory-writes", "[TLB] Total memory writes"},
169 {"CORE", "core-memory-reads", "[CORE] Total memory reads"},
170 {"L2T", "L2T-memory-reads", "[L2T] Total memory reads"},
171 {"PTB", "PTB-memory-reads", "[PTB] Total memory reads"},
172 {"PSE", "PSE-memory-reads", "[PSE] Total memory reads"},
173 {"TLB", "TLB-memory-reads", "[TLB] Total memory reads"},
174 {"PTB", "PTB-memory-words-writes", "[PTB] Total memory words written"},
175 {"TLB", "TLB-memory-words-writes", "[TLB] Total memory words written"},
176 {"PSE", "PSE-memory-words-reads", "[PSE] Total memory words read"},
177 {"TLB", "TLB-memory-words-reads", "[TLB] Total memory words read"},
178 {"AXI", "AXI-read-trans", "[AXI] Read transaction count"},
179 {"AXI", "AXI-write-trans", "[AXI] Write transaction count"},
180 {"AXI", "AXI-read-wait-cycles", "[AXI] Read total wait cycles"},
181 {"AXI", "AXI-write-wait-cycles", "[AXI] Write total wait cycles"},
182 {"AXI", "AXI-max-outstanding-reads", "[AXI] Maximum outstanding read transactions"},
183 {"AXI", "AXI-max-outstanding-writes", "[AXI] Maximum outstanding write transactions"},
184 {"QPU", "QPU-wait-bubble", "[QPU] Pipeline bubble in qcycles due all threads waiting"},
185 {"QPU", "QPU-ic-miss-bubble", "[QPU] Pipeline bubble in qcycles due instruction-cache miss"},
186 {"QPU", "QPU-active", "[QPU] Executed shader instruction"},
187 {"QPU", "QPU-total-active-clk-cycles-fragment-shading", "[QPU] Total active clock cycles for all QPUs doing fragment shading (counts only when QPU is not stalled)"},
188 {"QPU", "QPU-stalls", "[QPU] Stalled qcycles executing shader instruction"},
189 {"QPU", "QPU-total-clk-cycles-waiting-fragment-shading", "[QPU] Total stalled clock cycles for all QPUs doing fragment shading"},
190 {"QPU", "QPU-stalls-TMU", "[QPU] Stalled qcycles waiting for TMU"},
191 {"QPU", "QPU-stalls-TLB", "[QPU] Stalled qcycles waiting for TLB"},
192 {"QPU", "QPU-stalls-VPM", "[QPU] Stalled qcycles waiting for VPM"},
193 {"QPU", "QPU-stalls-uniforms", "[QPU] Stalled qcycles waiting for uniforms"},
194 {"QPU", "QPU-stalls-SFU", "[QPU] Stalled qcycles waiting for SFU"},
195 {"QPU", "QPU-stalls-other", "[QPU] Stalled qcycles waiting for any other reason (vary/W/Z)"},
196};
197
12void v3d_perfmon_get(struct v3d_perfmon *perfmon)198void v3d_perfmon_get(struct v3d_perfmon *perfmon)
13{199{
14 if (perfmon)200 if (perfmon)
@@ -234,15 +420,21 @@ int v3d_perfmon_get_counter_ioctl(struct drm_device *dev, void *data, · 219 unmodified lines
234 if (req->counter >= v3d->max_counters)420 if (req->counter >= v3d->max_counters)
235 return -EINVAL;421 return -EINVAL;
236 422
237 if (v3d->ver >= 71) {423 BUILD_BUG_ON(ARRAY_SIZE(v3d_v42_performance_counters) !=
238 WARN_ON(v3d->max_counters != ARRAY_SIZE(v3d_v71_performance_counters));424 V3D_V42_NUM_PERFCOUNTERS);
425 BUILD_BUG_ON(ARRAY_SIZE(v3d_v71_performance_counters) !=
426 V3D_V71_NUM_PERFCOUNTERS);
427 BUILD_BUG_ON(V3D_MAX_COUNTERS < V3D_V42_NUM_PERFCOUNTERS);
428 BUILD_BUG_ON(V3D_MAX_COUNTERS < V3D_V71_NUM_PERFCOUNTERS);
429 BUILD_BUG_ON((V3D_MAX_COUNTERS != V3D_V42_NUM_PERFCOUNTERS) &&
430 (V3D_MAX_COUNTERS != V3D_V71_NUM_PERFCOUNTERS));
431
432 if (v3d->ver >= 71)
239 counter = &v3d_v71_performance_counters[req->counter];433 counter = &v3d_v71_performance_counters[req->counter];
240 } else if (v3d->ver >= 42) {434 else if (v3d->ver >= 42)
241 WARN_ON(v3d->max_counters != ARRAY_SIZE(v3d_v42_performance_counters));
242 counter = &v3d_v42_performance_counters[req->counter];435 counter = &v3d_v42_performance_counters[req->counter];
243 } else {436 else
244 return -EOPNOTSUPP;437 return -EOPNOTSUPP;
245 }
246 438
247 strscpy(req->name, counter->name, sizeof(req->name));439 strscpy(req->name, counter->name, sizeof(req->name));
248 strscpy(req->category, counter->category, sizeof(req->category));440 strscpy(req->category, counter->category, sizeof(req->category));
drivers/gpu/drm/v3d/v3d_performance_counters.h+5−184
@@ -19,190 +19,11 @@ struct v3d_perf_counter_desc { · 18 unmodified lines
19 char description[256];19 char description[256];
20};20};
21 21
22static const struct v3d_perf_counter_desc v3d_v71_performance_counters[] = {
23 {"CORE", "cycle-count", "[CORE] Cycle counter"},
24 {"CORE", "core-active", "[CORE] Bin/Render/Compute active cycles"},
25 {"CLE", "CLE-bin-thread-active-cycles", "[CLE] Bin thread active cycles"},
26 {"CLE", "CLE-render-thread-active-cycles", "[CLE] Render thread active cycles"},
27 {"CORE", "compute-active-cycles", "[CORE] Compute active cycles"},
28 {"FEP", "FEP-valid-primitives-no-rendered-pixels", "[FEP] Valid primitives that result in no rendered pixels, for all rendered tiles"},
29 {"FEP", "FEP-valid-primitives-rendered-pixels", "[FEP] Valid primitives for all rendered tiles (primitives may be counted in more than one tile)"},
30 {"FEP", "FEP-clipped-quads", "[FEP] Early-Z/Near/Far clipped quads"},
31 {"FEP", "FEP-valid-quads", "[FEP] Valid quads"},
32 {"TLB", "TLB-quads-not-passing-stencil-test", "[TLB] Quads with no pixels passing the stencil test"},
33 {"TLB", "TLB-quads-not-passing-z-and-stencil-test", "[TLB] Quads with no pixels passing the Z and stencil tests"},
34 {"TLB", "TLB-quads-passing-z-and-stencil-test", "[TLB] Quads with any pixels passing the Z and stencil tests"},
35 {"TLB", "TLB-quads-written-to-color-buffer", "[TLB] Quads with valid pixels written to colour buffer"},
36 {"TLB", "TLB-partial-quads-written-to-color-buffer", "[TLB] Partial quads written to the colour buffer"},
37 {"PTB", "PTB-primitives-need-clipping", "[PTB] Primitives that need clipping"},
38 {"PTB", "PTB-primitives-discarded-outside-viewport", "[PTB] Primitives discarded by being outside the viewport"},
39 {"PTB", "PTB-primitives-binned", "[PTB] Total primitives binned"},
40 {"PTB", "PTB-primitives-discarded-reversed", "[PTB] Primitives that are discarded because they are reversed"},
41 {"QPU", "QPU-total-instr-cache-hit", "[QPU] Total instruction cache hits for all slices"},
42 {"QPU", "QPU-total-instr-cache-miss", "[QPU] Total instruction cache misses for all slices"},
43 {"QPU", "QPU-total-uniform-cache-hit", "[QPU] Total uniforms cache hits for all slices"},
44 {"QPU", "QPU-total-uniform-cache-miss", "[QPU] Total uniforms cache misses for all slices"},
45 {"TMU", "TMU-active-cycles", "[TMU] Active cycles"},
46 {"TMU", "TMU-stalled-cycles", "[TMU] Stalled cycles"},
47 {"TMU", "TMU-total-text-quads-access", "[TMU] Total texture cache accesses"},
48 {"TMU", "TMU-cache-x4-active-cycles", "[TMU] Cache active cycles for x4 access"},
49 {"TMU", "TMU-cache-x4-stalled-cycles", "[TMU] Cache stalled cycles for x4 access"},
50 {"TMU", "TMU-total-text-quads-x4-access", "[TMU] Total texture cache x4 access"},
51 {"L2T", "L2T-total-cache-hit", "[L2T] Total Level 2 cache hits"},
52 {"L2T", "L2T-total-cache-miss", "[L2T] Total Level 2 cache misses"},
53 {"L2T", "L2T-local", "[L2T] Local mode access"},
54 {"L2T", "L2T-writeback", "[L2T] Writeback"},
55 {"L2T", "L2T-zero", "[L2T] Zero"},
56 {"L2T", "L2T-merge", "[L2T] Merge"},
57 {"L2T", "L2T-fill", "[L2T] Fill"},
58 {"L2T", "L2T-stalls-no-wid", "[L2T] Stalls because no WID available"},
59 {"L2T", "L2T-stalls-no-rid", "[L2T] Stalls because no RID available"},
60 {"L2T", "L2T-stalls-queue-full", "[L2T] Stalls because internal queue full"},
61 {"L2T", "L2T-stalls-wrightback", "[L2T] Stalls because writeback in flight"},
62 {"L2T", "L2T-stalls-mem", "[L2T] Stalls because AXI blocks read"},
63 {"L2T", "L2T-stalls-fill", "[L2T] Stalls because fill pending for victim cache-line"},
64 {"L2T", "L2T-hitq", "[L2T] Sent request via hit queue"},
65 {"L2T", "L2T-hitq-full", "[L2T] Sent request via main queue because hit queue is full"},
66 {"L2T", "L2T-stalls-read-data", "[L2T] Stalls because waiting for data from SDRAM"},
67 {"L2T", "L2T-TMU-read-hits", "[L2T] TMU read hits"},
68 {"L2T", "L2T-TMU-read-miss", "[L2T] TMU read misses"},
69 {"L2T", "L2T-VCD-read-hits", "[L2T] VCD read hits"},
70 {"L2T", "L2T-VCD-read-miss", "[L2T] VCD read misses"},
71 {"L2T", "L2T-SLC-read-hits", "[L2T] SLC read hits (all slices)"},
72 {"L2T", "L2T-SLC-read-miss", "[L2T] SLC read misses (all slices)"},
73 {"AXI", "AXI-writes-seen-watch-0", "[AXI] Writes seen by watch 0"},
74 {"AXI", "AXI-reads-seen-watch-0", "[AXI] Reads seen by watch 0"},
75 {"AXI", "AXI-writes-stalled-seen-watch-0", "[AXI] Write stalls seen by watch 0"},
76 {"AXI", "AXI-reads-stalled-seen-watch-0", "[AXI] Read stalls seen by watch 0"},
77 {"AXI", "AXI-write-bytes-seen-watch-0", "[AXI] Total bytes written seen by watch 0"},
78 {"AXI", "AXI-read-bytes-seen-watch-0", "[AXI] Total bytes read seen by watch 0"},
79 {"AXI", "AXI-writes-seen-watch-1", "[AXI] Writes seen by watch 1"},
80 {"AXI", "AXI-reads-seen-watch-1", "[AXI] Reads seen by watch 1"},
81 {"AXI", "AXI-writes-stalled-seen-watch-1", "[AXI] Write stalls seen by watch 1"},
82 {"AXI", "AXI-reads-stalled-seen-watch-1", "[AXI] Read stalls seen by watch 1"},
83 {"AXI", "AXI-write-bytes-seen-watch-1", "[AXI] Total bytes written seen by watch 1"},
84 {"AXI", "AXI-read-bytes-seen-watch-1", "[AXI] Total bytes read seen by watch 1"},
85 {"CORE", "core-memory-writes", "[CORE] Total memory writes"},
86 {"L2T", "L2T-memory-writes", "[L2T] Total memory writes"},
87 {"PTB", "PTB-memory-writes", "[PTB] Total memory writes"},
88 {"TLB", "TLB-memory-writes", "[TLB] Total memory writes"},
89 {"CORE", "core-memory-reads", "[CORE] Total memory reads"},
90 {"L2T", "L2T-memory-reads", "[L2T] Total memory reads"},
91 {"PTB", "PTB-memory-reads", "[PTB] Total memory reads"},
92 {"PSE", "PSE-memory-reads", "[PSE] Total memory reads"},
93 {"TLB", "TLB-memory-reads", "[TLB] Total memory reads"},
94 {"PTB", "PTB-memory-words-writes", "[PTB] Total memory words written"},
95 {"TLB", "TLB-memory-words-writes", "[TLB] Total memory words written"},
96 {"PSE", "PSE-memory-words-reads", "[PSE] Total memory words read"},
97 {"TLB", "TLB-memory-words-reads", "[TLB] Total memory words read"},
98 {"AXI", "AXI-read-trans", "[AXI] Read transaction count"},
99 {"AXI", "AXI-write-trans", "[AXI] Write transaction count"},
100 {"AXI", "AXI-read-wait-cycles", "[AXI] Read total wait cycles"},
101 {"AXI", "AXI-write-wait-cycles", "[AXI] Write total wait cycles"},
102 {"AXI", "AXI-max-outstanding-reads", "[AXI] Maximum outstanding read transactions"},
103 {"AXI", "AXI-max-outstanding-writes", "[AXI] Maximum outstanding write transactions"},
104 {"QPU", "QPU-wait-bubble", "[QPU] Pipeline bubble in qcycles due all threads waiting"},
105 {"QPU", "QPU-ic-miss-bubble", "[QPU] Pipeline bubble in qcycles due instruction-cache miss"},
106 {"QPU", "QPU-active", "[QPU] Executed shader instruction"},
107 {"QPU", "QPU-total-active-clk-cycles-fragment-shading", "[QPU] Total active clock cycles for all QPUs doing fragment shading (counts only when QPU is not stalled)"},
108 {"QPU", "QPU-stalls", "[QPU] Stalled qcycles executing shader instruction"},
109 {"QPU", "QPU-total-clk-cycles-waiting-fragment-shading", "[QPU] Total stalled clock cycles for all QPUs doing fragment shading"},
110 {"QPU", "QPU-stalls-TMU", "[QPU] Stalled qcycles waiting for TMU"},
111 {"QPU", "QPU-stalls-TLB", "[QPU] Stalled qcycles waiting for TLB"},
112 {"QPU", "QPU-stalls-VPM", "[QPU] Stalled qcycles waiting for VPM"},
113 {"QPU", "QPU-stalls-uniforms", "[QPU] Stalled qcycles waiting for uniforms"},
114 {"QPU", "QPU-stalls-SFU", "[QPU] Stalled qcycles waiting for SFU"},
115 {"QPU", "QPU-stalls-other", "[QPU] Stalled qcycles waiting for any other reason (vary/W/Z)"},
116};
117 22
118static const struct v3d_perf_counter_desc v3d_v42_performance_counters[] = {23#define V3D_V42_NUM_PERFCOUNTERS (87)
119 {"FEP", "FEP-valid-primitives-no-rendered-pixels", "[FEP] Valid primitives that result in no rendered pixels, for all rendered tiles"},24#define V3D_V71_NUM_PERFCOUNTERS (93)
120 {"FEP", "FEP-valid-primitives-rendered-pixels", "[FEP] Valid primitives for all rendered tiles (primitives may be counted in more than one tile)"},25
121 {"FEP", "FEP-clipped-quads", "[FEP] Early-Z/Near/Far clipped quads"},26/* Maximum number of performance counters supported by any version of V3D */
122 {"FEP", "FEP-valid-quads", "[FEP] Valid quads"},27#define V3D_MAX_COUNTERS (93)
123 {"TLB", "TLB-quads-not-passing-stencil-test", "[TLB] Quads with no pixels passing the stencil test"},
124 {"TLB", "TLB-quads-not-passing-z-and-stencil-test", "[TLB] Quads with no pixels passing the Z and stencil tests"},
125 {"TLB", "TLB-quads-passing-z-and-stencil-test", "[TLB] Quads with any pixels passing the Z and stencil tests"},
126 {"TLB", "TLB-quads-with-zero-coverage", "[TLB] Quads with all pixels having zero coverage"},
127 {"TLB", "TLB-quads-with-non-zero-coverage", "[TLB] Quads with any pixels having non-zero coverage"},
128 {"TLB", "TLB-quads-written-to-color-buffer", "[TLB] Quads with valid pixels written to colour buffer"},
129 {"PTB", "PTB-primitives-discarded-outside-viewport", "[PTB] Primitives discarded by being outside the viewport"},
130 {"PTB", "PTB-primitives-need-clipping", "[PTB] Primitives that need clipping"},
131 {"PTB", "PTB-primitives-discarded-reversed", "[PTB] Primitives that are discarded because they are reversed"},
132 {"QPU", "QPU-total-idle-clk-cycles", "[QPU] Total idle clock cycles for all QPUs"},
133 {"QPU", "QPU-total-active-clk-cycles-vertex-coord-shading", "[QPU] Total active clock cycles for all QPUs doing vertex/coordinate/user shading (counts only when QPU is not stalled)"},
134 {"QPU", "QPU-total-active-clk-cycles-fragment-shading", "[QPU] Total active clock cycles for all QPUs doing fragment shading (counts only when QPU is not stalled)"},
135 {"QPU", "QPU-total-clk-cycles-executing-valid-instr", "[QPU] Total clock cycles for all QPUs executing valid instructions"},
136 {"QPU", "QPU-total-clk-cycles-waiting-TMU", "[QPU] Total clock cycles for all QPUs stalled waiting for TMUs only (counter won't increment if QPU also stalling for another reason)"},
137 {"QPU", "QPU-total-clk-cycles-waiting-scoreboard", "[QPU] Total clock cycles for all QPUs stalled waiting for Scoreboard only (counter won't increment if QPU also stalling for another reason)"},
138 {"QPU", "QPU-total-clk-cycles-waiting-varyings", "[QPU] Total clock cycles for all QPUs stalled waiting for Varyings only (counter won't increment if QPU also stalling for another reason)"},
139 {"QPU", "QPU-total-instr-cache-hit", "[QPU] Total instruction cache hits for all slices"},
140 {"QPU", "QPU-total-instr-cache-miss", "[QPU] Total instruction cache misses for all slices"},
141 {"QPU", "QPU-total-uniform-cache-hit", "[QPU] Total uniforms cache hits for all slices"},
142 {"QPU", "QPU-total-uniform-cache-miss", "[QPU] Total uniforms cache misses for all slices"},
143 {"TMU", "TMU-total-text-quads-access", "[TMU] Total texture cache accesses"},
144 {"TMU", "TMU-total-text-cache-miss", "[TMU] Total texture cache misses (number of fetches from memory/L2cache)"},
145 {"VPM", "VPM-total-clk-cycles-VDW-stalled", "[VPM] Total clock cycles VDW is stalled waiting for VPM access"},
146 {"VPM", "VPM-total-clk-cycles-VCD-stalled", "[VPM] Total clock cycles VCD is stalled waiting for VPM access"},
147 {"CLE", "CLE-bin-thread-active-cycles", "[CLE] Bin thread active cycles"},
148 {"CLE", "CLE-render-thread-active-cycles", "[CLE] Render thread active cycles"},
149 {"L2T", "L2T-total-cache-hit", "[L2T] Total Level 2 cache hits"},
150 {"L2T", "L2T-total-cache-miss", "[L2T] Total Level 2 cache misses"},
151 {"CORE", "cycle-count", "[CORE] Cycle counter"},
152 {"QPU", "QPU-total-clk-cycles-waiting-vertex-coord-shading", "[QPU] Total stalled clock cycles for all QPUs doing vertex/coordinate/user shading"},
153 {"QPU", "QPU-total-clk-cycles-waiting-fragment-shading", "[QPU] Total stalled clock cycles for all QPUs doing fragment shading"},
154 {"PTB", "PTB-primitives-binned", "[PTB] Total primitives binned"},
155 {"AXI", "AXI-writes-seen-watch-0", "[AXI] Writes seen by watch 0"},
156 {"AXI", "AXI-reads-seen-watch-0", "[AXI] Reads seen by watch 0"},
157 {"AXI", "AXI-writes-stalled-seen-watch-0", "[AXI] Write stalls seen by watch 0"},
158 {"AXI", "AXI-reads-stalled-seen-watch-0", "[AXI] Read stalls seen by watch 0"},
159 {"AXI", "AXI-write-bytes-seen-watch-0", "[AXI] Total bytes written seen by watch 0"},
160 {"AXI", "AXI-read-bytes-seen-watch-0", "[AXI] Total bytes read seen by watch 0"},
161 {"AXI", "AXI-writes-seen-watch-1", "[AXI] Writes seen by watch 1"},
162 {"AXI", "AXI-reads-seen-watch-1", "[AXI] Reads seen by watch 1"},
163 {"AXI", "AXI-writes-stalled-seen-watch-1", "[AXI] Write stalls seen by watch 1"},
164 {"AXI", "AXI-reads-stalled-seen-watch-1", "[AXI] Read stalls seen by watch 1"},
165 {"AXI", "AXI-write-bytes-seen-watch-1", "[AXI] Total bytes written seen by watch 1"},
166 {"AXI", "AXI-read-bytes-seen-watch-1", "[AXI] Total bytes read seen by watch 1"},
167 {"TLB", "TLB-partial-quads-written-to-color-buffer", "[TLB] Partial quads written to the colour buffer"},
168 {"TMU", "TMU-total-config-access", "[TMU] Total config accesses"},
169 {"L2T", "L2T-no-id-stalled", "[L2T] No ID stall"},
170 {"L2T", "L2T-command-queue-stalled", "[L2T] Command queue full stall"},
171 {"L2T", "L2T-TMU-writes", "[L2T] TMU write accesses"},
172 {"TMU", "TMU-active-cycles", "[TMU] Active cycles"},
173 {"TMU", "TMU-stalled-cycles", "[TMU] Stalled cycles"},
174 {"CLE", "CLE-thread-active-cycles", "[CLE] Bin or render thread active cycles"},
175 {"L2T", "L2T-TMU-reads", "[L2T] TMU read accesses"},
176 {"L2T", "L2T-CLE-reads", "[L2T] CLE read accesses"},
177 {"L2T", "L2T-VCD-reads", "[L2T] VCD read accesses"},
178 {"L2T", "L2T-TMU-config-reads", "[L2T] TMU CFG read accesses"},
179 {"L2T", "L2T-SLC0-reads", "[L2T] SLC0 read accesses"},
180 {"L2T", "L2T-SLC1-reads", "[L2T] SLC1 read accesses"},
181 {"L2T", "L2T-SLC2-reads", "[L2T] SLC2 read accesses"},
182 {"L2T", "L2T-TMU-write-miss", "[L2T] TMU write misses"},
183 {"L2T", "L2T-TMU-read-miss", "[L2T] TMU read misses"},
184 {"L2T", "L2T-CLE-read-miss", "[L2T] CLE read misses"},
185 {"L2T", "L2T-VCD-read-miss", "[L2T] VCD read misses"},
186 {"L2T", "L2T-TMU-config-read-miss", "[L2T] TMU CFG read misses"},
187 {"L2T", "L2T-SLC0-read-miss", "[L2T] SLC0 read misses"},
188 {"L2T", "L2T-SLC1-read-miss", "[L2T] SLC1 read misses"},
189 {"L2T", "L2T-SLC2-read-miss", "[L2T] SLC2 read misses"},
190 {"CORE", "core-memory-writes", "[CORE] Total memory writes"},
191 {"L2T", "L2T-memory-writes", "[L2T] Total memory writes"},
192 {"PTB", "PTB-memory-writes", "[PTB] Total memory writes"},
193 {"TLB", "TLB-memory-writes", "[TLB] Total memory writes"},
194 {"CORE", "core-memory-reads", "[CORE] Total memory reads"},
195 {"L2T", "L2T-memory-reads", "[L2T] Total memory reads"},
196 {"PTB", "PTB-memory-reads", "[PTB] Total memory reads"},
197 {"PSE", "PSE-memory-reads", "[PSE] Total memory reads"},
198 {"TLB", "TLB-memory-reads", "[TLB] Total memory reads"},
199 {"GMP", "GMP-memory-reads", "[GMP] Total memory reads"},
200 {"PTB", "PTB-memory-words-writes", "[PTB] Total memory words written"},
201 {"TLB", "TLB-memory-words-writes", "[TLB] Total memory words written"},
202 {"PSE", "PSE-memory-words-reads", "[PSE] Total memory words read"},
203 {"TLB", "TLB-memory-words-reads", "[TLB] Total memory words read"},
204 {"TMU", "TMU-MRU-hits", "[TMU] Total MRU hits"},
205 {"CORE", "compute-active-cycles", "[CORE] Compute active cycles"},
206};
207 28
208#endif29#endif