xref: /aosp_15_r20/external/mesa3d/src/freedreno/vulkan/tu_rmv.h (revision 6104692788411f58d303aa86923a9ff6ecaded22)
1 /*
2  * Copyright © 2024 Igalia S.L.
3  * SPDX-License-Identifier: MIT
4  */
5 
6 #ifndef TU_RMV_H
7 #define TU_RMV_H
8 
9 #include "tu_common.h"
10 
11 #include "rmv/vk_rmv_common.h"
12 
13 #define TU_RMV(func, device, ...) do { \
14       if (unlikely((device)->vk.memory_trace_data.is_enabled)) \
15          tu_rmv_log_##func(device, __VA_ARGS__); \
16    } while(0)
17 
18 void
19 tu_memory_trace_init(struct tu_device *device);
20 
21 void
22 tu_memory_trace_finish(struct tu_device *device);
23 
24 void
25 tu_rmv_log_heap_create(struct tu_device *device,
26                        const VkMemoryAllocateInfo *allocate_info,
27                        struct tu_device_memory *device_memory);
28 
29 void
30 tu_rmv_log_bo_allocate(struct tu_device *device, struct tu_bo *bo);
31 void
32 tu_rmv_log_bo_destroy(struct tu_device *device, struct tu_bo *bo);
33 void
34 tu_rmv_log_bo_map(struct tu_device *device, struct tu_bo *bo);
35 void
36 tu_rmv_log_bo_unmap(struct tu_device *device, struct tu_bo *bo);
37 
38 void
39 tu_rmv_log_buffer_create(struct tu_device *device, struct tu_buffer *buffer);
40 void
41 tu_rmv_log_buffer_destroy(struct tu_device *device, struct tu_buffer *buffer);
42 void
43 tu_rmv_log_buffer_bind(struct tu_device *device, struct tu_buffer *buffer);
44 
45 void
46 tu_rmv_log_image_create(struct tu_device *device, struct tu_image *image);
47 void
48 tu_rmv_log_image_destroy(struct tu_device *device, struct tu_image *image);
49 void
50 tu_rmv_log_image_bind(struct tu_device *device, struct tu_image *image);
51 
52 void
53 tu_rmv_log_cmd_buffer_bo_create(struct tu_device *device,
54                                 struct tu_bo *bo);
55 void
56 tu_rmv_log_cmd_buffer_suballoc_bo_create(struct tu_device *device,
57                                          struct tu_suballoc_bo *suballoc_bo);
58 void
59 tu_rmv_log_query_pool_create(struct tu_device *device,
60                              struct tu_query_pool *query_pool);
61 void
62 tu_rmv_log_descriptor_pool_create(struct tu_device *device,
63                                   const VkDescriptorPoolCreateInfo *create_info,
64                                   struct tu_descriptor_pool *descriptor_pool);
65 void
66 tu_rmv_log_graphics_pipeline_create(struct tu_device *device,
67                                     struct tu_graphics_pipeline *graphics_pipeline);
68 void
69 tu_rmv_log_compute_pipeline_create(struct tu_device *device,
70                                    struct tu_compute_pipeline *compute_pipeline);
71 void
72 tu_rmv_log_event_create(struct tu_device *device,
73                         const VkEventCreateInfo *create_info,
74                         struct tu_event *event);
75 
76 void
77 tu_rmv_log_internal_resource_create(struct tu_device *device, struct tu_bo *bo);
78 void
79 tu_rmv_log_resource_name(struct tu_device *device, const void *resource,
80                          const char *resource_name);
81 void
82 tu_rmv_log_resource_destroy(struct tu_device *device, const void *resource);
83 
84 #endif /* TU_RMV_H */
85