radv: add radv_rmv.h

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28551>
This commit is contained in:
Samuel Pitoiset 2024-04-02 14:05:21 +02:00 committed by Marge Bot
parent e677b642bc
commit 195383a5ec
17 changed files with 110 additions and 35 deletions

View file

@ -150,6 +150,7 @@ libradv_files = files(
'radv_queue.h',
'radv_radeon_winsys.h',
'radv_rmv.c',
'radv_rmv.h',
'radv_rra.c',
'radv_rra.h',
'radv_sampler.c',

View file

@ -28,6 +28,7 @@
#include "radv_buffer.h"
#include "radv_device_memory.h"
#include "radv_private.h"
#include "radv_rmv.h"
#include "vk_common_entrypoints.h"
#include "vk_debug_utils.h"

View file

@ -34,6 +34,7 @@
#include "radv_pipeline_rt.h"
#include "radv_private.h"
#include "radv_radeon_winsys.h"
#include "radv_rmv.h"
#include "radv_shader.h"
#include "radv_shader_object.h"
#include "radv_sqtt.h"

View file

@ -32,6 +32,7 @@
#include "radv_image.h"
#include "radv_image_view.h"
#include "radv_private.h"
#include "radv_rmv.h"
#include "radv_sampler.h"
#include "sid.h"
#include "vk_acceleration_structure.h"

View file

@ -50,6 +50,7 @@
#include "radv_debug.h"
#include "radv_formats.h"
#include "radv_private.h"
#include "radv_rmv.h"
#include "radv_shader.h"
#include "radv_spm.h"
#include "radv_sqtt.h"

View file

@ -29,6 +29,7 @@
#include "radv_buffer.h"
#include "radv_image.h"
#include "radv_private.h"
#include "radv_rmv.h"
void
radv_device_memory_init(struct radv_device_memory *mem, struct radv_device *device, struct radeon_winsys_bo *bo)

View file

@ -25,9 +25,10 @@
* IN THE SOFTWARE.
*/
#include "radv_buffer.h"
#include "radv_event.h"
#include "radv_buffer.h"
#include "radv_private.h"
#include "radv_rmv.h"
static void
radv_destroy_event(struct radv_device *device, const VkAllocationCallbacks *pAllocator, struct radv_event *event)

View file

@ -37,6 +37,7 @@
#include "radv_image_view.h"
#include "radv_private.h"
#include "radv_radeon_winsys.h"
#include "radv_rmv.h"
#include "radv_video.h"
#include "sid.h"
#include "vk_debug_utils.h"

View file

@ -39,6 +39,7 @@
#include "radv_debug.h"
#include "radv_pipeline_rt.h"
#include "radv_private.h"
#include "radv_rmv.h"
#include "radv_shader.h"
#include "radv_shader_args.h"
#include "vk_pipeline.h"

View file

@ -39,6 +39,7 @@
#include "radv_debug.h"
#include "radv_pipeline_cache.h"
#include "radv_private.h"
#include "radv_rmv.h"
#include "radv_shader.h"
#include "radv_shader_args.h"
#include "vk_nir_convert_ycbcr.h"

View file

@ -40,6 +40,7 @@
#include "radv_formats.h"
#include "radv_pipeline_cache.h"
#include "radv_private.h"
#include "radv_rmv.h"
#include "radv_shader.h"
#include "radv_shader_args.h"
#include "vk_nir_convert_ycbcr.h"

View file

@ -29,6 +29,7 @@
#include "radv_pipeline_cache.h"
#include "radv_pipeline_rt.h"
#include "radv_private.h"
#include "radv_rmv.h"
#include "radv_shader.h"
struct rt_handle_hash_entry {

View file

@ -65,9 +65,6 @@
#include "vk_util.h"
#include "vk_ycbcr_conversion.h"
#include "rmv/vk_rmv_common.h"
#include "rmv/vk_rmv_tokens.h"
#include "ac_binary.h"
#include "ac_gpu_info.h"
#include "ac_shader_util.h"
@ -321,37 +318,6 @@ void llvm_compile_shader(const struct radv_nir_compiler_options *options, const
unsigned shader_count, struct nir_shader *const *shaders, struct radv_shader_binary **binary,
const struct radv_shader_args *args);
void radv_memory_trace_init(struct radv_device *device);
void radv_rmv_log_bo_allocate(struct radv_device *device, struct radeon_winsys_bo *bo, bool is_internal);
void radv_rmv_log_bo_destroy(struct radv_device *device, struct radeon_winsys_bo *bo);
void radv_rmv_log_heap_create(struct radv_device *device, VkDeviceMemory heap, bool is_internal,
VkMemoryAllocateFlags alloc_flags);
void radv_rmv_log_buffer_bind(struct radv_device *device, VkBuffer _buffer);
void radv_rmv_log_image_create(struct radv_device *device, const VkImageCreateInfo *create_info, bool is_internal,
VkImage _image);
void radv_rmv_log_image_bind(struct radv_device *device, VkImage _image);
void radv_rmv_log_query_pool_create(struct radv_device *device, VkQueryPool pool);
void radv_rmv_log_command_buffer_bo_create(struct radv_device *device, struct radeon_winsys_bo *bo,
uint32_t executable_size, uint32_t data_size, uint32_t scratch_size);
void radv_rmv_log_command_buffer_bo_destroy(struct radv_device *device, struct radeon_winsys_bo *bo);
void radv_rmv_log_border_color_palette_create(struct radv_device *device, struct radeon_winsys_bo *bo);
void radv_rmv_log_border_color_palette_destroy(struct radv_device *device, struct radeon_winsys_bo *bo);
void radv_rmv_log_sparse_add_residency(struct radv_device *device, struct radeon_winsys_bo *src_bo, uint64_t offset);
void radv_rmv_log_sparse_remove_residency(struct radv_device *device, struct radeon_winsys_bo *src_bo, uint64_t offset);
void radv_rmv_log_descriptor_pool_create(struct radv_device *device, const VkDescriptorPoolCreateInfo *create_info,
VkDescriptorPool pool);
void radv_rmv_log_graphics_pipeline_create(struct radv_device *device, struct radv_pipeline *pipeline,
bool is_internal);
void radv_rmv_log_compute_pipeline_create(struct radv_device *device, struct radv_pipeline *pipeline, bool is_internal);
void radv_rmv_log_rt_pipeline_create(struct radv_device *device, struct radv_ray_tracing_pipeline *pipeline);
void radv_rmv_log_event_create(struct radv_device *device, VkEvent event, VkEventCreateFlags flags, bool is_internal);
void radv_rmv_log_resource_destroy(struct radv_device *device, uint64_t handle);
void radv_rmv_log_submit(struct radv_device *device, enum amd_ip_type type);
void radv_rmv_fill_device_info(const struct radv_physical_device *pdev, struct vk_rmv_device_info *info);
void radv_rmv_collect_trace_events(struct radv_device *device);
void radv_memory_trace_finish(struct radv_device *device);
/*
* Queue helper to get ring.
* placed here as it needs queue + device structs.

View file

@ -37,6 +37,7 @@
#include "radv_perfcounter.h"
#include "radv_private.h"
#include "radv_query.h"
#include "radv_rmv.h"
#include "sid.h"
#include "vk_acceleration_structure.h"
#include "vk_common_entrypoints.h"

View file

@ -32,6 +32,7 @@
#include "radv_device_memory.h"
#include "radv_image.h"
#include "radv_private.h"
#include "radv_rmv.h"
#include "vk_semaphore.h"
#include "vk_sync.h"

View file

@ -37,6 +37,7 @@
#include "radv_pipeline_rt.h"
#include "radv_private.h"
#include "radv_query.h"
#include "radv_rmv.h"
#define RADV_FTRACE_INSTANCE_PATH "/sys/kernel/tracing/instances/amd_rmv"

94
src/amd/vulkan/radv_rmv.h Normal file
View file

@ -0,0 +1,94 @@
/*
* Copyright © 2016 Red Hat.
* Copyright © 2016 Bas Nieuwenhuizen
*
* based in part on anv driver which is:
* Copyright © 2015 Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#ifndef RADV_RMV_H
#define RADV_RMV_H
#include "rmv/vk_rmv_common.h"
#include "rmv/vk_rmv_tokens.h"
#include "radv_radeon_winsys.h"
struct radv_device;
struct radv_physical_device;
struct radv_pipeline;
struct radv_ray_tracing_pipeline;
void radv_memory_trace_init(struct radv_device *device);
void radv_rmv_fill_device_info(const struct radv_physical_device *pdev, struct vk_rmv_device_info *info);
void radv_rmv_collect_trace_events(struct radv_device *device);
void radv_memory_trace_finish(struct radv_device *device);
void radv_rmv_log_heap_create(struct radv_device *device, VkDeviceMemory heap, bool is_internal,
VkMemoryAllocateFlags alloc_flags);
void radv_rmv_log_bo_allocate(struct radv_device *device, struct radeon_winsys_bo *bo, bool is_internal);
void radv_rmv_log_bo_destroy(struct radv_device *device, struct radeon_winsys_bo *bo);
void radv_rmv_log_buffer_bind(struct radv_device *device, VkBuffer _buffer);
void radv_rmv_log_image_create(struct radv_device *device, const VkImageCreateInfo *create_info, bool is_internal,
VkImage _image);
void radv_rmv_log_image_bind(struct radv_device *device, VkImage _image);
void radv_rmv_log_query_pool_create(struct radv_device *device, VkQueryPool pool);
void radv_rmv_log_command_buffer_bo_create(struct radv_device *device, struct radeon_winsys_bo *bo,
uint32_t executable_size, uint32_t data_size, uint32_t scratch_size);
void radv_rmv_log_command_buffer_bo_destroy(struct radv_device *device, struct radeon_winsys_bo *bo);
void radv_rmv_log_border_color_palette_create(struct radv_device *device, struct radeon_winsys_bo *bo);
void radv_rmv_log_border_color_palette_destroy(struct radv_device *device, struct radeon_winsys_bo *bo);
void radv_rmv_log_sparse_add_residency(struct radv_device *device, struct radeon_winsys_bo *src_bo, uint64_t offset);
void radv_rmv_log_sparse_remove_residency(struct radv_device *device, struct radeon_winsys_bo *src_bo, uint64_t offset);
void radv_rmv_log_descriptor_pool_create(struct radv_device *device, const VkDescriptorPoolCreateInfo *create_info,
VkDescriptorPool pool);
void radv_rmv_log_graphics_pipeline_create(struct radv_device *device, struct radv_pipeline *pipeline,
bool is_internal);
void radv_rmv_log_compute_pipeline_create(struct radv_device *device, struct radv_pipeline *pipeline, bool is_internal);
void radv_rmv_log_rt_pipeline_create(struct radv_device *device, struct radv_ray_tracing_pipeline *pipeline);
void radv_rmv_log_event_create(struct radv_device *device, VkEvent event, VkEventCreateFlags flags, bool is_internal);
void radv_rmv_log_submit(struct radv_device *device, enum amd_ip_type type);
void radv_rmv_log_resource_destroy(struct radv_device *device, uint64_t handle);
#endif /* RADV_RMV_H */