xref: /third_party/mesa3d/src/amd/vulkan/radv_debug.h (revision bf215546)
1bf215546Sopenharmony_ci/*
2bf215546Sopenharmony_ci * Copyright © 2017 Google.
3bf215546Sopenharmony_ci *
4bf215546Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
5bf215546Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
6bf215546Sopenharmony_ci * to deal in the Software without restriction, including without limitation
7bf215546Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8bf215546Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
9bf215546Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
10bf215546Sopenharmony_ci *
11bf215546Sopenharmony_ci * The above copyright notice and this permission notice (including the next
12bf215546Sopenharmony_ci * paragraph) shall be included in all copies or substantial portions of the
13bf215546Sopenharmony_ci * Software.
14bf215546Sopenharmony_ci *
15bf215546Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16bf215546Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17bf215546Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18bf215546Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19bf215546Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20bf215546Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21bf215546Sopenharmony_ci * IN THE SOFTWARE.
22bf215546Sopenharmony_ci */
23bf215546Sopenharmony_ci
24bf215546Sopenharmony_ci#ifndef RADV_DEBUG_H
25bf215546Sopenharmony_ci#define RADV_DEBUG_H
26bf215546Sopenharmony_ci
27bf215546Sopenharmony_ci#include "radv_private.h"
28bf215546Sopenharmony_ci
29bf215546Sopenharmony_ci/* Please keep docs/envvars.rst up-to-date when you add/remove options. */
30bf215546Sopenharmony_cienum {
31bf215546Sopenharmony_ci   RADV_DEBUG_NO_FAST_CLEARS = 1ull << 0,
32bf215546Sopenharmony_ci   RADV_DEBUG_NO_DCC = 1ull << 1,
33bf215546Sopenharmony_ci   RADV_DEBUG_DUMP_SHADERS = 1ull << 2,
34bf215546Sopenharmony_ci   RADV_DEBUG_NO_CACHE = 1ull << 3,
35bf215546Sopenharmony_ci   RADV_DEBUG_DUMP_SHADER_STATS = 1ull << 4,
36bf215546Sopenharmony_ci   RADV_DEBUG_NO_HIZ = 1ull << 5,
37bf215546Sopenharmony_ci   RADV_DEBUG_NO_COMPUTE_QUEUE = 1ull << 6,
38bf215546Sopenharmony_ci   RADV_DEBUG_ALL_BOS = 1ull << 7,
39bf215546Sopenharmony_ci   RADV_DEBUG_NO_IBS = 1ull << 8,
40bf215546Sopenharmony_ci   RADV_DEBUG_DUMP_SPIRV = 1ull << 9,
41bf215546Sopenharmony_ci   RADV_DEBUG_VM_FAULTS = 1ull << 10,
42bf215546Sopenharmony_ci   RADV_DEBUG_ZERO_VRAM = 1ull << 11,
43bf215546Sopenharmony_ci   RADV_DEBUG_SYNC_SHADERS = 1ull << 12,
44bf215546Sopenharmony_ci   RADV_DEBUG_PREOPTIR = 1ull << 13,
45bf215546Sopenharmony_ci   RADV_DEBUG_NO_DYNAMIC_BOUNDS = 1ull << 14,
46bf215546Sopenharmony_ci   RADV_DEBUG_NO_OUT_OF_ORDER = 1ull << 15,
47bf215546Sopenharmony_ci   RADV_DEBUG_INFO = 1ull << 16,
48bf215546Sopenharmony_ci   RADV_DEBUG_STARTUP = 1ull << 17,
49bf215546Sopenharmony_ci   RADV_DEBUG_CHECKIR = 1ull << 18,
50bf215546Sopenharmony_ci   RADV_DEBUG_NOBINNING = 1ull << 19,
51bf215546Sopenharmony_ci   RADV_DEBUG_NO_NGG = 1ull << 20,
52bf215546Sopenharmony_ci   RADV_DEBUG_DUMP_META_SHADERS = 1ull << 21,
53bf215546Sopenharmony_ci   RADV_DEBUG_NO_MEMORY_CACHE = 1ull << 22,
54bf215546Sopenharmony_ci   RADV_DEBUG_DISCARD_TO_DEMOTE = 1ull << 23,
55bf215546Sopenharmony_ci   RADV_DEBUG_LLVM = 1ull << 24,
56bf215546Sopenharmony_ci   RADV_DEBUG_FORCE_COMPRESS = 1ull << 25,
57bf215546Sopenharmony_ci   RADV_DEBUG_HANG = 1ull << 26,
58bf215546Sopenharmony_ci   RADV_DEBUG_IMG = 1ull << 27,
59bf215546Sopenharmony_ci   RADV_DEBUG_NO_UMR = 1ull << 28,
60bf215546Sopenharmony_ci   RADV_DEBUG_INVARIANT_GEOM = 1ull << 29,
61bf215546Sopenharmony_ci   RADV_DEBUG_NO_DISPLAY_DCC = 1ull << 30,
62bf215546Sopenharmony_ci   RADV_DEBUG_NO_TC_COMPAT_CMASK = 1ull << 31,
63bf215546Sopenharmony_ci   RADV_DEBUG_NO_VRS_FLAT_SHADING = 1ull << 32,
64bf215546Sopenharmony_ci   RADV_DEBUG_NO_ATOC_DITHERING = 1ull << 33,
65bf215546Sopenharmony_ci   RADV_DEBUG_NO_NGGC = 1ull << 34,
66bf215546Sopenharmony_ci   RADV_DEBUG_DUMP_PROLOGS = 1ull << 35,
67bf215546Sopenharmony_ci   RADV_DEBUG_NO_DMA_BLIT = 1ull << 36,
68bf215546Sopenharmony_ci   RADV_DEBUG_SPLIT_FMA = 1ull << 37,
69bf215546Sopenharmony_ci   RADV_DEBUG_DUMP_EPILOGS = 1ull << 38,
70bf215546Sopenharmony_ci};
71bf215546Sopenharmony_ci
72bf215546Sopenharmony_cienum {
73bf215546Sopenharmony_ci   RADV_PERFTEST_LOCAL_BOS = 1u << 0,
74bf215546Sopenharmony_ci   RADV_PERFTEST_DCC_MSAA = 1u << 1,
75bf215546Sopenharmony_ci   RADV_PERFTEST_BO_LIST = 1u << 2,
76bf215546Sopenharmony_ci   RADV_PERFTEST_CS_WAVE_32 = 1u << 3,
77bf215546Sopenharmony_ci   RADV_PERFTEST_PS_WAVE_32 = 1u << 4,
78bf215546Sopenharmony_ci   RADV_PERFTEST_GE_WAVE_32 = 1u << 5,
79bf215546Sopenharmony_ci   RADV_PERFTEST_NO_SAM = 1u << 6,
80bf215546Sopenharmony_ci   RADV_PERFTEST_SAM = 1u << 7,
81bf215546Sopenharmony_ci   RADV_PERFTEST_RT = 1u << 8,
82bf215546Sopenharmony_ci   RADV_PERFTEST_NGGC = 1u << 9,
83bf215546Sopenharmony_ci   RADV_PERFTEST_EMULATE_RT = 1u << 10,
84bf215546Sopenharmony_ci   RADV_PERFTEST_NV_MS = 1u << 11,
85bf215546Sopenharmony_ci   RADV_PERFTEST_RT_WAVE_64 = 1u << 12,
86bf215546Sopenharmony_ci};
87bf215546Sopenharmony_ci
88bf215546Sopenharmony_cibool radv_init_trace(struct radv_device *device);
89bf215546Sopenharmony_civoid radv_finish_trace(struct radv_device *device);
90bf215546Sopenharmony_ci
91bf215546Sopenharmony_civoid radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_cmdbuf *cs);
92bf215546Sopenharmony_ci
93bf215546Sopenharmony_civoid radv_print_spirv(const char *data, uint32_t size, FILE *fp);
94bf215546Sopenharmony_ci
95bf215546Sopenharmony_civoid radv_dump_enabled_options(struct radv_device *device, FILE *f);
96bf215546Sopenharmony_ci
97bf215546Sopenharmony_cibool radv_trap_handler_init(struct radv_device *device);
98bf215546Sopenharmony_civoid radv_trap_handler_finish(struct radv_device *device);
99bf215546Sopenharmony_civoid radv_check_trap_handler(struct radv_queue *queue);
100bf215546Sopenharmony_ci
101bf215546Sopenharmony_ci#endif
102