From 8f7437f05cf2862c6f9c8832156ce49d1831252d Mon Sep 17 00:00:00 2001 From: Igor Torrente Date: Mon, 14 Feb 2022 07:31:12 -0300 Subject: [PATCH] venus: add vkGetCalibratedTimestampsEXT extension Allows the extension passthrough and implements the extension calls. Signed-off-by: Igor Torrente Part-of: --- src/venus/vkr_common.c | 1 + src/venus/vkr_device.c | 16 ++++++++++++++++ src/venus/vkr_physical_device.c | 16 ++++++++++++++++ 3 files changed, 33 insertions(+) diff --git a/src/venus/vkr_common.c b/src/venus/vkr_common.c index e9c0564..1ccf1be 100644 --- a/src/venus/vkr_common.c +++ b/src/venus/vkr_common.c @@ -94,6 +94,7 @@ static const struct vn_info_extension_table vkr_extension_table = { .KHR_external_fence_fd = false, .KHR_external_memory_fd = true, /* EXT extensions */ + .EXT_calibrated_timestamps = true, .EXT_conservative_rasterization = true, .EXT_custom_border_color = true, .EXT_depth_clip_enable = true, diff --git a/src/venus/vkr_device.c b/src/venus/vkr_device.c index 4cd4f93..140b9d9 100644 --- a/src/venus/vkr_device.c +++ b/src/venus/vkr_device.c @@ -319,6 +319,20 @@ vkr_dispatch_vkDeviceWaitIdle(struct vn_dispatch_context *dispatch, vkr_cs_decoder_set_fatal(&ctx->decoder); } +static void +vkr_dispatch_vkGetCalibratedTimestampsEXT( + UNUSED struct vn_dispatch_context *ctx, + struct vn_command_vkGetCalibratedTimestampsEXT *args) +{ + struct vkr_device *dev = vkr_device_from_handle(args->device); + struct vn_device_proc_table *vk = &dev->proc_table; + + vn_replace_vkGetCalibratedTimestampsEXT_args_handle(args); + args->ret = vk->GetCalibratedTimestampsEXT(args->device, args->timestampCount, + args->pTimestampInfos, args->pTimestamps, + args->pMaxDeviation); +} + void vkr_context_init_device_dispatch(struct vkr_context *ctx) { @@ -330,4 +344,6 @@ vkr_context_init_device_dispatch(struct vkr_context *ctx) dispatch->dispatch_vkGetDeviceGroupPeerMemoryFeatures = vkr_dispatch_vkGetDeviceGroupPeerMemoryFeatures; dispatch->dispatch_vkDeviceWaitIdle = vkr_dispatch_vkDeviceWaitIdle; + dispatch->dispatch_vkGetCalibratedTimestampsEXT = + vkr_dispatch_vkGetCalibratedTimestampsEXT; } diff --git a/src/venus/vkr_physical_device.c b/src/venus/vkr_physical_device.c index d98a9b8..e56e296 100644 --- a/src/venus/vkr_physical_device.c +++ b/src/venus/vkr_physical_device.c @@ -630,6 +630,20 @@ vkr_dispatch_vkGetPhysicalDeviceExternalFenceProperties( args->physicalDevice, args->pExternalFenceInfo, args->pExternalFenceProperties); } +static void +vkr_dispatch_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT( + UNUSED struct vn_dispatch_context *ctx, + struct vn_command_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT *args) +{ + struct vkr_physical_device *physical_dev = + vkr_physical_device_from_handle(args->physicalDevice); + struct vn_physical_device_proc_table *vk = &physical_dev->proc_table; + + vn_replace_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT_args_handle(args); + args->ret = vk->GetPhysicalDeviceCalibrateableTimeDomainsEXT( + args->physicalDevice, args->pTimeDomainCount, args->pTimeDomains); +} + void vkr_context_init_physical_device_dispatch(struct vkr_context *ctx) { @@ -679,4 +693,6 @@ vkr_context_init_physical_device_dispatch(struct vkr_context *ctx) vkr_dispatch_vkGetPhysicalDeviceExternalSemaphoreProperties; dispatch->dispatch_vkGetPhysicalDeviceExternalFenceProperties = vkr_dispatch_vkGetPhysicalDeviceExternalFenceProperties; + dispatch->dispatch_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT = + vkr_dispatch_vkGetPhysicalDeviceCalibrateableTimeDomainsEXT; }