2
* Copyright © 2021 Google, Inc.
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 FROM,
20
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
#ifndef FREEDRENO_PERFETTO_H_
25
#define FREEDRENO_PERFETTO_H_
37
SURFACE_STAGE_ID, /* Surface is a sort of meta-stage for render-target info */
43
CLEAR_RESTORE_STAGE_ID,
54
[SURFACE_STAGE_ID] = {"Surface"},
55
[BINNING_STAGE_ID] = {"Binning", "Perform Visibility pass and determine target bins"},
56
[GMEM_STAGE_ID] = {"Render", "Rendering to GMEM"},
57
[BYPASS_STAGE_ID] = {"Render", "Rendering to system memory"},
58
[BLIT_STAGE_ID] = {"Blit", "Performing a Blit operation"},
59
[COMPUTE_STAGE_ID] = {"Compute", "Compute job"},
60
[CLEAR_RESTORE_STAGE_ID] = {"Clear/Restore", "Clear (sysmem) or per-tile clear or restore (GMEM)"},
61
[RESOLVE_STAGE_ID] = {"Resolve", "Per tile resolve (GMEM to system memory"},
76
[DEFAULT_HW_QUEUE_ID] = {"GPU Queue 0", "Default Adreno Hardware Queue"},
80
* The u_trace tracepoints which are used to capture GPU timestamps and
81
* trigger perfetto events tend to come in begin/end pairs (ie. start
82
* and end of binning pass, etc), but perfetto wants one event for the
83
* whole pass. So we need to buffer up some state at the "begin" trae
84
* callback, and then emit the perfetto event at the "end" event based
85
* on previously recorded timestamp/data. This struct is where we can
86
* accumulate that state.
88
struct fd_perfetto_state {
89
uint64_t start_ts[NUM_STAGES];
92
* Surface state for the renderpass:
95
enum pipe_format cbuf0_format : 16;
96
enum pipe_format zs_format : 16;
104
// TODO # of draws and possibly estimated cost might be useful addition..
107
void fd_perfetto_init(void);
110
void fd_perfetto_submit(struct fd_context *ctx);
118
#endif /* FREEDRENO_PERFETTO_H_ */