Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mesa
Path: blob/21.2-virgl/src/freedreno/decode/cffdec.h
4565 views
1
/*
2
* Copyright (c) 2012 Rob Clark <[email protected]>
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 FROM,
20
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
* SOFTWARE.
22
*/
23
24
#ifndef __CFFDEC_H__
25
#define __CFFDEC_H__
26
27
#include <stdbool.h>
28
29
enum query_mode {
30
/* default mode, dump all queried regs on each draw: */
31
QUERY_ALL = 0,
32
33
/* only dump if any of the queried regs were written
34
* since last draw:
35
*/
36
QUERY_WRITTEN,
37
38
/* only dump if any of the queried regs changed since
39
* last draw:
40
*/
41
QUERY_DELTA,
42
};
43
44
struct cffdec_options {
45
unsigned gpu_id;
46
int draw_filter;
47
int color;
48
int dump_shaders;
49
int summary;
50
int allregs;
51
int dump_textures;
52
int decode_markers;
53
char *script;
54
55
int query_compare; /* binning vs SYSMEM/GMEM compare mode */
56
int query_mode; /* enum query_mode */
57
char **querystrs;
58
int nquery;
59
60
/* In "once" mode, only decode a cmdstream buffer once (per draw
61
* mode, in the case of a6xx+ where a single cmdstream buffer can
62
* be used for both binning and draw pass), rather than each time
63
* encountered (ie. once per tile/bin in GMEM draw passes)
64
*/
65
int once;
66
67
/* for crashdec, where we know CP_IBx_REM_SIZE, we can use this
68
* to highlight the cmdstream not parsed yet, to make it easier
69
* to see how far along the CP is.
70
*/
71
struct {
72
uint64_t base;
73
uint32_t rem;
74
} ibs[4];
75
};
76
77
void printl(int lvl, const char *fmt, ...);
78
const char *pktname(unsigned opc);
79
uint32_t regbase(const char *name);
80
const char *regname(uint32_t regbase, int color);
81
bool reg_written(uint32_t regbase);
82
uint32_t reg_lastval(uint32_t regbase);
83
uint32_t reg_val(uint32_t regbase);
84
void reg_set(uint32_t regbase, uint32_t val);
85
void reset_regs(void);
86
void cffdec_init(const struct cffdec_options *options);
87
void dump_register_val(uint32_t regbase, uint32_t dword, int level);
88
void dump_commands(uint32_t *dwords, uint32_t sizedwords, int level);
89
90
#endif /* __CFFDEC_H__ */
91
92