Debian Codegraph @

src/panfrost/vulkan/panvk_utrace.h

raw
1 /*
2 * Copyright 2024 Google LLC
3 * SPDX-License-Identifier: MIT
4 */
5
6 #ifndef PANVK_UTRACE_H
7 #define PANVK_UTRACE_H
8
9 #include "util/perf/u_trace.h"
10
11 #include "panvk_macros.h"
12 #include "panvk_mempool.h"
13
14 struct panvk_device;
15 struct vk_sync;
16
17 struct panvk_utrace_flush_data {
18 uint32_t subqueue;
19
20 struct vk_sync *sync;
21 uint64_t wait_value;
22
23 struct panvk_utrace_buf *clone_cs_root;
24 bool free_self;
25 };
26
27 struct panvk_utrace_buf {
28 uint64_t dev;
29 uint64_t size;
30 void *host;
31 };
32
33 void *panvk_utrace_create_buffer(struct u_trace_context *utctx,
34 uint64_t size_B);
35
36 void panvk_utrace_delete_buffer(struct u_trace_context *utctx, void *buffer);
37
38 uint64_t panvk_utrace_read_ts(struct u_trace_context *utctx, void *timestamps,
39 uint64_t offset_B, uint32_t flags, void *flush_data);
40
41 const void *panvk_utrace_get_data(struct u_trace_context *utctx, void *buffer,
42 uint64_t offset_B, uint32_t size_B);
43
44 void panvk_utrace_delete_flush_data(struct u_trace_context *utctx,
45 void *flush_data);
46
47 #ifdef PAN_ARCH
48
49 #if PAN_ARCH >= 10
50
51 struct panvk_cmd_buffer;
52
53 struct panvk_utrace_cs_info {
54 struct panvk_cmd_buffer *cmdbuf;
55 struct cs_async_op *ts_async_op;
56 bool capture_data_wait_for_ts;
57 };
58
59 /* Special value indicating that an indirect capture should be of registers
60 * rather than an address. */
61 #define PANVK_UTRACE_CAPTURE_REGISTERS 0x1
62
63 VkResult
64 panvk_per_arch(utrace_context_init)(struct panvk_device *dev);
65
66 void panvk_per_arch(utrace_context_fini)(struct panvk_device *dev);
67
68 void panvk_per_arch(utrace_copy_buffer)(struct u_trace_context *utctx,
69 void *cmdstream, void *ts_from,
70 uint64_t from_offset, void *ts_to,
71 uint64_t to_offset, uint64_t size_B);
72
73 struct cs_builder;
74 struct cs_buffer;
75
76 void panvk_per_arch(utrace_clone_init_builder)(struct cs_builder *b,
77 struct panvk_device *dev,
78 const struct cs_buffer *cs_root);
79 void panvk_per_arch(utrace_clone_finish_builder)(struct cs_builder *b);
80
81 #else /* PAN_ARCH >= 10 */
82
83 static inline VkResult
84 panvk_per_arch(utrace_context_init)(struct panvk_device *dev)
85 {
86 return VK_SUCCESS;
87 }
88
89 static inline void
90 panvk_per_arch(utrace_context_fini)(struct panvk_device *dev)
91 {
92 }
93
94 #endif /* PAN_ARCH >= 10 */
95
96 #endif /* PAN_ARCH */
97
98 #endif /* PANVK_UTRACE_H */