hk: implement calibrated timestamps

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33682>
This commit is contained in:
Alyssa Rosenzweig
2025-01-10 13:59:13 -05:00
committed by Marge Bot
parent 9c704dd759
commit 5d9e600ce9
2 changed files with 11 additions and 4 deletions
+9 -2
View File
@@ -289,8 +289,7 @@ static VkResult
hk_get_timestamp(struct vk_device *device, uint64_t *timestamp)
{
struct hk_device *dev = container_of(device, struct hk_device, vk);
unreachable("todo");
// *timestamp = agx_get_gpu_timestamp(dev);
*timestamp = agx_gpu_time_to_ns(&dev->dev, agx_get_gpu_timestamp(&dev->dev));
return VK_SUCCESS;
}
@@ -408,6 +407,14 @@ hk_CreateDevice(VkPhysicalDevice physicalDevice,
dev->vk.check_status = hk_check_status;
dev->vk.get_timestamp = hk_get_timestamp;
/* This holds for current platforms. We do not currently implement
* timestamp scaling, this would require changes in the query copy kernel
* as well. Calibrated timestamps depends on this.
*/
assert(dev->dev.user_timestamp_to_ns.num ==
dev->dev.user_timestamp_to_ns.den &&
"user timestamps are in ns");
result = hk_descriptor_table_init(dev, &dev->images, AGX_TEXTURE_LENGTH,
1024, 1024 * 1024);
if (result != VK_SUCCESS)
+2 -2
View File
@@ -53,7 +53,7 @@ hk_get_device_extensions(const struct hk_instance *instance,
.KHR_16bit_storage = true,
.KHR_bind_memory2 = true,
.KHR_buffer_device_address = true,
.KHR_calibrated_timestamps = false,
.KHR_calibrated_timestamps = true,
.KHR_copy_commands2 = true,
.KHR_create_renderpass2 = true,
.KHR_dedicated_allocation = true,
@@ -134,7 +134,7 @@ hk_get_device_extensions(const struct hk_instance *instance,
.EXT_attachment_feedback_loop_layout = true,
.EXT_border_color_swizzle = true,
.EXT_buffer_device_address = true,
.EXT_calibrated_timestamps = false,
.EXT_calibrated_timestamps = true,
.EXT_conditional_rendering = false,
.EXT_color_write_enable = true,
.EXT_custom_border_color = true,