From e7ee2c8ca51107716dea3368c128bcdc39d5e90d Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Thu, 25 Jan 2024 15:25:02 -0800 Subject: [PATCH] tu: Give suballoc bo's a name So they show up in gem debugfs with a more useful label. Signed-off-by: Rob Clark Part-of: --- src/freedreno/vulkan/tu_device.cc | 6 +++--- src/freedreno/vulkan/tu_suballoc.cc | 6 ++++-- src/freedreno/vulkan/tu_suballoc.h | 5 ++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/freedreno/vulkan/tu_device.cc b/src/freedreno/vulkan/tu_device.cc index 048dc486273..8a2c961efc3 100644 --- a/src/freedreno/vulkan/tu_device.cc +++ b/src/freedreno/vulkan/tu_device.cc @@ -2277,12 +2277,12 @@ tu_CreateDevice(VkPhysicalDevice physicalDevice, tu_bo_suballocator_init( &device->pipeline_suballoc, device, 128 * 1024, - (enum tu_bo_alloc_flags) (TU_BO_ALLOC_GPU_READ_ONLY | TU_BO_ALLOC_ALLOW_DUMP)); + (enum tu_bo_alloc_flags) (TU_BO_ALLOC_GPU_READ_ONLY | TU_BO_ALLOC_ALLOW_DUMP), "pipeline_suballoc"); tu_bo_suballocator_init(&device->autotune_suballoc, device, - 128 * 1024, TU_BO_ALLOC_NO_FLAGS); + 128 * 1024, TU_BO_ALLOC_NO_FLAGS, "autotune_suballoc"); if (is_kgsl(physical_device->instance)) { tu_bo_suballocator_init(&device->kgsl_profiling_suballoc, device, - 128 * 1024, TU_BO_ALLOC_NO_FLAGS); + 128 * 1024, TU_BO_ALLOC_NO_FLAGS, "kgsl_profiling_suballoc"); } result = tu_bo_init_new(device, &device->global_bo, global_size, diff --git a/src/freedreno/vulkan/tu_suballoc.cc b/src/freedreno/vulkan/tu_suballoc.cc index 585ffe87a5f..b45559b6164 100644 --- a/src/freedreno/vulkan/tu_suballoc.cc +++ b/src/freedreno/vulkan/tu_suballoc.cc @@ -28,13 +28,15 @@ void tu_bo_suballocator_init(struct tu_suballocator *suballoc, struct tu_device *dev, uint32_t default_size, - enum tu_bo_alloc_flags flags) + enum tu_bo_alloc_flags flags, + const char *name) { suballoc->dev = dev; suballoc->default_size = default_size; suballoc->flags = flags; suballoc->bo = NULL; suballoc->cached_bo = NULL; + suballoc->name = name; } void @@ -82,7 +84,7 @@ tu_suballoc_bo_alloc(struct tu_suballoc_bo *suballoc_bo, if (!suballoc->bo) { VkResult result = tu_bo_init_new(suballoc->dev, &suballoc->bo, alloc_size, - suballoc->flags, "suballoc"); + suballoc->flags, suballoc->name); if (result != VK_SUCCESS) return result; } diff --git a/src/freedreno/vulkan/tu_suballoc.h b/src/freedreno/vulkan/tu_suballoc.h index 6ed131738ef..0c82d0b62d1 100644 --- a/src/freedreno/vulkan/tu_suballoc.h +++ b/src/freedreno/vulkan/tu_suballoc.h @@ -28,6 +28,8 @@ struct tu_suballocator /** Optional BO cached for recycling as the next suballoc->bo, instead of having to allocate one. */ struct tu_bo *cached_bo; + + const char *name; }; struct tu_suballoc_bo @@ -41,7 +43,8 @@ void tu_bo_suballocator_init(struct tu_suballocator *suballoc, struct tu_device *dev, uint32_t default_size, - enum tu_bo_alloc_flags flags); + enum tu_bo_alloc_flags flags, + const char *name); void tu_bo_suballocator_finish(struct tu_suballocator *suballoc);