Module: Mesa Branch: main Commit: 7b76e1f62cad88eec94a7cb4d3311fa5e03596f1 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7b76e1f62cad88eec94a7cb4d3311fa5e03596f1
Author: Yiwei Zhang <zzyi...@chromium.org> Date: Sat Sep 2 22:07:21 2023 -0700 venus: tiny refactor of device memory report interface Pass type and handle directly instead of vn_object_base to prepare for device level objects using corresponding common vk objects. Signed-off-by: Yiwei Zhang <zzyi...@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25184> --- src/virtio/vulkan/vn_device.h | 7 ++++--- src/virtio/vulkan/vn_device_memory.c | 3 ++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/virtio/vulkan/vn_device.h b/src/virtio/vulkan/vn_device.h index 913a13775cd..ac60c85ede0 100644 --- a/src/virtio/vulkan/vn_device.h +++ b/src/virtio/vulkan/vn_device.h @@ -61,7 +61,8 @@ vn_device_emit_device_memory_report(struct vn_device *dev, VkDeviceMemoryReportEventTypeEXT type, uint64_t mem_obj_id, VkDeviceSize size, - struct vn_object_base *obj, + VkObjectType obj_type, + uint64_t obj_handle, uint32_t heap_index) { assert(dev->memory_reports); @@ -70,8 +71,8 @@ vn_device_emit_device_memory_report(struct vn_device *dev, .type = type, .memoryObjectId = mem_obj_id, .size = size, - .objectType = obj->base.type, - .objectHandle = obj->id, + .objectType = obj_type, + .objectHandle = obj_handle, .heapIndex = heap_index, }; for (uint32_t i = 0; i < dev->memory_report_count; i++) diff --git a/src/virtio/vulkan/vn_device_memory.c b/src/virtio/vulkan/vn_device_memory.c index cfb32c7bee5..da618afc526 100644 --- a/src/virtio/vulkan/vn_device_memory.c +++ b/src/virtio/vulkan/vn_device_memory.c @@ -523,7 +523,8 @@ vn_device_memory_emit_report(struct vn_device *dev, const uint64_t mem_obj_id = mem->is_external ? mem->base_bo->res_id : mem->base.id; vn_device_emit_device_memory_report(dev, type, mem_obj_id, mem->size, - &mem->base, mem->type.heapIndex); + VK_OBJECT_TYPE_DEVICE_MEMORY, + mem->base.id, mem->type.heapIndex); } VkResult